dtrace: Address KMSAN warnings in dtrace_disx86
[freebsd/src.git] / share / zoneinfo / Makefile
blob824dda827e445d7b5b0d149adc2df0cb114fb72c
2 # HOW TO UPDATE THE ZONEINFO DATA
4 # Import the new sources to the vendor branch:
6 # $ cd ~/freebsd/src
7 # $ git worktree add ../tzdata vendor/tzdata
8 # $ pushd ../tzdata
9 # $ tar -xvf ../tzdata-latest.tar.gz
10 # (check with "git status" and "git diff" if it all makes sense)
11 # $ git add -A
12 # $ git commit -m "Import tzdata 20XXX"
13 # $ git tag -a -m "Tag import of tzdata 20XXX" vendor/tzdata/tzdata20XXX
14 # $ git push --follow-tags freebsd vendor/tzdata
15 # $ popd
17 # Merge-from-vendor
19 # $ git subtree merge -P contrib/tzdata vendor/tzdata
20 # (write a meaningful commit message)
21 # $ git push freebsd HEAD:main
23 # MFC
25 # $ git checkout -b freebsd/stable/12 stable-12
26 # $ git cherry-pick -x [hash of merge commit to main] -m 1 --edit
27 # (write a meaningful commit message)
28 # $ git push freebsd HEAD:stable/12
31 # If there are changes to zone1970.tab, update the baseline file by running
32 # `make baseline` in usr.sbin/tzsetup to check if tzsetup is able to parse new
33 # contents (if not, report/fix tzsetup). Check that update does not
34 # introduce breaking/unexpected changes to continents/countries/zones,
35 # and commit the updated baseline file.
37 .include <src.opts.mk>
39 PACKAGE= zoneinfo
40 CLEANDIRS+= builddir
41 CONTRIBDIR= ${SRCTOP}/contrib/tzdata/
42 .PATH: ${CONTRIBDIR}
44 .if defined(LEAPSECONDS)
45 .warning Using backwards compatibility variable for LEAPSECONDS; please use WITH_ZONEINFO_LEAPSECONDS_SUPPORT instead
46 MK_ZONEINFO_LEAPSECONDS_SUPPORT= yes
47 .endif
49 .if ${MK_ZONEINFO_LEAPSECONDS_SUPPORT} != "no"
50 LEAPFILE= -L ${CONTRIBDIR}leapseconds
51 .else
52 LEAPFILE=
53 .endif
55 TZFILES= africa antarctica asia australasia etcetera europe \
56 factory northamerica southamerica
57 TZFILES+= backward
59 TZFILES:= ${TZFILES:S/^/${CONTRIBDIR}/}
61 TZBUILDDIR= ${.OBJDIR}/builddir
62 TZBUILDSUBDIRS= \
63 Africa \
64 America/Argentina \
65 America/Indiana \
66 America/Kentucky \
67 America/North_Dakota \
68 Antarctica \
69 Arctic \
70 Asia \
71 Atlantic \
72 Australia \
73 Etc \
74 Europe \
75 Indian \
76 Pacific
77 TZBUILDSUBDIRS+= US Mexico Chile Canada Brazil
79 .if !defined(_SKIP_BUILD)
80 all: zonefiles
81 .endif
82 META_TARGETS+= zonefiles install-zoneinfo
85 # Produce “fat” zoneinfo files for backward compatibility.
87 ZICFLAGS?= -b fat
89 .if ${MK_DIRDEPS_BUILD} == "yes"
90 ZIC= ${STAGE_HOST_OBJTOP}/usr/sbin/zic
91 # we do everything in a single visit
92 install-zoneinfo: zonefiles
93 .endif
95 zonefiles: ${TDATA}
96 mkdir -p ${TZBUILDDIR}
97 (cd ${TZBUILDDIR}; mkdir -p ${TZBUILDSUBDIRS})
98 (umask 022; cd ${.CURDIR}; \
99 ${ZIC:Uzic} -D -d ${TZBUILDDIR} ${ZICFLAGS} -m ${NOBINMODE} \
100 ${LEAPFILE} ${TZFILES})
101 (cd ${TZBUILDDIR} && find * -type f | LC_ALL=C sort) > ${.TARGET}
103 beforeinstall: install-zoneinfo
104 install-zoneinfo:
105 mkdir -p ${DESTDIR}/usr/share/zoneinfo
106 (cd ${DESTDIR}/usr/share/zoneinfo; mkdir -p ${TZBUILDSUBDIRS})
107 for f in `cat zonefiles`; do \
108 ${INSTALL} ${TAG_ARGS} \
109 -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
110 ${TZBUILDDIR}/$${f} ${DESTDIR}/usr/share/zoneinfo/$${f}; \
111 done
112 ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
113 ${CONTRIBDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/
114 ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
115 ${CONTRIBDIR}/zone1970.tab ${DESTDIR}/usr/share/zoneinfo/
117 afterinstall:
119 # If the file /var/db/zoneinfo exists, and it is owned by root:wheel,
120 # and the contents of it exists in /usr/share/zoneinfo, then reinstall
121 # it.
123 @if [ -f ${DESTDIR}/var/db/zoneinfo -a -O ${DESTDIR}/var/db/zoneinfo \
124 -a -G ${DESTDIR}/var/db/zoneinfo ]; then \
125 zf=$$(cat ${DESTDIR}/var/db/zoneinfo); \
126 if [ -f ${DESTDIR}/usr/share/zoneinfo/$${zf} ]; then \
127 if [ ! -z "${DESTDIR}" ]; then \
128 optC="-C ${DESTDIR}"; \
129 fi; \
130 echo "Updating /etc/localtime"; \
131 tzsetup $${optC} -r; \
132 fi; \
133 else \
134 echo "Run tzsetup(8) manually to update /etc/localtime."; \
137 HAS_TESTS=
138 SUBDIR.${MK_TESTS}+= tests
140 .include <bsd.prog.mk>