Makefile revision 1.5 1 1.5 kre # $NetBSD: Makefile,v 1.5 2024/06/02 00:21:12 kre 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 PRIMARY_YDATA= africa antarctica asia australasia \
50 1.1 apb europe northamerica southamerica
51 1.4 kre YDATA= $(PRIMARY_YDATA) etcetera backward
52 1.4 kre NDATA= factory
53 1.1 apb TDATA= $(YDATA) $(NDATA)
54 1.1 apb ZONETABLES= zone1970.tab zone.tab
55 1.5 kre TABDATA= iso3166.tab leapseconds leap-seconds.list $(ZONETABLES)
56 1.4 kre DATA= $(YDATA) $(NDATA) $(TABDATA)
57 1.1 apb
58 1.1 apb TZBUILDDIR= ${.OBJDIR}/builddir
59 1.1 apb
60 1.1 apb .PHONY: posix_only
61 1.1 apb posix_only: ${TDATA}
62 1.1 apb ${_MKTARGET_CREATE}
63 1.1 apb mkdir -p ${TZBUILDDIR}
64 1.2 apb cd ${TZDISTDIR} && \
65 1.4 kre ${TOOL_ZIC} -d ${TZBUILDDIR} -L /dev/null ${TDATA}
66 1.1 apb
67 1.1 apb .PHONY: right_only
68 1.1 apb right_only: leapseconds ${TDATA}
69 1.1 apb ${_MKTARGET_CREATE}
70 1.1 apb mkdir -p ${TZBUILDDIR}
71 1.2 apb cd ${TZDISTDIR} && \
72 1.4 kre ${TOOL_ZIC} -d ${TZBUILDDIR} -L leapseconds ${TDATA}
73 1.1 apb
74 1.1 apb .PHONY: other_two
75 1.1 apb other_two: leapseconds ${TDATA}
76 1.1 apb ${_MKTARGET_CREATE}
77 1.1 apb mkdir -p ${TZBUILDDIR}
78 1.2 apb cd ${TZDISTDIR} && \
79 1.4 kre ${TOOL_ZIC} -d ${TZBUILDDIR}/posix -L /dev/null ${TDATA}
80 1.2 apb cd ${TZDISTDIR} && \
81 1.4 kre ${TOOL_ZIC} -d ${TZBUILDDIR}/right -L leapseconds ${TDATA}
82 1.1 apb
83 1.1 apb .PHONY: posix_right
84 1.1 apb posix_right: posix_only other_two
85 1.1 apb
86 1.1 apb .PHONY: right_posix
87 1.1 apb right_posix: right_only other_two
88 1.1 apb
89 1.1 apb .if ${MKUNPRIVED} == "no"
90 1.1 apb TOOL_PAX.unpriv=-pe
91 1.1 apb .else
92 1.1 apb TOOL_PAX.unpriv=
93 1.1 apb .endif
94 1.1 apb
95 1.1 apb .if ${MKSHARE} != "no"
96 1.1 apb afterinstall: ${DATA} ${REDO} ${TABDATA}
97 1.1 apb ${_MKMSG_CREATE} ${POSIXRULES}
98 1.1 apb mkdir -p ${TZBUILDDIR}
99 1.2 apb cd ${TZDISTDIR} && \
100 1.4 kre ${TOOL_ZIC} -d ${TZBUILDDIR} -p ${POSIXRULES}
101 1.1 apb cd ${TZBUILDDIR} && \
102 1.1 apb find . -type f -print | xargs ${TOOL_STAT} -qf '%d,%i %N' | sort \
103 1.1 apb | while read devino tzfile; do \
104 1.1 apb destfile=${DESTDIR}${TZDIR}/$${tzfile#./}; \
105 1.1 apb destdir=$$(dirname $${destfile}); \
106 1.1 apb if [ ! -d "$$destdir" ]; then \
107 1.1 apb ${_MKSHMSG_INSTALL} $$destdir; \
108 1.1 apb ${_MKSHECHO} ${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} \
109 1.1 apb $$destdir; \
110 1.1 apb ${INSTALL_DIR} -o ${BINOWN} -g ${BINGRP} $$destdir; \
111 1.1 apb fi; \
112 1.1 apb if [ "$$devino" = "$$lastdevino" ]; then \
113 1.1 apb if ldevino=$$(${TOOL_STAT} -qf '%d %i' $$lastfile) && \
114 1.1 apb tdevino=$$(${TOOL_STAT} -qf '%d %i' $$destfile) && \
115 1.1 apb [ "$$ldevino" = "$$tdevino" ]; then \
116 1.1 apb continue; \
117 1.1 apb fi; \
118 1.1 apb ${_MKSHMSG_INSTALL} $$destfile; \
119 1.1 apb ${_MKSHECHO} ${INSTALL_LINK} -o ${BINOWN} -g ${BINGRP} \
120 1.1 apb -m ${NONBINMODE} $$lastfile $$destfile; \
121 1.1 apb ${INSTALL_LINK} -o ${BINOWN} -g ${BINGRP} \
122 1.1 apb -m ${NONBINMODE} $$lastfile $$destfile; \
123 1.1 apb else \
124 1.1 apb lastdevino=$$devino; \
125 1.1 apb lastfile=$$destfile; \
126 1.1 apb cmp -s $$tzfile $$destfile >/dev/null 2>&1 && continue;\
127 1.1 apb ${_MKSHMSG_INSTALL} $$destfile; \
128 1.1 apb ${_MKSHECHO} ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} \
129 1.1 apb -m ${NONBINMODE} $$tzfile $$destfile; \
130 1.1 apb ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} \
131 1.1 apb -m ${NONBINMODE} $$tzfile $$destfile; \
132 1.1 apb fi; \
133 1.1 apb done
134 1.1 apb for f in ${TABDATA}; do \
135 1.1 apb ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} \
136 1.2 apb ${TZDISTDIR}/$$f ${DESTDIR}${TZDIR}; \
137 1.1 apb done
138 1.3 agc ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} \
139 1.3 agc ${TZDISTDIR}/TZDATA_VERSION ${DESTDIR}${TZDIR}/TZDATA_VERSION
140 1.1 apb .else # ${MKSHARE} == "no"
141 1.1 apb afterinstall:
142 1.1 apb .endif # ${MKSHARE} == "no"
143 1.1 apb
144 1.1 apb clean:
145 1.1 apb -rm -rf ${TZBUILDDIR}
146 1.1 apb
147 1.1 apb .include <bsd.prog.mk>
148