55PACKAGE = tzcode
66
77# Version numbers of the code and data distributions.
8- VERSION = 2015g
8+ VERSION = 2016a
99
1010# Email address for bug reports.
1111@@ -84,14 +84,18 @@ LIBDIR= $(TOPDIR)/lib
8484# below. If you want both sets of data available, with leap seconds counted
8585# normally, use
8686# REDO= right_posix
87- # below. If you want just POSIX-compatible time values, but with
88- # out-of-scope and often-wrong data from the file 'backzone', use
89- # REDO= posix_packrat
90- # POSIX mandates that leap seconds not be counted; for compatibility with it,
91- # use "posix_only", "posix_right", or "posix_packrat".
87+ # below. POSIX mandates that leap seconds not be counted; for compatibility
88+ # with it, use "posix_only" or "posix_right".
9289
9390REDO = posix_right
9491
92+ # If you want out-of-scope and often-wrong data from the file 'backzone', use
93+ # PACKRATDATA= backzone
94+ # To omit this data, use
95+ # PACKRATDATA=
96+
97+ PACKRATDATA =
98+
9599# Since "." may not be in PATH...
96100
97101YEARISTYPE = ./yearistype
@@ -236,11 +240,22 @@ CFLAGS=
236240
237241LDFLAGS = $(LFLAGS )
238242
243+ # For leap seconds, this Makefile uses LEAPSECONDS='-L leapseconds' in
244+ # submake command lines. The default is no leap seconds.
245+
246+ LEAPSECONDS =
247+
248+ # The zic command and its arguments.
249+
239250zic = ./zic
240251ZIC = $(zic ) $(ZFLAGS )
241252
242253ZFLAGS =
243254
255+ # How to use zic to install tzdata binary files.
256+
257+ ZIC_INSTALL = $(ZIC ) -y $(YEARISTYPE ) -d $(DESTDIR )$(TZDIR ) $(LEAPSECONDS )
258+
244259# The name of a Posix-compliant 'awk' on your system.
245260AWK = awk
246261
@@ -344,7 +359,7 @@ MANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.txt \
344359 time2posix.3.txt \
345360 tzfile.5.txt tzselect.8.txt zic.8.txt zdump.8.txt \
346361 date.1.txt
347- COMMON= CONTRIBUTING Makefile NEWS README Theory
362+ COMMON= CONTRIBUTING LICENSE Makefile NEWS README Theory
348363WEB_PAGES= tz-art.htm tz-link.htm
349364DOCS= $( MANS) date.1 $( MANTXTS) $( WEB_PAGES)
350365PRIMARY_YDATA= africa antarctica asia australasia \
@@ -366,7 +381,7 @@ ENCHILADA= $(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC)
366381
367382SHELL= /bin/sh
368383
369- all: tzselect zic zdump libtz.a $( TABDATA)
384+ all: tzselect yearistype zic zdump libtz.a $( TABDATA)
370385
371386ALL: all date $( ENCHILADA)
372387
@@ -375,8 +390,7 @@ install: all $(DATA) $(REDO) $(MANS)
375390 $( DESTDIR) $( LIBDIR) \
376391 $( DESTDIR) $( MANDIR) /man3 $( DESTDIR) $( MANDIR) /man5 \
377392 $( DESTDIR) $( MANDIR) /man8
378- $( ZIC) -y $( YEARISTYPE) \
379- -d $( DESTDIR) $( TZDIR) -l $( LOCALTIME) -p $( POSIXRULES)
393+ $( ZIC_INSTALL) -l $( LOCALTIME) -p $( POSIXRULES)
380394 cp -f iso3166.tab $( ZONETABLES) $( DESTDIR) $( TZDIR) /.
381395 cp tzselect zic zdump $( DESTDIR) $( ETCDIR) /.
382396 cp libtz.a $( DESTDIR) $( LIBDIR) /.
@@ -398,7 +412,7 @@ version.h:
398412zdump: $( TZDOBJS)
399413 $( CC) -o $@ $( CFLAGS) $( LDFLAGS) $( TZDOBJS) $( LDLIBS)
400414
401- zic: $( TZCOBJS) yearistype
415+ zic: $( TZCOBJS)
402416 $( CC) -o $@ $( CFLAGS) $( LDFLAGS) $( TZCOBJS) $( LDLIBS)
403417
404418yearistype: yearistype.sh
@@ -408,13 +422,28 @@ yearistype: yearistype.sh
408422leapseconds: $( LEAP_DEPS)
409423 $( AWK) -f leapseconds.awk leap-seconds.list > $@
410424
411- posix_only: zic $( TDATA)
412- $( ZIC) -y $( YEARISTYPE) -d $( DESTDIR) $( TZDIR) \
413- -L /dev/null $( TDATA)
414-
415- right_only: zic leapseconds $( TDATA)
416- $( ZIC) -y $( YEARISTYPE) -d $( DESTDIR) $( TZDIR) \
417- -L leapseconds $( TDATA)
425+ # Arguments to pass to submakes of install_data.
426+ # They can be overridden by later submake arguments.
427+ INSTALLARGS = \
428+ DESTDIR=$( DESTDIR) \
429+ LEAPSECONDS=' $(LEAPSECONDS)' \
430+ PACKRATDATA=' $(PACKRATDATA)' \
431+ TZDIR=$( TZDIR) \
432+ YEARISTYPE=$( YEARISTYPE) \
433+ ZIC=' $(ZIC)'
434+
435+ # 'make install_data' installs one set of tz binary files.
436+ # It can be tailored by setting LEAPSECONDS, PACKRATDATA, etc.
437+ install_data: zic leapseconds yearistype $( PACKRATDATA) $( TDATA)
438+ $( ZIC_INSTALL) $( TDATA)
439+ $( AWK) ' /^Rule/' $( TDATA) | $( ZIC_INSTALL) - $( PACKRATDATA)
440+
441+ posix_only:
442+ $( MAKE) $( INSTALLARGS) LEAPSECONDS= install_data
443+
444+ right_only:
445+ $( MAKE) $( INSTALLARGS) LEAPSECONDS=' -L leapseconds' \
446+ install_data
418447
419448# In earlier versions of this makefile, the other two directories were
420449# subdirectories of $(TZDIR). However, this led to configuration errors.
@@ -425,26 +454,22 @@ right_only: zic leapseconds $(TDATA)
425454# Therefore, the other two directories are now siblings of $(TZDIR).
426455# You must replace all of $(TZDIR) to switch from not using leap seconds
427456# to using them, or vice versa.
428- right_posix: right_only leapseconds
457+ right_posix: right_only
429458 rm -fr $( DESTDIR) $( TZDIR) -leaps
430459 ln -s $( TZDIR_BASENAME) $( DESTDIR) $( TZDIR) -leaps || \
431- $( ZIC) -y $( YEARISTYPE) -d $( DESTDIR) $( TZDIR) -leaps \
432- -L leapseconds $( TDATA)
433- $( ZIC) -y $( YEARISTYPE) -d $( DESTDIR) $( TZDIR) -posix \
434- -L /dev/null $( TDATA)
460+ $( MAKE) $( INSTALLARGS) TZDIR=$( TZDIR) -leaps right_only
461+ $( MAKE) $( INSTALLARGS) TZDIR=$( TZDIR) -posix posix_only
435462
436- posix_right: posix_only leapseconds
463+ posix_right: posix_only
437464 rm -fr $( DESTDIR) $( TZDIR) -posix
438465 ln -s $( TZDIR_BASENAME) $( DESTDIR) $( TZDIR) -posix || \
439- $( ZIC) -y $( YEARISTYPE) -d $( DESTDIR) $( TZDIR) -posix \
440- -L /dev/null $( TDATA)
441- $( ZIC) -y $( YEARISTYPE) -d $( DESTDIR) $( TZDIR) -leaps \
442- -L leapseconds $( TDATA)
466+ $( MAKE) $( INSTALLARGS) TZDIR=$( TZDIR) -posix posix_only
467+ $( MAKE) $( INSTALLARGS) TZDIR=$( TZDIR) -leaps right_only
443468
444- posix_packrat: posix_only backzone
445- $( AWK ) ' /^Rule/ ' $( TDATA ) | \
446- $( ZIC ) -y $( YEARISTYPE ) -d $( DESTDIR ) $( TZDIR ) \
447- -L /dev/null - backzone
469+ # This obsolescent rule is present for backwards compatibility with
470+ # tz releases 2014g through 2015g. It should go away eventually.
471+ posix_packrat:
472+ $( MAKE ) $( INSTALLARGS ) PACKRATDATA= backzone posix_only
448473
449474zones: $( REDO)
450475
@@ -660,6 +685,7 @@ zic.o: private.h tzfile.h version.h
660685.PHONY : check check_character_set check_links
661686.PHONY : check_public check_sorted check_tables
662687.PHONY : check_time_t_alternatives check_web check_white_space clean clean_misc
663- .PHONY : install maintainer-clean names posix_packrat posix_only posix_right
688+ .PHONY : install install_data maintainer-clean names
689+ .PHONY : posix_only posix_packrat posix_right
664690.PHONY : public right_only right_posix signatures tarballs typecheck
665691.PHONY : zonenames zones
0 commit comments