@@ -42,36 +42,63 @@ POSIXRULES= America/New_York
4242# Also see TZDEFRULESTRING below, which takes effect only
4343# if the time zone files cannot be accessed.
4444
45- # Everything gets put in subdirectories of. . .
4645
47- TOPDIR = /usr/local
46+ # Installation locations.
47+ #
48+ # The defaults are suitable for Debian, except that if REDO is
49+ # posix_right or right_posix then files that Debian puts under
50+ # /usr/share/zoneinfo/posix and /usr/share/zoneinfo/right are instead
51+ # put under /usr/share/zoneinfo-posix and /usr/share/zoneinfo-leaps,
52+ # respectively. Problems with the Debian approach are discussed in
53+ # the commentary for the right_posix rule (below).
54+
55+ # Destination directory, which can be used for staging.
56+ # 'make DESTDIR=/stage install' installs under /stage (e.g., to
57+ # /stage/etc/localtime instead of to /etc/localtime). Files under
58+ # /stage are not intended to work as-is, but can be copied by hand to
59+ # the root directory later. If DESTDIR is empty, 'make install' does
60+ # not stage, but installs directly into production locations.
61+ DESTDIR =
62+
63+ # Everything is installed into subdirectories of TOPDIR, and used there.
64+ # TOPDIR should be empty (meaning the root directory),
65+ # or a directory name that does not end in "/".
66+ # TOPDIR should be empty or an absolute name unless you're just testing.
67+ TOPDIR =
68+
69+ # The default local time zone is taken from the file TZDEFAULT.
70+ TZDEFAULT = $(TOPDIR ) /etc/localtime
71+
72+ # The subdirectory containing installed program and data files, and
73+ # likewise for installed files that can be shared among architectures.
74+ # These should be relative file names.
75+ USRDIR = usr
76+ USRSHAREDIR = $(USRDIR ) /share
4877
4978# "Compiled" time zone information is placed in the "TZDIR" directory
5079# (and subdirectories).
51- # Use an absolute path name for TZDIR unless you're just testing the software.
5280# TZDIR_BASENAME should not contain "/" and should not be ".", ".." or empty.
53-
5481TZDIR_BASENAME = zoneinfo
55- TZDIR = $(TOPDIR ) /etc/$(TZDIR_BASENAME )
56-
57- # Types to try, as an alternative to time_t. int64_t should be first.
58- TIME_T_ALTERNATIVES = int64_t int32_t uint32_t uint64_t
59-
60- # The "tzselect", "zic", and "zdump" commands get installed in. . .
82+ TZDIR = $(TOPDIR ) /$(USRSHAREDIR ) /$(TZDIR_BASENAME )
6183
62- ETCDIR = $(TOPDIR ) /etc
84+ # The "tzselect" and (if you do "make INSTALL") "date" commands go in:
85+ BINDIR = $(TOPDIR ) /$(USRDIR ) /bin
6386
64- # If you "make INSTALL", the "date" command gets installed in. . .
87+ # The "zdump" command goes in:
88+ ZDUMPDIR = $(BINDIR )
6589
66- BINDIR = $(TOPDIR ) /bin
90+ # The "zic" command goes in:
91+ ZICDIR = $(TOPDIR ) /$(USRDIR ) /sbin
6792
6893# Manual pages go in subdirectories of. . .
69-
70- MANDIR = $(TOPDIR ) /man
94+ MANDIR = $(TOPDIR ) /$(USRSHAREDIR ) /man
7195
7296# Library functions are put in an archive in LIBDIR.
97+ LIBDIR = $(TOPDIR ) /$(USRDIR ) /lib
98+
7399
74- LIBDIR = $(TOPDIR ) /lib
100+ # Types to try, as an alternative to time_t. int64_t should be first.
101+ TIME_T_ALTERNATIVES = int64_t int32_t uint32_t uint64_t
75102
76103# If you want only POSIX time, with time values interpreted as
77104# seconds since the epoch (not counting leap seconds), use
@@ -105,11 +132,14 @@ REDO= posix_right
105132TZDATA_TEXT = leapseconds tzdata.zi
106133
107134# For backward-compatibility links for old zone names, use
135+ # BACKWARD= backward
136+ # If you also want the link US/Pacific-New, even though it is confusing
137+ # and is planned to be removed from the database eventually, use
108138# BACKWARD= backward pacificnew
109139# To omit these links, use
110140# BACKWARD=
111141
112- BACKWARD = backward pacificnew
142+ BACKWARD = backward
113143
114144# If you want out-of-scope and often-wrong data from the file 'backzone', use
115145# PACKRATDATA= backzone
@@ -313,7 +343,7 @@ ZFLAGS=
313343
314344# How to use zic to install tz binary files.
315345
316- ZIC_INSTALL = $(ZIC ) -d $(DESTDIR )$(TZDIR ) $(LEAPSECONDS )
346+ ZIC_INSTALL = $(ZIC ) -d ' $(DESTDIR )$(TZDIR ) ' $(LEAPSECONDS )
317347
318348# The name of a Posix-compliant 'awk' on your system.
319349AWK = awk
@@ -341,8 +371,8 @@ SGML_CATALOG_FILES= \
341371VALIDATE = nsgmls
342372VALIDATE_FLAGS = -s -B -wall -wno-unused-param
343373VALIDATE_ENV = \
344- SGML_CATALOG_FILES=$(SGML_CATALOG_FILES ) \
345- SGML_SEARCH_PATH=$(SGML_SEARCH_PATH ) \
374+ SGML_CATALOG_FILES=' $(SGML_CATALOG_FILES ) ' \
375+ SGML_SEARCH_PATH=' $(SGML_SEARCH_PATH ) ' \
346376 SP_CHARSET_FIXED=YES \
347377 SP_ENCODING=UTF-8
348378
@@ -396,7 +426,7 @@ GZIPFLAGS= -9n
396426# MAKE= make
397427
398428cc= cc
399- CC= $( cc) -DTZDIR=\ "$( TZDIR) \"
429+ CC= $( cc) -DTZDIR=' "$(TZDIR)" '
400430
401431AR= ar
402432
@@ -421,7 +451,7 @@ MANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.txt \
421451 date.1.txt
422452COMMON= calendars CONTRIBUTING LICENSE Makefile \
423453 NEWS README theory.html version
424- WEB_PAGES= tz-art.htm tz-how-to.html tz-link.htm
454+ WEB_PAGES= tz-art.html tz-how-to.html tz-link.html
425455DOCS= $( MANS) date.1 $( MANTXTS) $( WEB_PAGES)
426456PRIMARY_YDATA= africa antarctica asia australasia \
427457 europe northamerica southamerica
@@ -431,7 +461,7 @@ TDATA= $(YDATA) $(NDATA)
431461ZONETABLES= zone1970.tab zone.tab
432462TABDATA= iso3166.tab $( TZDATA_TEXT) $( ZONETABLES)
433463LEAP_DEPS= leapseconds.awk leap-seconds.list
434- TZDATA_ZI_DEPS= zishrink.awk $( TDATA) $( PACKRATDATA)
464+ TZDATA_ZI_DEPS= zishrink.awk version $( TDATA) $( PACKRATDATA)
435465DATA= $( YDATA) $( NDATA) backzone iso3166.tab leap-seconds.list \
436466 leapseconds yearistype.sh $( ZONETABLES)
437467AWK_SCRIPTS= checklinks.awk checktab.awk leapseconds.awk zishrink.awk
@@ -457,7 +487,7 @@ VERSION_DEPS= \
457487 newctime.3 newstrftime.3 newtzset.3 northamerica \
458488 pacificnew private.h \
459489 southamerica strftime.c systemv theory.html \
460- time2posix.3 tz-art.htm tz-how-to.html tz-link.htm \
490+ time2posix.3 tz-art.html tz-how-to.html tz-link.html \
461491 tzfile.5 tzfile.h tzselect.8 tzselect.ksh \
462492 workman.sh yearistype.sh \
463493 zdump.8 zdump.c zic.8 zic.c \
@@ -473,35 +503,41 @@ all: tzselect yearistype zic zdump libtz.a $(TABDATA)
473503ALL: all date $( ENCHILADA)
474504
475505install: all $( DATA) $( REDO) $( MANS)
476- mkdir -p $( DESTDIR) $( ETCDIR) $( DESTDIR) $( TZDIR) \
477- $( DESTDIR) $( LIBDIR) \
478- $( DESTDIR) $( MANDIR) /man3 $( DESTDIR) $( MANDIR) /man5 \
479- $( DESTDIR) $( MANDIR) /man8
480- $( ZIC_INSTALL) -l $( LOCALTIME) -p $( POSIXRULES)
481- cp -f $( TABDATA) $( DESTDIR) $( TZDIR) /.
482- cp tzselect zic zdump $( DESTDIR) $( ETCDIR) /.
483- cp libtz.a $( DESTDIR) $( LIBDIR) /.
484- $( RANLIB) $( DESTDIR) $( LIBDIR) /libtz.a
485- cp -f newctime.3 newtzset.3 $( DESTDIR) $( MANDIR) /man3/.
486- cp -f tzfile.5 $( DESTDIR) $( MANDIR) /man5/.
487- cp -f tzselect.8 zdump.8 zic.8 $( DESTDIR) $( MANDIR) /man8/.
506+ mkdir -p ' $(DESTDIR)$(BINDIR)' \
507+ ' $(DESTDIR)$(ZDUMPDIR)' ' $(DESTDIR)$(ZICDIR)' \
508+ ' $(DESTDIR)$(LIBDIR)' \
509+ ' $(DESTDIR)$(MANDIR)/man3' ' $(DESTDIR)$(MANDIR)/man5' \
510+ ' $(DESTDIR)$(MANDIR)/man8'
511+ $( ZIC_INSTALL) -l $( LOCALTIME) -p $( POSIXRULES) \
512+ -t ' $(DESTDIR)$(TZDEFAULT)'
513+ cp -f $( TABDATA) ' $(DESTDIR)$(TZDIR)/.'
514+ cp tzselect ' $(DESTDIR)$(BINDIR)/.'
515+ cp zdump ' $(DESTDIR)$(ZDUMPDIR)/.'
516+ cp zic ' $(DESTDIR)$(ZICDIR)/.'
517+ cp libtz.a ' $(DESTDIR)$(LIBDIR)/.'
518+ $( RANLIB) ' $(DESTDIR)$(LIBDIR)/libtz.a'
519+ cp -f newctime.3 newtzset.3 ' $(DESTDIR)$(MANDIR)/man3/.'
520+ cp -f tzfile.5 ' $(DESTDIR)$(MANDIR)/man5/.'
521+ cp -f tzselect.8 zdump.8 zic.8 ' $(DESTDIR)$(MANDIR)/man8/.'
488522
489523INSTALL: ALL install date.1
490- mkdir -p $( DESTDIR) $( BINDIR) $( DESTDIR) $( MANDIR) /man1
491- cp date $( DESTDIR) $( BINDIR) /.
492- cp -f date.1 $( DESTDIR) $( MANDIR) /man1/.
524+ mkdir -p ' $(DESTDIR)$(BINDIR)' ' $(DESTDIR)$(MANDIR)/man1'
525+ cp date ' $(DESTDIR)$(BINDIR)/.'
526+ cp -f date.1 ' $(DESTDIR)$(MANDIR)/man1/.'
493527
494528version: $( VERSION_DEPS)
495529 { (type git) > /dev/null 2>&1 && \
496530 V=` git describe --match ' [0-9][0-9][0-9][0-9][a-z]*' \
497531 --abbrev=7 --dirty` || \
498- V=$( VERSION) ; } && \
532+ V=' $(VERSION)' ; } && \
499533 printf ' %s\n' " $$ V" > $@ .out
500534 mv $@ .out $@
501535
502536# This file can be tailored by setting BACKWARD, PACKRATDATA, etc.
503537tzdata.zi: $( TZDATA_ZI_DEPS)
504- LC_ALL=C $( AWK) -f zishrink.awk $( TDATA) $( PACKRATDATA) > $@ .out
538+ version= ` sed 1q version` && \
539+ LC_ALL=C $( AWK) -v version=" $$ version" -f zishrink.awk \
540+ $( TDATA) $( PACKRATDATA) > $@ .out
505541 mv $@ .out $@
506542
507543version.h: version
@@ -529,12 +565,13 @@ leapseconds: $(LEAP_DEPS)
529565# Arguments to pass to submakes of install_data.
530566# They can be overridden by later submake arguments.
531567INSTALLARGS = \
532- BACKWARD=$( BACKWARD) \
533- DESTDIR=$( DESTDIR) \
568+ BACKWARD=' $(BACKWARD)' \
569+ DESTDIR=' $(DESTDIR)' \
534570 LEAPSECONDS=' $(LEAPSECONDS)' \
535571 PACKRATDATA=' $(PACKRATDATA)' \
536- TZDIR=$( TZDIR) \
537- YEARISTYPE=$( YEARISTYPE) \
572+ TZDEFAULT=' $(TZDEFAULT)' \
573+ TZDIR=' $(TZDIR)' \
574+ YEARISTYPE=' $(YEARISTYPE)' \
538575 ZIC=' $(ZIC)'
539576
540577# 'make install_data' installs one set of tz binary files.
@@ -558,16 +595,16 @@ right_only:
558595# You must replace all of $(TZDIR) to switch from not using leap seconds
559596# to using them, or vice versa.
560597right_posix: right_only
561- rm -fr $( DESTDIR) $( TZDIR) -leaps
562- ln -s $( TZDIR_BASENAME) $( DESTDIR) $( TZDIR) -leaps || \
563- $( MAKE) $( INSTALLARGS) TZDIR=$( TZDIR) -leaps right_only
564- $( MAKE) $( INSTALLARGS) TZDIR=$( TZDIR) -posix posix_only
598+ rm -fr ' $(DESTDIR)$(TZDIR)-leaps'
599+ ln -s ' $(TZDIR_BASENAME)' ' $(DESTDIR)$(TZDIR)-leaps' || \
600+ $( MAKE) $( INSTALLARGS) TZDIR=' $(TZDIR)-leaps' right_only
601+ $( MAKE) $( INSTALLARGS) TZDIR=' $(TZDIR)-posix' posix_only
565602
566603posix_right: posix_only
567- rm -fr $( DESTDIR) $( TZDIR) -posix
568- ln -s $( TZDIR_BASENAME) $( DESTDIR) $( TZDIR) -posix || \
569- $( MAKE) $( INSTALLARGS) TZDIR=$( TZDIR) -posix posix_only
570- $( MAKE) $( INSTALLARGS) TZDIR=$( TZDIR) -leaps right_only
604+ rm -fr ' $(DESTDIR)$(TZDIR)-posix'
605+ ln -s ' $(TZDIR_BASENAME)' ' $(DESTDIR)$(TZDIR)-posix' || \
606+ $( MAKE) $( INSTALLARGS) TZDIR=' $(TZDIR)-posix' posix_only
607+ $( MAKE) $( INSTALLARGS) TZDIR=' $(TZDIR)-leaps' right_only
571608
572609# This obsolescent rule is present for backwards compatibility with
573610# tz releases 2014g through 2015g. It should go away eventually.
@@ -764,7 +801,7 @@ set-timestamps.out: $(ENCHILADA)
764801
765802check_public:
766803 $(MAKE) maintainer-clean
767- $(MAKE) " CFLAGS=$(GCC_DEBUG_FLAGS)" ALL
804+ $(MAKE) CFLAGS=' $( GCC_DEBUG_FLAGS) ' ALL
768805 mkdir -p public.dir
769806 for i in $(TDATA) tzdata.zi; do \
770807 $(zic) -v -d public.dir $$i 2>&1 || exit; \
@@ -790,8 +827,11 @@ check_time_t_alternatives:
790827 REDO=' $( REDO) ' \
791828 install && \
792829 diff $$quiet_option -r \
793- time_t.dir/int64_t/etc/zoneinfo \
794- time_t.dir/$$type/etc/zoneinfo && \
830+ time_t.dir/int64_t/etc \
831+ time_t.dir/$$type/etc && \
832+ diff $$quiet_option -r \
833+ time_t.dir/int64_t/usr/share \
834+ time_t.dir/$$type/usr/share && \
795835 case $$type in \
796836 int32_t) range=-2147483648,2147483647;; \
797837 uint32_t) range=0,4294967296;; \
@@ -800,9 +840,9 @@ check_time_t_alternatives:
800840 *) range=-10000000000,10000000000;; \
801841 esac && \
802842 echo checking $$type zones ... && \
803- time_t.dir/int64_t/etc /zdump -V -t $$range $$zones \
843+ time_t.dir/int64_t/usr/bin /zdump -V -t $$range $$zones \
804844 >time_t.dir/int64_t.out && \
805- time_t.dir/$$type/etc /zdump -V -t $$range $$zones \
845+ time_t.dir/$$type/usr/bin /zdump -V -t $$range $$zones \
806846 >time_t.dir/$$type.out && \
807847 diff -u time_t.dir/int64_t.out time_t.dir/$$type.out \
808848 || exit; \
0 commit comments