Makefile revision 1.3 1 1.3 agc # $NetBSD: Makefile,v 1.3 2016/06/16 15:17:56 agc Exp $
2 1.1 apb
3 1.1 apb .include <bsd.own.mk>
4 1.2 apb .include "../../Makefile.inc"
5 1.2 apb
6 1.2 apb .PATH: ${TZDISTDIR}
7 1.1 apb
8 1.1 apb # If you want something other than Eastern United States time as a template
9 1.1 apb # for handling POSIX-style time zone environment variables,
10 1.1 apb # change the line below (after finding the zone you want in the
11 1.1 apb # time zone files, or adding it to a time zone file).
12 1.1 apb # (When a POSIX-style environment variable is handled, the rules in the
13 1.1 apb # template file are used to determine "spring forward" and "fall back" days and
14 1.1 apb # times; the environment variable itself specifies UT offsets of standard and
15 1.1 apb # summer time.)
16 1.1 apb # Alternately, if you discover you've got the wrong time zone, you can just
17 1.1 apb # zic -p rightzone
18 1.1 apb # to correct things.
19 1.1 apb # Use the command
20 1.1 apb # make zonenames
21 1.1 apb # to get a list of the values you can use for POSIXRULES.
22 1.1 apb # If you want POSIX compatibility, use "America/New_York".
23 1.1 apb
24 1.1 apb POSIXRULES= America/New_York
25 1.1 apb
26 1.1 apb # "Compiled" time zone information is placed in the "TZDIR" directory
27 1.1 apb # (and subdirectories).
28 1.1 apb # Use an absolute path name for TZDIR unless you're just testing the software.
29 1.1 apb # Note: ${DESTDIR} is prepended to this for the actual copy.
30 1.1 apb
31 1.1 apb TZDIR= /usr/share/zoneinfo
32 1.1 apb
33 1.1 apb # If you always want time values interpreted as "seconds since the epoch
34 1.1 apb # (not counting leap seconds)", use
35 1.1 apb # REDO= posix_only
36 1.1 apb # below. If you always want right time values interpreted as "seconds since
37 1.1 apb # the epoch" (counting leap seconds)", use
38 1.1 apb # REDO= right_only
39 1.1 apb # below. If you want both sets of data available, with leap seconds not
40 1.1 apb # counted normally, use
41 1.1 apb # REDO= posix_right
42 1.1 apb # below. If you want both sets of data available, with leap seconds counted
43 1.1 apb # normally, use
44 1.1 apb # REDO= right_posix
45 1.1 apb # below.
46 1.1 apb
47 1.1 apb REDO= posix_only
48 1.1 apb
49 1.1 apb # Since "." may not be in PATH...
50 1.2 apb YEARISTYPE= "${HOST_SH} ${TZDISTDIR}/yearistype.sh"
51 1.1 apb
52 1.1 apb PRIMARY_YDATA= africa antarctica asia australasia \
53 1.1 apb europe northamerica southamerica
54 1.1 apb YDATA= $(PRIMARY_YDATA) pacificnew etcetera backward
55 1.1 apb NDATA= systemv factory
56 1.1 apb TDATA= $(YDATA) $(NDATA)
57 1.1 apb ZONETABLES= zone1970.tab zone.tab
58 1.1 apb TABDATA= iso3166.tab leapseconds $(ZONETABLES)
59 1.1 apb DATA= $(YDATA) $(NDATA) $(TABDATA) # yearistype.sh
60 1.1 apb
61 1.1 apb TZBUILDDIR= ${.OBJDIR}/builddir
62 1.1 apb
63 1.1 apb .PHONY: posix_only
64 1.1 apb posix_only: ${TDATA}
65 1.1 apb ${_MKTARGET_CREATE}
66 1.1 apb mkdir -p ${TZBUILDDIR}
67 1.2 apb cd ${TZDISTDIR} && \
68 1.1 apb ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR} -L /dev/null ${TDATA}
69 1.1 apb
70 1.1 apb .PHONY: right_only
71 1.1 apb right_only: leapseconds ${TDATA}
72 1.1 apb ${_MKTARGET_CREATE}
73 1.1 apb mkdir -p ${TZBUILDDIR}
74 1.2 apb cd ${TZDISTDIR} && \
75 1.1 apb ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR} -L leapseconds ${TDATA}
76 1.1 apb
77 1.1 apb .PHONY: other_two
78 1.1 apb other_two: leapseconds ${TDATA}
79 1.1 apb ${_MKTARGET_CREATE}
80 1.1 apb mkdir -p ${TZBUILDDIR}
81 1.2 apb cd ${TZDISTDIR} && \
82 1.1 apb ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR}/posix -L /dev/null ${TDATA}
83 1.2 apb cd ${TZDISTDIR} && \
84 1.1 apb ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR}/right -L leapseconds ${TDATA}
85 1.1 apb
86 1.1 apb .PHONY: posix_right
87 1.1 apb posix_right: posix_only other_two
88 1.1 apb
89 1.1 apb .PHONY: right_posix
90 1.1 apb right_posix: right_only other_two
91 1.1 apb
92 1.1 apb .if ${MKUNPRIVED} == "no"
93 1.1 apb TOOL_PAX.unpriv=-pe
94 1.1 apb .else
95 1.1 apb TOOL_PAX.unpriv=
96 1.1 apb .endif
97 1.1 apb
98 1.1 apb .if ${MKSHARE} != "no"
99 1.1 apb afterinstall: ${DATA} ${REDO} ${TABDATA}
100 1.1 apb ${_MKMSG_CREATE} ${POSIXRULES}
101 1.1 apb mkdir -p ${TZBUILDDIR}
102 1.2 apb cd ${TZDISTDIR} && \
103 1.1 apb ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR} -p ${POSIXRULES}
104 1.1 apb cd ${TZBUILDDIR} && \
105 1.1 apb find . -type f -print | xargs ${TOOL_STAT} -qf '%d,%i %N' | sort \
106 1.1 apb | while read devino tzfile; do \
107 1.1 apb destfile=${DESTDIR}${TZDIR}/$${tzfile#./}; \
108 1.1 apb destdir=$$(dirname $${destfile}); \
109 1.1 apb if [ ! -d "$$destdir" ]; then \
110 1.1 apb ${_MKSHMSG_INSTALL} $$destdir; \
111 1.1 apb ${_MKSHECHO} ${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} \
112 1.1 apb $$destdir; \
113 1.1 apb ${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} $$destdir; \
114 1.1 apb fi; \
115 1.1 apb if [ "$$devino" = "$$lastdevino" ]; then \
116 1.1 apb if ldevino=$$(${TOOL_STAT} -qf '%d %i' $$lastfile) && \
117 1.1 apb tdevino=$$(${TOOL_STAT} -qf '%d %i' $$destfile) && \
118 1.1 apb [ "$$ldevino" = "$$tdevino" ]; then \
119 1.1 apb continue; \
120 1.1 apb fi; \
121 1.1 apb ${_MKSHMSG_INSTALL} $$destfile; \
122 1.1 apb ${_MKSHECHO} ${INSTALL_LINK} -o ${BINOWN} -g ${BINGRP} \
123 1.1 apb -m ${NONBINMODE} $$lastfile $$destfile; \
124 1.1 apb ${INSTALL_LINK} -o ${BINOWN} -g ${BINGRP} \
125 1.1 apb -m ${NONBINMODE} $$lastfile $$destfile; \
126 1.1 apb else \
127 1.1 apb lastdevino=$$devino; \
128 1.1 apb lastfile=$$destfile; \
129 1.1 apb cmp -s $$tzfile $$destfile >/dev/null 2>&1 && continue;\
130 1.1 apb ${_MKSHMSG_INSTALL} $$destfile; \
131 1.1 apb ${_MKSHECHO} ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} \
132 1.1 apb -m ${NONBINMODE} $$tzfile $$destfile; \
133 1.1 apb ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} \
134 1.1 apb -m ${NONBINMODE} $$tzfile $$destfile; \
135 1.1 apb fi; \
136 1.1 apb done
137 1.1 apb for f in ${TABDATA}; do \
138 1.1 apb ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} \
139 1.2 apb ${TZDISTDIR}/$$f ${DESTDIR}${TZDIR}; \
140 1.1 apb done
141 1.3 agc ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} \
142 1.3 agc ${TZDISTDIR}/TZDATA_VERSION ${DESTDIR}${TZDIR}/TZDATA_VERSION
143 1.1 apb .else # ${MKSHARE} == "no"
144 1.1 apb afterinstall:
145 1.1 apb .endif # ${MKSHARE} == "no"
146 1.1 apb
147 1.1 apb clean:
148 1.1 apb -rm -rf ${TZBUILDDIR}
149 1.1 apb
150 1.1 apb .include <bsd.prog.mk>
151