2012-01-16 12:03:25 +01:00
|
|
|
# $NetBSD: Makefile,v 1.43 2009/04/10 16:16:12 apb Exp $
|
2010-05-12 18:28:54 +02:00
|
|
|
|
2010-06-25 20:29:09 +02:00
|
|
|
.include <bsd.own.mk>
|
2010-05-12 18:28:54 +02:00
|
|
|
|
|
|
|
# Change the line below for your time zone (after finding the zone you want in
|
|
|
|
# the time zone files, or adding it to a time zone file).
|
|
|
|
# Alternately, if you discover you've got the wrong time zone, you can just
|
|
|
|
# zic -l rightzone
|
|
|
|
|
|
|
|
# If you want something other than Eastern United States time as a template
|
|
|
|
# for handling POSIX-style time zone environment variables,
|
|
|
|
# change the line below (after finding the zone you want in the
|
|
|
|
# time zone files, or adding it to a time zone file).
|
|
|
|
# Alternately, if you discover you've got the wrong time zone, you can just
|
|
|
|
# zic -p rightzone
|
|
|
|
|
2012-01-16 12:03:25 +01:00
|
|
|
POSIXRULES= US/Pacific
|
2010-05-12 18:28:54 +02:00
|
|
|
|
|
|
|
# Use an absolute path name for TZDIR unless you're just testing the software.
|
2012-01-16 12:03:25 +01:00
|
|
|
# Note: ${DESTDIR} is prepended to this for the actual copy.
|
2010-05-12 18:28:54 +02:00
|
|
|
|
2012-01-16 12:03:25 +01:00
|
|
|
TZDIR= /usr/share/zoneinfo
|
2010-05-12 18:28:54 +02:00
|
|
|
|
|
|
|
# If you always want time values interpreted as "seconds since the epoch
|
|
|
|
# (not counting leap seconds)", use
|
|
|
|
# REDO= posix_only
|
|
|
|
# below. If you always want right time values interpreted as "seconds since
|
|
|
|
# the epoch" (counting leap seconds)", use
|
|
|
|
# REDO= right_only
|
|
|
|
# below. If you want both sets of data available, with leap seconds not
|
|
|
|
# counted normally, use
|
|
|
|
# REDO= posix_right
|
|
|
|
# below. If you want both sets of data available, with leap seconds counted
|
|
|
|
# normally, use
|
|
|
|
# REDO= right_posix
|
|
|
|
# below.
|
|
|
|
|
2012-01-16 12:03:25 +01:00
|
|
|
REDO= posix_only
|
2010-05-12 18:28:54 +02:00
|
|
|
|
|
|
|
# Since "." may not be in PATH...
|
|
|
|
YEARISTYPE= "${HOST_SH} ${.CURDIR}/yearistype.sh"
|
|
|
|
|
|
|
|
YDATA= africa antarctica asia australasia \
|
|
|
|
europe northamerica southamerica pacificnew etcetera factory \
|
|
|
|
backward
|
|
|
|
NDATA= systemv
|
|
|
|
SDATA= solar87 solar88 solar89
|
|
|
|
TDATA= $(YDATA) $(NDATA) $(SDATA)
|
|
|
|
TABDATA= iso3166.tab zone.tab
|
|
|
|
DATA= $(YDATA) $(NDATA) $(SDATA) leapseconds # yearistype.sh
|
|
|
|
USNO= usno1988 usno1989
|
|
|
|
|
2012-01-16 12:03:25 +01:00
|
|
|
TZBUILDDIR= ${.OBJDIR}/builddir
|
|
|
|
|
2010-05-12 18:28:54 +02:00
|
|
|
.PHONY: posix_only
|
|
|
|
posix_only: ${TDATA}
|
|
|
|
${_MKTARGET_CREATE}
|
2012-01-16 12:03:25 +01:00
|
|
|
mkdir -p ${TZBUILDDIR}
|
2010-05-12 18:28:54 +02:00
|
|
|
cd ${.CURDIR} && \
|
2012-01-16 12:03:25 +01:00
|
|
|
${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR} -L /dev/null ${TDATA}
|
2010-05-12 18:28:54 +02:00
|
|
|
|
|
|
|
.PHONY: right_only
|
|
|
|
right_only: leapseconds ${TDATA}
|
|
|
|
${_MKTARGET_CREATE}
|
2012-01-16 12:03:25 +01:00
|
|
|
mkdir -p ${TZBUILDDIR}
|
2010-05-12 18:28:54 +02:00
|
|
|
cd ${.CURDIR} && \
|
2012-01-16 12:03:25 +01:00
|
|
|
${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR} -L leapseconds ${TDATA}
|
|
|
|
|
2010-05-12 18:28:54 +02:00
|
|
|
.PHONY: other_two
|
|
|
|
other_two: leapseconds ${TDATA}
|
|
|
|
${_MKTARGET_CREATE}
|
2012-01-16 12:03:25 +01:00
|
|
|
mkdir -p ${TZBUILDDIR}
|
2010-05-12 18:28:54 +02:00
|
|
|
cd ${.CURDIR} && \
|
2012-01-16 12:03:25 +01:00
|
|
|
${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR}/posix -L /dev/null ${TDATA}
|
2010-05-12 18:28:54 +02:00
|
|
|
cd ${.CURDIR} && \
|
2012-01-16 12:03:25 +01:00
|
|
|
${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR}/right -L leapseconds ${TDATA}
|
2010-05-12 18:28:54 +02:00
|
|
|
|
|
|
|
.PHONY: posix_right
|
|
|
|
posix_right: posix_only other_two
|
|
|
|
|
|
|
|
.PHONY: right_posix
|
|
|
|
right_posix: right_only other_two
|
|
|
|
|
2012-01-16 12:03:25 +01:00
|
|
|
.if ${MKUNPRIVED} == "no"
|
|
|
|
TOOL_PAX.unpriv=-pe
|
|
|
|
.else
|
|
|
|
TOOL_PAX.unpriv=
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if ${MKSHARE} != "no"
|
2010-05-12 18:28:54 +02:00
|
|
|
afterinstall: ${DATA} ${REDO} ${TABDATA}
|
|
|
|
${_MKMSG_CREATE} ${POSIXRULES}
|
2012-01-16 12:03:25 +01:00
|
|
|
mkdir -p ${TZBUILDDIR}
|
2010-05-12 18:28:54 +02:00
|
|
|
cd ${.CURDIR} && \
|
2012-01-16 12:03:25 +01:00
|
|
|
${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR} -p ${POSIXRULES}
|
|
|
|
cd ${TZBUILDDIR} && \
|
|
|
|
find . -type f -print | xargs ${TOOL_STAT} -qf '%d,%i %N' | sort \
|
|
|
|
| while read devino tzfile; do \
|
|
|
|
destfile=${DESTDIR}${TZDIR}/$${tzfile#./}; \
|
|
|
|
if [ "$$devino" = "$$lastdevino" ]; then \
|
|
|
|
if ldevino=`${TOOL_STAT} -qf '%d %i' $$lastfile` && \
|
|
|
|
tdevino=`${TOOL_STAT} -qf '%d %i' $$destfile` && \
|
|
|
|
[ "$$ldevino" = "$$tdevino" ]; then \
|
|
|
|
continue; \
|
|
|
|
fi; \
|
|
|
|
${_MKSHMSG_INSTALL} $$destfile; \
|
|
|
|
${_MKSHECHO} ${INSTALL_LINK} -o ${BINOWN} -g ${BINGRP} \
|
|
|
|
-m ${NONBINMODE} $$lastfile $$destfile; \
|
|
|
|
${INSTALL_LINK} -o ${BINOWN} -g ${BINGRP} \
|
|
|
|
-m ${NONBINMODE} $$lastfile $$destfile; \
|
|
|
|
else \
|
|
|
|
lastdevino=$$devino; \
|
|
|
|
lastfile=$$destfile; \
|
|
|
|
cmp -s $$tzfile $$destfile >/dev/null 2>&1 && continue;\
|
|
|
|
${_MKSHMSG_INSTALL} $$destfile; \
|
|
|
|
${_MKSHECHO} ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} \
|
|
|
|
-m ${NONBINMODE} $$tzfile $$destfile; \
|
|
|
|
${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} \
|
|
|
|
-m ${NONBINMODE} $$tzfile $$destfile; \
|
|
|
|
fi; \
|
|
|
|
done
|
2010-05-12 18:28:54 +02:00
|
|
|
for f in ${TABDATA}; do \
|
|
|
|
${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} \
|
|
|
|
${.CURDIR}/$$f ${DESTDIR}${TZDIR}; \
|
|
|
|
done
|
2012-01-16 12:03:25 +01:00
|
|
|
.else # ${MKSHARE} == "no"
|
|
|
|
afterinstall:
|
|
|
|
.endif # ${MKSHARE} == "no"
|
|
|
|
|
|
|
|
clean:
|
|
|
|
-rm -rf ${TZBUILDDIR}
|
2010-05-12 18:28:54 +02:00
|
|
|
|
2010-06-25 20:29:09 +02:00
|
|
|
.include <bsd.prog.mk>
|