Home | History | Annotate | Line # | Download | only in time
Makefile revision 1.39.2.1
      1 # This file is in the public domain, so clarified as of
      2 # 2009-05-17 by Arthur David Olson.
      3 
      4 # Package name for the code distribution.
      5 PACKAGE=	tzcode
      6 
      7 # Version number for the distribution, overridden in the 'tarballs' rule below.
      8 VERSION=	unknown
      9 
     10 # Email address for bug reports.
     11 BUGEMAIL=	tz@iana.org
     12 
     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 
     22 # Change the line below for your time zone (after finding the zone you want in
     23 # the time zone files, or adding it to a time zone file).
     24 # Alternatively, if you discover you've got the wrong time zone, you can just
     25 #	zic -l rightzone
     26 # to correct things.
     27 # Use the command
     28 #	make zonenames
     29 # to get a list of the values you can use for LOCALTIME.
     30 
     31 LOCALTIME=	GMT
     32 
     33 # If you want something other than Eastern United States time as a template
     34 # for handling POSIX-style time zone environment variables,
     35 # change the line below (after finding the zone you want in the
     36 # time zone files, or adding it to a time zone file).
     37 # When a POSIX-style environment variable is handled, the rules in the
     38 # template file are used to determine "spring forward" and "fall back" days and
     39 # times; the environment variable itself specifies UT offsets of standard and
     40 # daylight saving time.
     41 # Alternatively, if you discover you've got the wrong time zone, you can just
     42 #	zic -p rightzone
     43 # to correct things.
     44 # Use the command
     45 #	make zonenames
     46 # to get a list of the values you can use for POSIXRULES.
     47 # If you want POSIX compatibility, use "America/New_York".
     48 
     49 POSIXRULES=	America/New_York
     50 
     51 # Also see TZDEFRULESTRING below, which takes effect only
     52 # if the time zone files cannot be accessed.
     53 
     54 
     55 # Installation locations.
     56 #
     57 # The defaults are suitable for Debian, except that if REDO is
     58 # posix_right or right_posix then files that Debian puts under
     59 # /usr/share/zoneinfo/posix and /usr/share/zoneinfo/right are instead
     60 # put under /usr/share/zoneinfo-posix and /usr/share/zoneinfo-leaps,
     61 # respectively.  Problems with the Debian approach are discussed in
     62 # the commentary for the right_posix rule (below).
     63 
     64 # Destination directory, which can be used for staging.
     65 # 'make DESTDIR=/stage install' installs under /stage (e.g., to
     66 # /stage/etc/localtime instead of to /etc/localtime).  Files under
     67 # /stage are not intended to work as-is, but can be copied by hand to
     68 # the root directory later.  If DESTDIR is empty, 'make install' does
     69 # not stage, but installs directly into production locations.
     70 DESTDIR =
     71 
     72 # Everything is installed into subdirectories of TOPDIR, and used there.
     73 # TOPDIR should be empty (meaning the root directory),
     74 # or a directory name that does not end in "/".
     75 # TOPDIR should be empty or an absolute name unless you're just testing.
     76 TOPDIR =
     77 
     78 # The default local time zone is taken from the file TZDEFAULT.
     79 TZDEFAULT = $(TOPDIR)/etc/localtime
     80 
     81 # The subdirectory containing installed program and data files, and
     82 # likewise for installed files that can be shared among architectures.
     83 # These should be relative file names.
     84 USRDIR = usr
     85 USRSHAREDIR = $(USRDIR)/share
     86 
     87 # "Compiled" time zone information is placed in the "TZDIR" directory
     88 # (and subdirectories).
     89 # TZDIR_BASENAME should not contain "/" and should not be ".", ".." or empty.
     90 TZDIR_BASENAME=	zoneinfo
     91 TZDIR = $(TOPDIR)/$(USRSHAREDIR)/$(TZDIR_BASENAME)
     92 
     93 # The "tzselect" and (if you do "make INSTALL") "date" commands go in:
     94 BINDIR = $(TOPDIR)/$(USRDIR)/bin
     95 
     96 # The "zdump" command goes in:
     97 ZDUMPDIR = $(BINDIR)
     98 
     99 # The "zic" command goes in:
    100 ZICDIR = $(TOPDIR)/$(USRDIR)/sbin
    101 
    102 # Manual pages go in subdirectories of. . .
    103 MANDIR = $(TOPDIR)/$(USRSHAREDIR)/man
    104 
    105 # Library functions are put in an archive in LIBDIR.
    106 LIBDIR = $(TOPDIR)/$(USRDIR)/lib
    107 
    108 
    109 # Types to try, as an alternative to time_t.  int64_t should be first.
    110 TIME_T_ALTERNATIVES = int64_t int32_t uint32_t uint64_t
    111 
    112 # If you want only POSIX time, with time values interpreted as
    113 # seconds since the epoch (not counting leap seconds), use
    114 #	REDO=		posix_only
    115 # below.  If you want only "right" time, with values interpreted
    116 # as seconds since the epoch (counting leap seconds), use
    117 #	REDO=		right_only
    118 # below.  If you want both sets of data available, with leap seconds not
    119 # counted normally, use
    120 #	REDO=		posix_right
    121 # below.  If you want both sets of data available, with leap seconds counted
    122 # normally, use
    123 #	REDO=		right_posix
    124 # below.  POSIX mandates that leap seconds not be counted; for compatibility
    125 # with it, use "posix_only" or "posix_right".  Use POSIX time on systems with
    126 # leap smearing; this can work better than unsmeared "right" time with
    127 # applications that are not leap second aware, and is closer to unsmeared
    128 # "right" time than unsmeared POSIX time is (e.g., 0.5 vs 1.0 s max error).
    129 
    130 REDO=		posix_right
    131 
    132 # To install data in text form that has all the information of the binary data,
    133 # (optionally incorporating leap second information), use
    134 #	TZDATA_TEXT=	tzdata.zi leapseconds
    135 # To install text data without leap second information (e.g., because
    136 # REDO='posix_only'), use
    137 #	TZDATA_TEXT=	tzdata.zi
    138 # To avoid installing text data, use
    139 #	TZDATA_TEXT=
    140 
    141 TZDATA_TEXT=	leapseconds tzdata.zi
    142 
    143 # For backward-compatibility links for old zone names, use
    144 #	BACKWARD=	backward
    145 # If you also want the link US/Pacific-New, even though it is confusing
    146 # and is planned to be removed from the database eventually, use
    147 #	BACKWARD=	backward pacificnew
    148 # To omit these links, use
    149 #	BACKWARD=
    150 
    151 BACKWARD=	backward
    152 
    153 # If you want out-of-scope and often-wrong data from the file 'backzone', use
    154 #	PACKRATDATA=	backzone
    155 # To omit this data, use
    156 #	PACKRATDATA=
    157 
    158 PACKRATDATA=
    159 
    160 # The name of a locale using the UTF-8 encoding, used during self-tests.
    161 # The tests are skipped if the name does not appear to work on this system.
    162 
    163 UTF8_LOCALE=	en_US.utf8
    164 
    165 # Since "." may not be in PATH...
    166 
    167 YEARISTYPE=	./yearistype
    168 
    169 # Non-default libraries needed to link.
    170 LDLIBS=
    171 
    172 # Add the following to the end of the "CFLAGS=" line as needed to override
    173 # defaults specified in the source code.  "-DFOO" is equivalent to "-DFOO=1".
    174 #  -DBIG_BANG=-9999999LL if the Big Bang occurred at time -9999999 (see zic.c)
    175 #  -DDEPRECATE_TWO_DIGIT_YEARS for optional runtime warnings about strftime
    176 #	formats that generate only the last two digits of year numbers
    177 #  -DEPOCH_LOCAL if the 'time' function returns local time not UT
    178 #  -DEPOCH_OFFSET=N if the 'time' function returns a value N greater
    179 #	than what POSIX specifies, assuming local time is UT.
    180 #	For example, N is 252460800 on AmigaOS.
    181 #  -DHAVE_DECL_ASCTIME_R=0 if <time.h> does not declare asctime_r
    182 #  -DHAVE_DECL_ENVIRON if <unistd.h> declares 'environ'
    183 #  -DHAVE_DIRECT_H if mkdir needs <direct.h> (MS-Windows)
    184 #  -DHAVE_GENERIC=0 if _Generic does not work
    185 #  -DHAVE_GETTEXT if 'gettext' works (e.g., GNU/Linux, FreeBSD, Solaris)
    186 #  -DHAVE_INCOMPATIBLE_CTIME_R if your system's time.h declares
    187 #	ctime_r and asctime_r incompatibly with the POSIX standard
    188 #	(Solaris when _POSIX_PTHREAD_SEMANTICS is not defined).
    189 #  -DHAVE_INTTYPES_H if you have a non-C99 compiler with <inttypes.h>
    190 #  -DHAVE_LINK=0 if your system lacks a link function
    191 #  -DHAVE_LOCALTIME_R=0 if your system lacks a localtime_r function
    192 #  -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz
    193 #	localtime_rz can make zdump significantly faster, but is nonstandard.
    194 #  -DHAVE_POSIX_DECLS=0 if your system's include files do not declare
    195 #	functions like 'link' or variables like 'tzname' required by POSIX
    196 #  -DHAVE_SNPRINTF=0 if your system lacks the snprintf function
    197 #  -DHAVE_STDBOOL_H if you have a non-C99 compiler with <stdbool.h>
    198 #  -DHAVE_STDINT_H if you have a non-C99 compiler with <stdint.h>
    199 #  -DHAVE_STRFTIME_L if <time.h> declares locale_t and strftime_l
    200 #  -DHAVE_STRDUP=0 if your system lacks the strdup function
    201 #  -DHAVE_STRTOLL=0 if your system lacks the strtoll function
    202 #  -DHAVE_SYMLINK=0 if your system lacks the symlink function
    203 #  -DHAVE_SYS_STAT_H=0 if your compiler lacks a <sys/stat.h>
    204 #  -DHAVE_SYS_WAIT_H=0 if your compiler lacks a <sys/wait.h>
    205 #  -DHAVE_TZSET=0 if your system lacks a tzset function
    206 #  -DHAVE_UNISTD_H=0 if your compiler lacks a <unistd.h>
    207 #  -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'.
    210 #  -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
    213 #  -DTHREAD_SAFE to make localtime.c thread-safe, as POSIX requires;
    214 #	not needed by the main-program tz code, which is single-threaded.
    215 #	Append other compiler flags as needed, e.g., -pthread on GNU/Linux.
    216 #  -Dtime_tz=\"T\" to use T as the time_t type, rather than the system time_t
    217 #	This is intended for internal use only; it mangles external names.
    218 #  -DTZ_DOMAIN=\"foo\" to use "foo" for gettext domain name; default is "tz"
    219 #  -DTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory;
    220 #	the default is system-supplied, typically "/usr/lib/locale"
    221 #  -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified
    222 #	DST transitions if the time zone files cannot be accessed
    223 #  -DUNINIT_TRAP if reading uninitialized storage can cause problems
    224 #	other than simply getting garbage data
    225 #  -DUSE_LTZ=0 to build zdump with the system time zone library
    226 #	Also set TZDOBJS=zdump.o and CHECK_TIME_T_ALTERNATIVES= below.
    227 #  -DZIC_MAX_ABBR_LEN_WO_WARN=3
    228 #	(or some other number) to set the maximum time zone abbreviation length
    229 #	that zic will accept without a warning (the default is 6)
    230 #  $(GCC_DEBUG_FLAGS) if you are using recent GCC and want lots of checking
    231 # Select instrumentation via "make GCC_INSTRUMENT='whatever'".
    232 GCC_INSTRUMENT = \
    233   -fsanitize=undefined -fsanitize-address-use-after-scope \
    234   -fsanitize-undefined-trap-on-error -fstack-protector
    235 GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
    236   $(GCC_INSTRUMENT) \
    237   -Wall -Wextra \
    238   -Walloc-size-larger-than=100000 -Warray-bounds=2 \
    239   -Wbad-function-cast -Wcast-align=strict -Wdate-time \
    240   -Wdeclaration-after-statement -Wdouble-promotion \
    241   -Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation \
    242   -Winit-self -Wjump-misses-init -Wlogical-op \
    243   -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
    244   -Wold-style-definition -Woverlength-strings -Wpointer-arith \
    245   -Wshadow -Wshift-overflow=2 -Wstrict-prototypes -Wstringop-overflow=4 \
    246   -Wstringop-truncation -Wsuggest-attribute=cold \
    247   -Wsuggest-attribute=const -Wsuggest-attribute=format \
    248   -Wsuggest-attribute=malloc \
    249   -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure \
    250   -Wtrampolines -Wundef -Wuninitialized -Wunused \
    251   -Wvariadic-macros -Wvla -Wwrite-strings \
    252   -Wno-address -Wno-format-nonliteral -Wno-sign-compare \
    253   -Wno-type-limits -Wno-unused-parameter
    254 #
    255 # If your system has a "GMT offset" field in its "struct tm"s
    256 # (or if you decide to add such a field in your system's "time.h" file),
    257 # add the name to a define such as
    258 #	-DTM_GMTOFF=tm_gmtoff
    259 # to the end of the "CFLAGS=" line.  If not defined, the code attempts to
    260 # guess TM_GMTOFF from other macros; define NO_TM_GMTOFF to suppress this.
    261 # Similarly, if your system has a "zone abbreviation" field, define
    262 #	-DTM_ZONE=tm_zone
    263 # and define NO_TM_ZONE to suppress any guessing.  These two fields are not
    264 # required by POSIX, but are widely available on GNU/Linux and BSD systems.
    265 #
    266 # The next batch of options control support for external variables
    267 # exported by tzcode.  In practice these variables are less useful
    268 # than TM_GMTOFF and TM_ZONE.  However, most of them are standardized.
    269 # #
    270 # # To omit or support the external variable "tzname", add one of:
    271 # #	-DHAVE_TZNAME=0
    272 # #	-DHAVE_TZNAME=1
    273 # # to the "CFLAGS=" line.  "tzname" is required by POSIX 1988 and later.
    274 # # If not defined, the code attempts to guess HAVE_TZNAME from other macros.
    275 # # Warning: unless time_tz is also defined, HAVE_TZNAME=1 can cause
    276 # # crashes when combined with some platforms' standard libraries,
    277 # # presumably due to memory allocation issues.
    278 # #
    279 # # To omit or support the external variables "timezone" and "daylight", add
    280 # #	-DUSG_COMPAT=0
    281 # #	-DUSG_COMPAT=1
    282 # # to the "CFLAGS=" line; "timezone" and "daylight" are inspired by
    283 # # Unix Systems Group code and are required by POSIX 2008 (with XSI) and later.
    284 # # If not defined, the code attempts to guess USG_COMPAT from other macros.
    285 # #
    286 # # To support the external variable "altzone", add
    287 # #	-DALTZONE
    288 # # to the end of the "CFLAGS=" line; although "altzone" appeared in
    289 # # System V Release 3.1 it has not been standardized.
    290 #
    291 # If you want functions that were inspired by early versions of X3J11's work,
    292 # add
    293 #	-DSTD_INSPIRED
    294 # to the end of the "CFLAGS=" line.  This arranges for the functions
    295 # "tzsetwall", "offtime", "timelocal", "timegm", "timeoff",
    296 # "posix2time", and "time2posix" to be added to the time conversion library.
    297 # "tzsetwall" is like "tzset" except that it arranges for local wall clock
    298 # time (rather than the time specified in the TZ environment variable)
    299 # to be used.
    300 # "offtime" is like "gmtime" except that it accepts a second (long) argument
    301 # that gives an offset to add to the time_t when converting it.
    302 # "timelocal" is equivalent to "mktime".
    303 # "timegm" is like "timelocal" except that it turns a struct tm into
    304 # a time_t using UT (rather than local time as "timelocal" does).
    305 # "timeoff" is like "timegm" except that it accepts a second (long) argument
    306 # that gives an offset to use when converting to a time_t.
    307 # "posix2time" and "time2posix" are described in an included manual page.
    308 # X3J11's work does not describe any of these functions.
    309 # Sun has provided "tzsetwall", "timelocal", and "timegm" in SunOS 4.0.
    310 # These functions may well disappear in future releases of the time
    311 # conversion package.
    312 #
    313 # If you don't want functions that were inspired by NetBSD, add
    314 #	-DNETBSD_INSPIRED=0
    315 # to the end of the "CFLAGS=" line.  Otherwise, the functions
    316 # "localtime_rz", "mktime_z", "tzalloc", and "tzfree" are added to the
    317 # time library, and if STD_INSPIRED is also defined the functions
    318 # "posix2time_z" and "time2posix_z" are added as well.
    319 # The functions ending in "_z" (or "_rz") are like their unsuffixed
    320 # (or suffixed-by-"_r") counterparts, except with an extra first
    321 # argument of opaque type timezone_t that specifies the time zone.
    322 # "tzalloc" allocates a timezone_t value, and "tzfree" frees it.
    323 #
    324 # If you want to allocate state structures in localtime, add
    325 #	-DALL_STATE
    326 # to the end of the "CFLAGS=" line.  Storage is obtained by calling malloc.
    327 #
    328 # NIST-PCTS:151-2, Version 1.4, (1993-12-03) is a test suite put
    329 # out by the National Institute of Standards and Technology
    330 # which claims to test C and Posix conformance.  If you want to pass PCTS, add
    331 #	-DPCTS
    332 # to the end of the "CFLAGS=" line.
    333 #
    334 # If you want strict compliance with XPG4 as of 1994-04-09, add
    335 #	-DXPG4_1994_04_09
    336 # to the end of the "CFLAGS=" line.  This causes "strftime" to always return
    337 # 53 as a week number (rather than 52 or 53) for January days before
    338 # January's first Monday when a "%V" format is used and January 1
    339 # falls on a Friday, Saturday, or Sunday.
    340 
    341 CFLAGS=
    342 
    343 # Linker flags.  Default to $(LFLAGS) for backwards compatibility
    344 # to release 2012h and earlier.
    345 
    346 LDFLAGS=	$(LFLAGS)
    347 
    348 # For leap seconds, this Makefile uses LEAPSECONDS='-L leapseconds' in
    349 # submake command lines.  The default is no leap seconds.
    350 
    351 LEAPSECONDS=
    352 
    353 # The zic command and its arguments.
    354 
    355 zic=		./zic
    356 ZIC=		$(zic) $(ZFLAGS)
    357 
    358 ZFLAGS=
    359 
    360 # How to use zic to install tz binary files.
    361 
    362 ZIC_INSTALL=	$(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS)
    363 
    364 # The name of a Posix-compliant 'awk' on your system.
    365 AWK=		awk
    366 
    367 # The full path name of a Posix-compliant shell, preferably one that supports
    368 # the Korn shell's 'select' statement as an extension.
    369 # These days, Bash is the most popular.
    370 # It should be OK to set this to /bin/sh, on platforms where /bin/sh
    371 # lacks 'select' or doesn't completely conform to Posix, but /bin/bash
    372 # is typically nicer if it works.
    373 KSHELL=		/bin/bash
    374 
    375 # The path where SGML DTDs are kept and the catalog file(s) to use when
    376 # validating.  The default should work on both Debian and Red Hat.
    377 SGML_TOPDIR= /usr
    378 SGML_DTDDIR= $(SGML_TOPDIR)/share/xml/w3c-sgml-lib/schema/dtd
    379 SGML_SEARCH_PATH= $(SGML_DTDDIR)/REC-html401-19991224
    380 SGML_CATALOG_FILES= \
    381   $(SGML_TOPDIR)/share/doc/w3-recs/html/www.w3.org/TR/1999/REC-html401-19991224/HTML4.cat:$(SGML_TOPDIR)/share/sgml/html/4.01/HTML4.cat
    382 
    383 # The name, arguments and environment of a program to validate your web pages.
    384 # See <http://openjade.sourceforge.net/doc/> for a validator, and
    385 # <https://validator.w3.org/source/> for a validation library.
    386 # Set VALIDATE=':' if you do not have such a program.
    387 VALIDATE = nsgmls
    388 VALIDATE_FLAGS = -s -B -wall -wno-unused-param
    389 VALIDATE_ENV = \
    390   SGML_CATALOG_FILES='$(SGML_CATALOG_FILES)' \
    391   SGML_SEARCH_PATH='$(SGML_SEARCH_PATH)' \
    392   SP_CHARSET_FIXED=YES \
    393   SP_ENCODING=UTF-8
    394 
    395 # This expensive test requires USE_LTZ.
    396 # To suppress it, define this macro to be empty.
    397 CHECK_TIME_T_ALTERNATIVES = check_time_t_alternatives
    398 
    399 # SAFE_CHAR is a regular expression that matches a safe character.
    400 # Some parts of this distribution are limited to safe characters;
    401 # others can use any UTF-8 character.
    402 # For now, the safe characters are a safe subset of ASCII.
    403 # The caller must set the shell variable 'sharp' to the character '#',
    404 # since Makefile macros cannot contain '#'.
    405 # TAB_CHAR is a single tab character, in single quotes.
    406 TAB_CHAR=	'	'
    407 SAFE_CHARSET1=	$(TAB_CHAR)' !\"'$$sharp'$$%&'\''()*+,./0123456789:;<=>?@'
    408 SAFE_CHARSET2=	'ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\^_`'
    409 SAFE_CHARSET3=	'abcdefghijklmnopqrstuvwxyz{|}~'
    410 SAFE_CHARSET=	$(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3)
    411 SAFE_CHAR=	'[]'$(SAFE_CHARSET)'-]'
    412 
    413 # Non-ASCII non-letters that OK_CHAR allows, as these characters are
    414 # useful in commentary.  XEmacs 21.5.34 displays them correctly,
    415 # presumably because they are Latin-1.
    416 UNUSUAL_OK_CHARSET= 
    417 
    418 # OK_CHAR matches any character allowed in the distributed files.
    419 # This is the same as SAFE_CHAR, except that UNUSUAL_OK_CHARSET and
    420 # multibyte letters are also allowed so that commentary can contain a
    421 # few safe symbols and people's names and can quote non-English sources.
    422 # Other non-letters are limited to ASCII renderings for the
    423 # convenience of maintainers using XEmacs 21.5.34, which by default
    424 # mishandles Unicode characters U+0100 and greater.
    425 OK_CHAR=	'[][:alpha:]$(UNUSUAL_OK_CHARSET)'$(SAFE_CHARSET)'-]'
    426 
    427 # SAFE_LINE matches a line of safe characters.
    428 # SAFE_SHARP_LINE is similar, except any OK character can follow '#';
    429 # this is so that comments can contain non-ASCII characters.
    430 # OK_LINE matches a line of OK characters.
    431 SAFE_LINE=	'^'$(SAFE_CHAR)'*$$'
    432 SAFE_SHARP_LINE='^'$(SAFE_CHAR)'*('$$sharp$(OK_CHAR)'*)?$$'
    433 OK_LINE=	'^'$(OK_CHAR)'*$$'
    434 
    435 # Flags to give 'tar' when making a distribution.
    436 # Try to use flags appropriate for GNU tar.
    437 GNUTARFLAGS= --numeric-owner --owner=0 --group=0 --mode=go+u,go-w --sort=name
    438 TARFLAGS=	`if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \
    439 		 then echo $(GNUTARFLAGS); \
    440 		 else :; \
    441 		 fi`
    442 
    443 # Flags to give 'gzip' when making a distribution.
    444 GZIPFLAGS=	-9n
    445 
    446 ###############################################################################
    447 
    448 #MAKE=		make
    449 
    450 cc=		cc
    451 CC=		$(cc) -DTZDIR='"$(TZDIR)"'
    452 
    453 AR=		ar
    454 
    455 # ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib.
    456 RANLIB=		:
    457 
    458 TZCOBJS=	zic.o
    459 TZDOBJS=	zdump.o localtime.o asctime.o strftime.o
    460 DATEOBJS=	date.o localtime.o strftime.o asctime.o
    461 LIBSRCS=	localtime.c asctime.c difftime.c
    462 LIBOBJS=	localtime.o asctime.o difftime.o
    463 HEADERS=	tzfile.h private.h
    464 NONLIBSRCS=	zic.c zdump.c
    465 NEWUCBSRCS=	date.c strftime.c
    466 SOURCES=	$(HEADERS) $(LIBSRCS) $(NONLIBSRCS) $(NEWUCBSRCS) \
    467 			tzselect.ksh workman.sh
    468 MANS=		newctime.3 newstrftime.3 newtzset.3 time2posix.3 \
    469 			tzfile.5 tzselect.8 zic.8 zdump.8
    470 MANTXTS=	newctime.3.txt newstrftime.3.txt newtzset.3.txt \
    471 			time2posix.3.txt \
    472 			tzfile.5.txt tzselect.8.txt zic.8.txt zdump.8.txt \
    473 			date.1.txt
    474 COMMON=		calendars CONTRIBUTING LICENSE Makefile \
    475 			NEWS README theory.html version
    476 WEB_PAGES=	tz-art.html tz-how-to.html tz-link.html
    477 DOCS=		$(MANS) date.1 $(MANTXTS) $(WEB_PAGES)
    478 PRIMARY_YDATA=	africa antarctica asia australasia \
    479 		europe northamerica southamerica
    480 YDATA=		$(PRIMARY_YDATA) etcetera
    481 NDATA=		systemv factory
    482 TDATA_TO_CHECK=	$(YDATA) $(NDATA) backward pacificnew
    483 TDATA=		$(YDATA) $(NDATA) $(BACKWARD)
    484 ZONETABLES=	zone1970.tab zone.tab
    485 TABDATA=	iso3166.tab $(TZDATA_TEXT) $(ZONETABLES)
    486 LEAP_DEPS=	leapseconds.awk leap-seconds.list
    487 TZDATA_ZI_DEPS=	ziguard.awk zishrink.awk version $(TDATA) $(PACKRATDATA)
    488 DSTDATA_ZI_DEPS= ziguard.awk $(TDATA) $(PACKRATDATA)
    489 DATA=		$(TDATA_TO_CHECK) backzone iso3166.tab leap-seconds.list \
    490 			leapseconds yearistype.sh $(ZONETABLES)
    491 AWK_SCRIPTS=	checklinks.awk checktab.awk leapseconds.awk \
    492 			ziguard.awk zishrink.awk
    493 MISC=		$(AWK_SCRIPTS) zoneinfo2tdf.pl
    494 TZS_YEAR=	2050
    495 TZS=		to$(TZS_YEAR).tzs
    496 TZS_NEW=	to$(TZS_YEAR)new.tzs
    497 TZS_DEPS=	$(PRIMARY_YDATA) asctime.c localtime.c \
    498 			private.h tzfile.h zdump.c zic.c
    499 ENCHILADA=	$(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC) $(TZS) tzdata.zi
    500 
    501 # Consult these files when deciding whether to rebuild the 'version' file.
    502 # This list is not the same as the output of 'git ls-files', since
    503 # .gitignore is not distributed.
    504 VERSION_DEPS= \
    505 		calendars CONTRIBUTING LICENSE Makefile NEWS README \
    506 		africa antarctica asctime.c asia australasia \
    507 		backward backzone \
    508 		checklinks.awk checktab.awk \
    509 		date.1 date.c difftime.c \
    510 		etcetera europe factory iso3166.tab \
    511 		leap-seconds.list leapseconds.awk localtime.c \
    512 		newctime.3 newstrftime.3 newtzset.3 northamerica \
    513 		pacificnew private.h \
    514 		southamerica strftime.c systemv theory.html \
    515 		time2posix.3 tz-art.html tz-how-to.html tz-link.html \
    516 		tzfile.5 tzfile.h tzselect.8 tzselect.ksh \
    517 		workman.sh yearistype.sh \
    518 		zdump.8 zdump.c zic.8 zic.c \
    519 		ziguard.awk zishrink.awk \
    520 		zone.tab zone1970.tab zoneinfo2tdf.pl
    521 
    522 # And for the benefit of csh users on systems that assume the user
    523 # shell should be used to handle commands in Makefiles. . .
    524 
    525 SHELL=		/bin/sh
    526 
    527 all:		tzselect yearistype zic zdump libtz.a $(TABDATA) \
    528 		  vanguard.zi main.zi rearguard.zi
    529 
    530 ALL:		all date $(ENCHILADA)
    531 
    532 install:	all $(DATA) $(REDO) $(MANS)
    533 		mkdir -p '$(DESTDIR)$(BINDIR)' \
    534 			'$(DESTDIR)$(ZDUMPDIR)' '$(DESTDIR)$(ZICDIR)' \
    535 			'$(DESTDIR)$(LIBDIR)' \
    536 			'$(DESTDIR)$(MANDIR)/man3' '$(DESTDIR)$(MANDIR)/man5' \
    537 			'$(DESTDIR)$(MANDIR)/man8'
    538 		$(ZIC_INSTALL) -l $(LOCALTIME) -p $(POSIXRULES) \
    539 			-t '$(DESTDIR)$(TZDEFAULT)'
    540 		cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.'
    541 		cp tzselect '$(DESTDIR)$(BINDIR)/.'
    542 		cp zdump '$(DESTDIR)$(ZDUMPDIR)/.'
    543 		cp zic '$(DESTDIR)$(ZICDIR)/.'
    544 		cp libtz.a '$(DESTDIR)$(LIBDIR)/.'
    545 		$(RANLIB) '$(DESTDIR)$(LIBDIR)/libtz.a'
    546 		cp -f newctime.3 newtzset.3 '$(DESTDIR)$(MANDIR)/man3/.'
    547 		cp -f tzfile.5 '$(DESTDIR)$(MANDIR)/man5/.'
    548 		cp -f tzselect.8 zdump.8 zic.8 '$(DESTDIR)$(MANDIR)/man8/.'
    549 
    550 INSTALL:	ALL install date.1
    551 		mkdir -p '$(DESTDIR)$(BINDIR)' '$(DESTDIR)$(MANDIR)/man1'
    552 		cp date '$(DESTDIR)$(BINDIR)/.'
    553 		cp -f date.1 '$(DESTDIR)$(MANDIR)/man1/.'
    554 
    555 version:	$(VERSION_DEPS)
    556 		{ (type git) >/dev/null 2>&1 && \
    557 		  V=`git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \
    558 				--abbrev=7 --dirty` || \
    559 		  V='$(VERSION)'; } && \
    560 		printf '%s\n' "$$V" >$@.out
    561 		mv $@.out $@
    562 
    563 # These files can be tailored by setting BACKWARD, PACKRATDATA, etc.
    564 vanguard.zi main.zi rearguard.zi: $(DSTDATA_ZI_DEPS)
    565 		$(AWK) -v DATAFORM=`expr $@ : '\(.*\).zi'` -f ziguard.awk \
    566 		  $(TDATA) $(PACKRATDATA) >$@.out
    567 		mv $@.out $@
    568 tzdata.zi:	$(DATAFORM).zi version
    569 		version=`sed 1q version` && \
    570 		  LC_ALL=C $(AWK) -v version="$$version" -f zishrink.awk \
    571 		    $(DATAFORM).zi >$@.out
    572 		mv $@.out $@
    573 
    574 version.h:	version
    575 		VERSION=`cat version` && printf '%s\n' \
    576 		  'static char const PKGVERSION[]="($(PACKAGE)) ";' \
    577 		  "static char const TZVERSION[]=\"$$VERSION\";" \
    578 		  'static char const REPORT_BUGS_TO[]="$(BUGEMAIL)";' \
    579 		  >$@.out
    580 		mv $@.out $@
    581 
    582 zdump:		$(TZDOBJS)
    583 		$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS)
    584 
    585 zic:		$(TZCOBJS)
    586 		$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS)
    587 
    588 yearistype:	yearistype.sh
    589 		cp yearistype.sh yearistype
    590 		chmod +x yearistype
    591 
    592 leapseconds:	$(LEAP_DEPS)
    593 		$(AWK) -f leapseconds.awk leap-seconds.list >$@.out
    594 		mv $@.out $@
    595 
    596 # Arguments to pass to submakes of install_data.
    597 # They can be overridden by later submake arguments.
    598 INSTALLARGS = \
    599  BACKWARD='$(BACKWARD)' \
    600  DESTDIR='$(DESTDIR)' \
    601  LEAPSECONDS='$(LEAPSECONDS)' \
    602  PACKRATDATA='$(PACKRATDATA)' \
    603  TZDEFAULT='$(TZDEFAULT)' \
    604  TZDIR='$(TZDIR)' \
    605  YEARISTYPE='$(YEARISTYPE)' \
    606  ZIC='$(ZIC)'
    607 
    608 # 'make install_data' installs one set of tz binary files.
    609 install_data:	zic leapseconds yearistype tzdata.zi
    610 		$(ZIC_INSTALL) tzdata.zi
    611 
    612 posix_only:
    613 		$(MAKE) $(INSTALLARGS) LEAPSECONDS= install_data
    614 
    615 right_only:
    616 		$(MAKE) $(INSTALLARGS) LEAPSECONDS='-L leapseconds' \
    617 			install_data
    618 
    619 # In earlier versions of this makefile, the other two directories were
    620 # subdirectories of $(TZDIR).  However, this led to configuration errors.
    621 # For example, with posix_right under the earlier scheme,
    622 # TZ='right/Australia/Adelaide' got you localtime with leap seconds,
    623 # but gmtime without leap seconds, which led to problems with applications
    624 # like sendmail that subtract gmtime from localtime.
    625 # Therefore, the other two directories are now siblings of $(TZDIR).
    626 # You must replace all of $(TZDIR) to switch from not using leap seconds
    627 # to using them, or vice versa.
    628 right_posix:	right_only
    629 		rm -fr '$(DESTDIR)$(TZDIR)-leaps'
    630 		ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-leaps' || \
    631 		  $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only
    632 		$(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only
    633 
    634 posix_right:	posix_only
    635 		rm -fr '$(DESTDIR)$(TZDIR)-posix'
    636 		ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-posix' || \
    637 		  $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only
    638 		$(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only
    639 
    640 # This obsolescent rule is present for backwards compatibility with
    641 # tz releases 2014g through 2015g.  It should go away eventually.
    642 posix_packrat:
    643 		$(MAKE) $(INSTALLARGS) PACKRATDATA=backzone posix_only
    644 
    645 zones:		$(REDO)
    646 
    647 # dummy.zd is not a real file; it is mentioned here only so that the
    648 # top-level 'make' does not have a syntax error.
    649 ZDS = dummy.zd
    650 # Rule used only by submakes invoked by the $(TZS_NEW) rule.
    651 # It is separate so that GNU 'make -j' can run instances in parallel.
    652 $(ZDS): zdump
    653 		./zdump -i -c $(TZS_YEAR) '$(wd)/'$$(expr $@ : '\(.*\).zd') >$@
    654 
    655 $(TZS_NEW):	tzdata.zi zdump zic
    656 		rm -fr tzs.dir
    657 		mkdir tzs.dir
    658 		$(zic) -d tzs.dir tzdata.zi
    659 		$(AWK) '/^L/{print "Link\t" $$2 "\t" $$3}' \
    660 		   tzdata.zi | LC_ALL=C sort >$@.out
    661 		wd=`pwd` && \
    662 		set x `$(AWK) '/^Z/{print "tzs.dir/" $$2 ".zd"}' tzdata.zi \
    663 			| LC_ALL=C sort -t . -k 2,2` && \
    664 		shift && \
    665 		ZDS=$$* && \
    666 		$(MAKE) wd="$$wd" TZS_YEAR=$(TZS_YEAR) ZDS="$$ZDS" $$ZDS && \
    667 		sed 's,^TZ=".*tzs\.dir/,TZ=",' $$ZDS >>$@.out
    668 		rm -fr tzs.dir
    669 		mv $@.out $@
    670 
    671 # If $(TZS) does not already exist (e.g., old-format tarballs), create it.
    672 # If it exists but 'make check_tzs' fails, a maintainer should inspect the
    673 # failed output and fix the inconsistency, perhaps by running 'make force_tzs'.
    674 $(TZS):
    675 		$(MAKE) force_tzs
    676 
    677 force_tzs:	$(TZS_NEW)
    678 		cp $(TZS_NEW) $(TZS)
    679 
    680 libtz.a:	$(LIBOBJS)
    681 		rm -f $@
    682 		$(AR) -rc $@ $(LIBOBJS)
    683 		$(RANLIB) $@
    684 
    685 date:		$(DATEOBJS)
    686 		$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS)
    687 
    688 tzselect:	tzselect.ksh version
    689 		VERSION=`cat version` && sed \
    690 			-e 's|#!/bin/bash|#!$(KSHELL)|g' \
    691 			-e 's|AWK=[^}]*|AWK=$(AWK)|g' \
    692 			-e 's|\(PKGVERSION\)=.*|\1='\''($(PACKAGE)) '\''|' \
    693 			-e 's|\(REPORT_BUGS_TO\)=.*|\1=$(BUGEMAIL)|' \
    694 			-e 's|TZDIR=[^}]*|TZDIR=$(TZDIR)|' \
    695 			-e 's|\(TZVERSION\)=.*|\1='"$$VERSION"'|' \
    696 			<$@.ksh >$@.out
    697 		chmod +x $@.out
    698 		mv $@.out $@
    699 
    700 check:		check_character_set check_white_space check_links \
    701 		  check_name_lengths check_sorted \
    702 		  check_tables check_web check_zishrink check_tzs
    703 
    704 check_character_set: $(ENCHILADA)
    705 	test ! '$(UTF8_LOCALE)' || \
    706 	! printf 'A\304\200B\n' | \
    707 	  LC_ALL='$(UTF8_LOCALE)' grep -q '^A.B$$' >/dev/null 2>&1 || { \
    708 		LC_ALL='$(UTF8_LOCALE)' && export LC_ALL && \
    709 		sharp='#' && \
    710 		! grep -Env $(SAFE_LINE) $(MANS) date.1 $(MANTXTS) \
    711 			$(MISC) $(SOURCES) $(WEB_PAGES) \
    712 			CONTRIBUTING LICENSE README \
    713 			version tzdata.zi && \
    714 		! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_CHARSET='$(OK_CHAR)'*$$' \
    715 			Makefile && \
    716 		! grep -Env $(SAFE_SHARP_LINE) $(TDATA_TO_CHECK) backzone \
    717 			leapseconds yearistype.sh zone.tab && \
    718 		! grep -Env $(OK_LINE) $(ENCHILADA); \
    719 	}
    720 
    721 check_white_space: $(ENCHILADA)
    722 		patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \
    723 		! grep -En "$$pat" $(ENCHILADA)
    724 		! grep -n '[[:space:]]$$' \
    725 			$$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list)
    726 
    727 PRECEDES_FILE_NAME = ^(Zone|Link[[:space:]]+[^[:space:]]+)[[:space:]]+
    728 FILE_NAME_COMPONENT_TOO_LONG = \
    729   $(PRECEDES_FILE_NAME)[^[:space:]]*[^/[:space:]]{15}
    730 
    731 check_name_lengths: $(TDATA_TO_CHECK) backzone
    732 		! grep -En '$(FILE_NAME_COMPONENT_TOO_LONG)' \
    733 			$(TDATA_TO_CHECK) backzone
    734 
    735 CHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; }
    736 
    737 check_sorted: backward backzone iso3166.tab zone.tab zone1970.tab
    738 		$(AWK) '/^Link/ {print $$3}' backward | LC_ALL=C sort -cu
    739 		$(AWK) '/^Zone/ {print $$2}' backzone | LC_ALL=C sort -cu
    740 		$(AWK) '/^[^#]/ {print $$1}' iso3166.tab | LC_ALL=C sort -cu
    741 		$(AWK) '/^[^#]/ {print $$1}' zone.tab | LC_ALL=C sort -c
    742 		$(AWK) '/^[^#]/ {print substr($$0, 1, 2)}' zone1970.tab | \
    743 		  LC_ALL=C sort -c
    744 		$(AWK) '/^[^#]/ $(CHECK_CC_LIST)' zone1970.tab | \
    745 		  LC_ALL=C sort -cu
    746 
    747 check_links:	checklinks.awk $(TDATA_TO_CHECK) tzdata.zi
    748 		$(AWK) -f checklinks.awk $(TDATA_TO_CHECK)
    749 		$(AWK) -f checklinks.awk tzdata.zi
    750 
    751 check_tables:	checktab.awk $(PRIMARY_YDATA) $(ZONETABLES)
    752 		for tab in $(ZONETABLES); do \
    753 		  $(AWK) -f checktab.awk -v zone_table=$$tab $(PRIMARY_YDATA) \
    754 		    || exit; \
    755 		done
    756 
    757 check_tzs:	$(TZS) $(TZS_NEW)
    758 		diff -u $(TZS) $(TZS_NEW)
    759 
    760 # This checks only the HTML 4.01 strict page.
    761 # To check the the other pages, use <https://validator.w3.org/>.
    762 check_web:	tz-how-to.html
    763 		$(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) tz-how-to.html
    764 
    765 # Check that zishrink.awk does not alter the data, and that ziguard.awk
    766 # preserves main-format data.
    767 check_zishrink: zic leapseconds $(PACKRATDATA) $(TDATA) \
    768 		  $(DATAFORM).zi tzdata.zi
    769 		for type in posix right; do \
    770 		  mkdir -p time_t.dir/$$type time_t.dir/$$type-t \
    771 		    time_t.dir/$$type-shrunk && \
    772 		  case $$type in \
    773 		    right) leap='-L leapseconds';; \
    774 	            *) leap=;; \
    775 		  esac && \
    776 		  $(ZIC) $$leap -d time_t.dir/$$type $(DATAFORM).zi && \
    777 		  case $(DATAFORM) in \
    778 		    main) \
    779 		      $(ZIC) $$leap -d time_t.dir/$$type-t $(TDATA) && \
    780 		      $(AWK) '/^Rule/' $(TDATA) | \
    781 			$(ZIC) $$leap -d time_t.dir/$$type-t - \
    782 			  $(PACKRATDATA) && \
    783 		      diff -r time_t.dir/$$type time_t.dir/$$type-t;; \
    784 		  esac && \
    785 		  $(ZIC) $$leap -d time_t.dir/$$type-shrunk tzdata.zi && \
    786 		  diff -r time_t.dir/$$type time_t.dir/$$type-shrunk || exit; \
    787 		done
    788 		rm -fr time_t.dir
    789 
    790 clean_misc:
    791 		rm -f core *.o *.out \
    792 		  date tzselect version.h zdump zic yearistype libtz.a
    793 clean:		clean_misc
    794 		rm -fr *.dir *.zi tzdb-*/ $(TZS_NEW)
    795 
    796 maintainer-clean: clean
    797 		@echo 'This command is intended for maintainers to use; it'
    798 		@echo 'deletes files that may need special tools to rebuild.'
    799 		rm -f leapseconds version $(MANTXTS) $(TZS) *.asc *.tar.*
    800 
    801 names:
    802 		@echo $(ENCHILADA)
    803 
    804 public:		check check_public $(CHECK_TIME_T_ALTERNATIVES) \
    805 		tarballs signatures
    806 
    807 date.1.txt:	date.1
    808 newctime.3.txt:	newctime.3
    809 newstrftime.3.txt: newstrftime.3
    810 newtzset.3.txt:	newtzset.3
    811 time2posix.3.txt: time2posix.3
    812 tzfile.5.txt:	tzfile.5
    813 tzselect.8.txt:	tzselect.8
    814 zdump.8.txt:	zdump.8
    815 zic.8.txt:	zic.8
    816 
    817 $(MANTXTS):	workman.sh
    818 		LC_ALL=C sh workman.sh `expr $@ : '\(.*\)\.txt$$'` >$@.out
    819 		mv $@.out $@
    820 
    821 # Set the time stamps to those of the git repository, if available,
    822 # and if the files have not changed since then.
    823 # This uses GNU 'touch' syntax 'touch -d@N FILE',
    824 # where N is the number of seconds since 1970.
    825 # If git or GNU 'touch' is absent, don't bother to sync with git timestamps.
    826 # Also, set the timestamp of each prebuilt file like 'leapseconds'
    827 # to be the maximum of the files it depends on.
    828 set-timestamps.out: $(ENCHILADA)
    829 		rm -f $@
    830 		if (type git) >/dev/null 2>&1 && \
    831 		   files=`git ls-files $(ENCHILADA)` && \
    832 		   touch -md @1 test.out; then \
    833 		  rm -f test.out && \
    834 		  for file in $$files; do \
    835 		    if git diff --quiet $$file; then \
    836 		      time=`git log -1 --format='tformat:%ct' $$file` && \
    837 		      touch -cmd @$$time $$file; \
    838 		    else \
    839 		      echo >&2 "$$file: warning: does not match repository"; \
    840 		    fi || exit; \
    841 		  done; \
    842 		fi
    843 		touch -cmr `ls -t $(LEAP_DEPS) | sed 1q` leapseconds
    844 		for file in `ls $(MANTXTS) | sed 's/\.txt$$//'`; do \
    845 		  touch -cmr `ls -t $$file workman.sh | sed 1q` $$file.txt || \
    846 		    exit; \
    847 		done
    848 		touch -cmr `ls -t $(TZDATA_ZI_DEPS) | sed 1q` tzdata.zi
    849 		touch -cmr `ls -t $(TZS_DEPS) | sed 1q` $(TZS)
    850 		touch -cmr `ls -t $(VERSION_DEPS) | sed 1q` version
    851 		touch $@
    852 
    853 # The zics below ensure that each data file can stand on its own.
    854 # We also do an all-files run to catch links to links.
    855 
    856 check_public:
    857 		$(MAKE) maintainer-clean
    858 		$(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' ALL
    859 		mkdir -p public.dir
    860 		for i in $(TDATA_TO_CHECK) tzdata.zi; do \
    861 		  $(zic) -v -d public.dir $$i 2>&1 || exit; \
    862 		done
    863 		$(zic) -v -d public.dir $(TDATA_TO_CHECK)
    864 		rm -fr public.dir
    865 
    866 # Check that the code works under various alternative
    867 # implementations of time_t.
    868 check_time_t_alternatives:
    869 		if diff -q Makefile Makefile 2>/dev/null; then \
    870 		  quiet_option='-q'; \
    871 		else \
    872 		  quiet_option=''; \
    873 		fi && \
    874 		wd=`pwd` && \
    875 		zones=`$(AWK) '/^[^#]/ { print $$3 }' <zone1970.tab` && \
    876 		for type in $(TIME_T_ALTERNATIVES); do \
    877 		  mkdir -p time_t.dir/$$type && \
    878 		  $(MAKE) clean_misc && \
    879 		  $(MAKE) TOPDIR="$$wd/time_t.dir/$$type" \
    880 		    CFLAGS='$(CFLAGS) -Dtime_tz='"'$$type'" \
    881 		    REDO='$(REDO)' \
    882 		    install && \
    883 		  diff $$quiet_option -r \
    884 		    time_t.dir/int64_t/etc \
    885 		    time_t.dir/$$type/etc && \
    886 		  diff $$quiet_option -r \
    887 		    time_t.dir/int64_t/usr/share \
    888 		    time_t.dir/$$type/usr/share && \
    889 		  case $$type in \
    890 		  int32_t) range=-2147483648,2147483647;; \
    891 		  uint32_t) range=0,4294967296;; \
    892 		  int64_t) continue;; \
    893 		  *u*) range=0,10000000000;; \
    894 		  *) range=-10000000000,10000000000;; \
    895 		  esac && \
    896 		  echo checking $$type zones ... && \
    897 		  time_t.dir/int64_t/usr/bin/zdump -V -t $$range $$zones \
    898 		      >time_t.dir/int64_t.out && \
    899 		  time_t.dir/$$type/usr/bin/zdump -V -t $$range $$zones \
    900 		      >time_t.dir/$$type.out && \
    901 		  diff -u time_t.dir/int64_t.out time_t.dir/$$type.out \
    902 		    || exit; \
    903 		done
    904 		rm -fr time_t.dir
    905 
    906 TRADITIONAL_ASC = \
    907   tzcode$(VERSION).tar.gz.asc \
    908   tzdata$(VERSION).tar.gz.asc
    909 ALL_ASC = $(TRADITIONAL_ASC) \
    910   tzdata$(VERSION)-rearguard.tar.gz.asc \
    911   tzdb-$(VERSION).tar.lz.asc
    912 
    913 tarballs traditional_tarballs signatures traditional_signatures: version
    914 		VERSION=`cat version` && \
    915 		$(MAKE) VERSION="$$VERSION" $@_version
    916 
    917 # These *_version rules are intended for use if VERSION is set by some
    918 # other means.  Ordinarily these rules are used only by the above
    919 # non-_version rules, which set VERSION on the 'make' command line.
    920 tarballs_version: traditional_tarballs_version \
    921   tzdata$(VERSION)-rearguard.tar.gz \
    922   tzdb-$(VERSION).tar.lz
    923 traditional_tarballs_version: \
    924   tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz
    925 signatures_version: $(ALL_ASC)
    926 traditional_signatures_version: $(TRADITIONAL_ASC)
    927 
    928 tzcode$(VERSION).tar.gz: set-timestamps.out
    929 		LC_ALL=C && export LC_ALL && \
    930 		tar $(TARFLAGS) -cf - \
    931 		    $(COMMON) $(DOCS) $(SOURCES) | \
    932 		  gzip $(GZIPFLAGS) >$@.out
    933 		mv $@.out $@
    934 
    935 tzdata$(VERSION).tar.gz: set-timestamps.out
    936 		LC_ALL=C && export LC_ALL && \
    937 		tar $(TARFLAGS) -cf - $(COMMON) $(DATA) $(MISC) | \
    938 		  gzip $(GZIPFLAGS) >$@.out
    939 		mv $@.out $@
    940 
    941 tzdata$(VERSION)-rearguard.tar.gz: rearguard.zi set-timestamps.out
    942 		rm -fr tzdata$(VERSION)-rearguard.dir
    943 		mkdir tzdata$(VERSION)-rearguard.dir
    944 		ln $(COMMON) $(DATA) $(MISC) tzdata$(VERSION)-rearguard.dir
    945 		cd tzdata$(VERSION)-rearguard.dir && \
    946 		  rm -f $(TDATA) $(PACKRATDATA) version
    947 		for f in $(TDATA) $(PACKRATDATA); do \
    948 		  rearf=tzdata$(VERSION)-rearguard.dir/$$f; \
    949 		  $(AWK) -v DATAFORM=rearguard -f ziguard.awk $$f >$$rearf && \
    950 		  touch -cmr `ls -t ziguard.awk $$f` $$rearf || exit; \
    951 		done
    952 		sed '1s/$$/-rearguard/' \
    953 		  <version >tzdata$(VERSION)-rearguard.dir/version
    954 		touch -cmr version tzdata$(VERSION)-rearguard.dir/version
    955 		LC_ALL=C && export LC_ALL && \
    956 		  (cd tzdata$(VERSION)-rearguard.dir && \
    957 		   tar $(TARFLAGS) -cf - $(COMMON) $(DATA) $(MISC) | \
    958 		     gzip $(GZIPFLAGS)) >$@.out
    959 		mv $@.out $@
    960 
    961 tzdb-$(VERSION).tar.lz: set-timestamps.out
    962 		rm -fr tzdb-$(VERSION)
    963 		mkdir tzdb-$(VERSION)
    964 		ln $(ENCHILADA) tzdb-$(VERSION)
    965 		touch -cmr `ls -t tzdb-$(VERSION)/* | sed 1q` tzdb-$(VERSION)
    966 		LC_ALL=C && export LC_ALL && \
    967 		tar $(TARFLAGS) -cf - tzdb-$(VERSION) | lzip -9 >$@.out
    968 		mv $@.out $@
    969 
    970 tzcode$(VERSION).tar.gz.asc: tzcode$(VERSION).tar.gz
    971 tzdata$(VERSION).tar.gz.asc: tzdata$(VERSION).tar.gz
    972 tzdata$(VERSION)-rearguard.tar.gz.asc: tzdata$(VERSION)-rearguard.tar.gz
    973 tzdb-$(VERSION).tar.lz.asc: tzdb-$(VERSION).tar.lz
    974 $(ALL_ASC):
    975 		gpg --armor --detach-sign $?
    976 
    977 typecheck:
    978 		$(MAKE) clean
    979 		for i in "long long" unsigned; \
    980 		do \
    981 			$(MAKE) CFLAGS="-DTYPECHECK -D__time_t_defined -D_TIME_T \"-Dtime_t=$$i\"" ; \
    982 			./zdump -v Europe/Rome ; \
    983 			$(MAKE) clean ; \
    984 		done
    985 
    986 zonenames:	tzdata.zi
    987 		@$(AWK) '/^Z/ { print $$2 } /^L/ { print $$3 }' tzdata.zi
    988 
    989 asctime.o:	private.h tzfile.h
    990 date.o:		private.h
    991 difftime.o:	private.h
    992 localtime.o:	private.h tzfile.h
    993 strftime.o:	private.h tzfile.h
    994 zdump.o:	version.h
    995 zic.o:		private.h tzfile.h version.h
    996 
    997 .KEEP_STATE:
    998 
    999 .PHONY: ALL INSTALL all
   1000 .PHONY: check check_character_set check_links check_name_lengths
   1001 .PHONY: check_public check_sorted check_tables
   1002 .PHONY: check_time_t_alternatives check_tzs check_web check_white_space
   1003 .PHONY: check_zishrink
   1004 .PHONY: clean clean_misc dummy.zd force_tzs
   1005 .PHONY: install install_data maintainer-clean names
   1006 .PHONY: posix_only posix_packrat posix_right
   1007 .PHONY: public right_only right_posix signatures signatures_version
   1008 .PHONY: tarballs tarballs_version
   1009 .PHONY: traditional_signatures traditional_signatures_version
   1010 .PHONY: traditional_tarballs traditional_tarballs_version
   1011 .PHONY: typecheck
   1012 .PHONY: zonenames zones
   1013 .PHONY: $(ZDS)
   1014