@@ -10,6 +10,15 @@ VERSION= unknown
1010# Email address for bug reports.
11111212
13+ # Choose source data features. To get new features right away, use:
14+ # DATAFORM= vanguard
15+ # To wait a while before using new features, to give downstream users
16+ # time to upgrade zic (the default), use:
17+ # DATAFORM= main
18+ # To wait even longer for new features, use:
19+ # DATAFORM= rearguard
20+ DATAFORM = main
21+
1322# Change the line below for your time zone (after finding the zone you want in
1423# the time zone files, or adding it to a time zone file).
1524# Alternately, if you discover you've got the wrong time zone, you can just
@@ -25,10 +34,10 @@ LOCALTIME= GMT
2534# for handling POSIX-style time zone environment variables,
2635# change the line below (after finding the zone you want in the
2736# time zone files, or adding it to a time zone file).
28- # ( When a POSIX-style environment variable is handled, the rules in the
37+ # When a POSIX-style environment variable is handled, the rules in the
2938# template file are used to determine "spring forward" and "fall back" days and
3039# times; the environment variable itself specifies UT offsets of standard and
31- # summer time.)
40+ # daylight saving time.
3241# Alternately, if you discover you've got the wrong time zone, you can just
3342# zic -p rightzone
3443# to correct things.
@@ -189,13 +198,18 @@ LDLIBS=
189198# -DHAVE_STDINT_H if you have a non-C99 compiler with <stdint.h>
190199# -DHAVE_STRFTIME_L if <time.h> declares locale_t and strftime_l
191200# -DHAVE_STRDUP=0 if your system lacks the strdup function
201+ # -DHAVE_STRTOLL=0 if your system lacks the strtoll function
192202# -DHAVE_SYMLINK=0 if your system lacks the symlink function
193203# -DHAVE_SYS_STAT_H=0 if your compiler lacks a <sys/stat.h>
194204# -DHAVE_SYS_WAIT_H=0 if your compiler lacks a <sys/wait.h>
195205# -DHAVE_TZSET=0 if your system lacks a tzset function
196206# -DHAVE_UNISTD_H=0 if your compiler lacks a <unistd.h>
197207# -Dlocale_t=XXX if your system uses XXX instead of locale_t
208+ # -DRESERVE_STD_EXT_IDS if your platform reserves standard identifiers
209+ # with external linkage, e.g., applications cannot define 'localtime'.
198210# -Dssize_t=long on hosts like MS-Windows that lack ssize_t
211+ # -DSUPPRESS_TZDIR to not prepend TZDIR to file names; this has
212+ # security implications and is not recommended for general use
199213# -DTHREAD_SAFE to make localtime.c thread-safe, as POSIX requires;
200214# not needed by the main-program tz code, which is single-threaded.
201215# Append other compiler flags as needed, e.g., -pthread on GNU/Linux.
@@ -394,13 +408,19 @@ SAFE_CHARSET3= 'abcdefghijklmnopqrstuvwxyz{|}~'
394408SAFE_CHARSET= $(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3)
395409SAFE_CHAR= ' []' $(SAFE_CHARSET)' -]'
396410
411+ # Non-ASCII non-letters that OK_CHAR allows, as these characters are
412+ # useful in commentary. XEmacs 21.5.34 displays them correctly,
413+ # presumably because they are Latin-1.
414+ UNUSUAL_OK_CHARSET= °±½¾×
415+
397416# OK_CHAR matches any character allowed in the distributed files.
398- # This is the same as SAFE_CHAR, except that multibyte letters are
399- # also allowed so that commentary can contain people' s names and quote
400- # non-English sources. For non-letters the sources are limited to
401- # ASCII renderings for the convenience of maintainers whose text editors
402- # mishandle UTF-8 by default (e.g., XEmacs 21.4.22).
403- OK_CHAR= ' [][:alpha:]' $( SAFE_CHARSET) ' -]'
417+ # This is the same as SAFE_CHAR, except that UNUSUAL_OK_CHARSET and
418+ # multibyte letters are also allowed so that commentary can contain a
419+ # few safe symbols and people' s names and can quote non-English sources.
420+ # Other non-letters are limited to ASCII renderings for the
421+ # convenience of maintainers using XEmacs 21.5.34, which by default
422+ # mishandles Unicode characters U+0100 and greater.
423+ OK_CHAR= ' [][:alpha:]$(UNUSUAL_OK_CHARSET)' $( SAFE_CHARSET) ' -]'
404424
405425# SAFE_LINE matches a line of safe characters.
406426# SAFE_SHARP_LINE is similar, except any OK character can follow '#';
@@ -462,10 +482,12 @@ TDATA= $(YDATA) $(NDATA) $(BACKWARD)
462482ZONETABLES= zone1970.tab zone.tab
463483TABDATA= iso3166.tab $( TZDATA_TEXT) $( ZONETABLES)
464484LEAP_DEPS= leapseconds.awk leap-seconds.list
465- TZDATA_ZI_DEPS= zishrink.awk version $( TDATA) $( PACKRATDATA)
485+ TZDATA_ZI_DEPS= ziguard.awk zishrink.awk version $( TDATA) $( PACKRATDATA)
486+ DSTDATA_ZI_DEPS= ziguard.awk $( TDATA) $( PACKRATDATA)
466487DATA= $( TDATA_TO_CHECK) backzone iso3166.tab leap-seconds.list \
467488 leapseconds yearistype.sh $( ZONETABLES)
468- AWK_SCRIPTS= checklinks.awk checktab.awk leapseconds.awk zishrink.awk
489+ AWK_SCRIPTS= checklinks.awk checktab.awk leapseconds.awk \
490+ ziguard.awk zishrink.awk
469491MISC= $( AWK_SCRIPTS) zoneinfo2tdf.pl
470492TZS_YEAR= 2050
471493TZS= to$( TZS_YEAR) .tzs
@@ -499,7 +521,8 @@ VERSION_DEPS= \
499521
500522SHELL= /bin/sh
501523
502- all: tzselect yearistype zic zdump libtz.a $( TABDATA)
524+ all: tzselect yearistype zic zdump libtz.a $( TABDATA) \
525+ vanguard.zi main.zi rearguard.zi
503526
504527ALL: all date $( ENCHILADA)
505528
@@ -534,11 +557,15 @@ version: $(VERSION_DEPS)
534557 printf ' %s\n' " $$ V" > $@ .out
535558 mv $@ .out $@
536559
537- # This file can be tailored by setting BACKWARD, PACKRATDATA, etc.
538- tzdata.zi: $( TZDATA_ZI_DEPS)
560+ # These files can be tailored by setting BACKWARD, PACKRATDATA, etc.
561+ vanguard.zi main.zi rearguard.zi: $( DSTDATA_ZI_DEPS)
562+ $( AWK) -v outfile=' $@' -f ziguard.awk $( TDATA) $( PACKRATDATA) \
563+ > $@ .out
564+ mv $@ .out $@
565+ tzdata.zi: $( DATAFORM) .zi version
539566 version= ` sed 1q version` && \
540567 LC_ALL=C $( AWK) -v version=" $$ version" -f zishrink.awk \
541- $( TDATA ) $( PACKRATDATA ) > $@ .out
568+ $( DATAFORM ) .zi > $@ .out
542569 mv $@ .out $@
543570
544571version.h: version
@@ -614,19 +641,29 @@ posix_packrat:
614641
615642zones: $( REDO)
616643
644+ # dummy.zd is not a real file; it is mentioned here only so that the
645+ # top-level 'make' does not have a syntax error.
646+ ZDS = dummy.zd
647+ # Rule used only by submakes invoked by the $(TZS_NEW) rule.
648+ # It is separate so that GNU 'make -j' can run instances in parallel.
649+ $( ZDS) : zdump
650+ ./zdump -i -c $( TZS_YEAR) ' $(wd)/' $$ (expr $@ : ' \(.*\).zd' ) > $@
651+
617652$( TZS_NEW) : tzdata.zi zdump zic
618- mkdir -p tzs.dir
653+ rm -fr tzs.dir
654+ mkdir tzs.dir
619655 $( zic) -d tzs.dir tzdata.zi
620656 $( AWK) ' /^L/{print "Link\t" $$2 "\t" $$3}' \
621657 tzdata.zi | LC_ALL=C sort > $@ .out
622658 wd= ` pwd` && \
623- zones= ` $(AWK ) -v wd="$$wd" \
624- '/^Z/{print wd "/tzs.dir/" $$2}' tzdata.zi \
625- | LC_ALL=C sort` && \
626- ./zdump -i -c $( TZS_YEAR) $$ zones >> $@ .out
627- sed ' s,^TZ=".*tzs\.dir/,TZ=",' $@ .out > $@ .sed.out
628- rm -fr tzs.dir $@ .out
629- mv $@ .sed.out $@
659+ set x ` $(AWK ) '/^Z/{print "tzs.dir/" $$2 ".zd"}' tzdata.zi \
660+ | LC_ALL=C sort -t . -k 2,2` && \
661+ shift && \
662+ ZDS=$$ * && \
663+ $( MAKE) wd=" $$ wd" TZS_YEAR=$( TZS_YEAR) ZDS=" $$ ZDS" $$ ZDS && \
664+ sed ' s,^TZ=".*tzs\.dir/,TZ=",' $$ ZDS >> $@ .out
665+ rm -fr tzs.dir
666+ mv $@ .out $@
630667
631668# If $(TZS) does not already exist (e.g., old-format tarballs), create it.
632669# If it exists but 'make check_tzs' fails, a maintainer should inspect the
@@ -669,8 +706,10 @@ check_character_set: $(ENCHILADA)
669706 sharp=' #' && \
670707 ! grep -Env $( SAFE_LINE) $( MANS) date.1 $( MANTXTS) \
671708 $( MISC) $( SOURCES) $( WEB_PAGES) \
672- CONTRIBUTING LICENSE Makefile README \
709+ CONTRIBUTING LICENSE README \
673710 version tzdata.zi && \
711+ ! grep -Env $( SAFE_LINE) ' |^UNUSUAL_OK_CHARSET=' $( OK_CHAR) ' *$$' \
712+ Makefile && \
674713 ! grep -Env $( SAFE_SHARP_LINE) $( TDATA_TO_CHECK) backzone \
675714 leapseconds yearistype.sh zone.tab && \
676715 ! grep -Env $( OK_LINE) $( ENCHILADA) ; \
@@ -702,7 +741,7 @@ check_sorted: backward backzone iso3166.tab zone.tab zone1970.tab
702741 $( AWK) ' /^[^#]/ $(CHECK_CC_LIST)' zone1970.tab | \
703742 LC_ALL= C sort -c u
704743
705- check_links: checklinks.awk $( TDATA_TO_CHECK)
744+ check_links: checklinks.awk $( TDATA_TO_CHECK) tzdata.zi
706745 $( AWK) -f checklinks.awk $( TDATA_TO_CHECK)
707746 $( AWK) -f checklinks.awk tzdata.zi
708747
@@ -720,17 +759,26 @@ check_tzs: $(TZS) $(TZS_NEW)
720759check_web: tz-how-to.html
721760 $( VALIDATE_ENV) $( VALIDATE) $( VALIDATE_FLAGS) tz-how-to.html
722761
723- # Check that tzdata.zi generates the same binary data that its sources do.
724- check_zishrink: tzdata.zi zic leapseconds $( PACKRATDATA) $( TDATA)
762+ # Check that zishrink.awk does not alter the data, and that ziguard.awk
763+ # preserves main-format data.
764+ check_zishrink: zic leapseconds $( PACKRATDATA) $( TDATA) \
765+ $( DATAFORM) .zi tzdata.zi
725766 for type in posix right; do \
726- mkdir -p time_t.dir/$$ type time_t.dir/$$ type-shrunk && \
767+ mkdir -p time_t.dir/$$ type time_t.dir/$$ type-t \
768+ time_t.dir/$$ type-shrunk && \
727769 case $$ type in \
728770 right) leap=' -L leapseconds' ;; \
729771 * ) leap=;; \
730772 esac && \
731- $( ZIC) $$ leap -d time_t.dir/$$ type $( TDATA) && \
732- $( AWK) ' /^Rule/' $( TDATA) | \
733- $( ZIC) $$ leap -d time_t.dir/$$ type - $( PACKRATDATA) && \
773+ $( ZIC) $$ leap -d time_t.dir/$$ type $( DATAFORM) .zi && \
774+ case $( DATAFORM) in \
775+ main) \
776+ $( ZIC) $$ leap -d time_t.dir/$$ type-t $( TDATA) && \
777+ $( AWK) ' /^Rule/' $( TDATA) | \
778+ $( ZIC) $$ leap -d time_t.dir/$$ type-t - \
779+ $( PACKRATDATA) && \
780+ diff -r time_t.dir/$$ type time_t.dir/$$ type-t;; \
781+ esac && \
734782 $( ZIC) $$ leap -d time_t.dir/$$ type-shrunk tzdata.zi && \
735783 diff -r time_t.dir/$$ type time_t.dir/$$ type-shrunk || exit; \
736784 done
@@ -740,7 +788,7 @@ clean_misc:
740788 rm -f core * .o * .out \
741789 date tzselect version.h zdump zic yearistype libtz.a
742790clean: clean_misc
743- rm -fr * .dir tzdata .zi tzdb-* / $( TZS_NEW)
791+ rm -fr * .dir * .zi tzdb-* / $( TZS_NEW)
744792
745793maintainer-clean: clean
746794 @echo ' This command is intended for maintainers to use; it'
@@ -856,6 +904,9 @@ tarballs traditional_tarballs signatures traditional_signatures: version
856904 VERSION=`cat version` && \
857905 $(MAKE) VERSION="$$VERSION" $@_version
858906
907+ # These *_version rules are intended for use if VERSION is set by some
908+ # other means. Ordinarily these rules are used only by the above
909+ # non-_version rules, which set VERSION on the ' make' command line.
859910tarballs_version: traditional_tarballs_version tzdb-$(VERSION).tar.lz
860911traditional_tarballs_version: \
861912 tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz
@@ -917,13 +968,17 @@ zic.o: private.h tzfile.h version.h
917968.KEEP_STATE:
918969
919970.PHONY: ALL INSTALL all
920- .PHONY: check check_character_set check_links
971+ .PHONY: check check_character_set check_links check_name_lengths
921972.PHONY: check_public check_sorted check_tables
922973.PHONY: check_time_t_alternatives check_tzs check_web check_white_space
923974.PHONY: check_zishrink
924- .PHONY: clean clean_misc force_tzs
975+ .PHONY: clean clean_misc dummy.zd force_tzs
925976.PHONY: install install_data maintainer-clean names
926977.PHONY: posix_only posix_packrat posix_right
927978.PHONY: public right_only right_posix signatures signatures_version
928- .PHONY: tarballs tarballs_version typecheck
979+ .PHONY: tarballs tarballs_version
980+ .PHONY: traditional_signatures traditional_signatures_version
981+ .PHONY: traditional_tarballs traditional_tarballs_version
982+ .PHONY: typecheck
929983.PHONY: zonenames zones
984+ .PHONY: $(ZDS)
0 commit comments