Makefile revision 1.45
11.41Schristos# Make and install tzdb code and data.
21.41Schristos
31.1Smlelstv# This file is in the public domain, so clarified as of
41.1Smlelstv# 2009-05-17 by Arthur David Olson.
51.1Smlelstv
61.10Schristos# Package name for the code distribution.
71.10SchristosPACKAGE=	tzcode
81.10Schristos
91.34Schristos# Version number for the distribution, overridden in the 'tarballs' rule below.
101.35SchristosVERSION=	unknown
111.9Schristos
121.9Schristos# Email address for bug reports.
131.9SchristosBUGEMAIL=	tz@iana.org
141.6Schristos
151.43Schristos# DATAFORM selects the data format.
161.43Schristos# Available formats represent essentially the same data, albeit
171.43Schristos# possibly with minor discrepancies that users are not likely to notice.
181.43Schristos# To get new features and the best data right away, use:
191.40Schristos#	DATAFORM=	vanguard
201.40Schristos# To wait a while before using new features, to give downstream users
211.40Schristos# time to upgrade zic (the default), use:
221.40Schristos#	DATAFORM=	main
231.40Schristos# To wait even longer for new features, use:
241.40Schristos#	DATAFORM=	rearguard
251.40SchristosDATAFORM=		main
261.40Schristos
271.41Schristos# Change the line below for your timezone (after finding the one you want in
281.41Schristos# one of the $(TDATA) source files, or adding it to a source file).
291.41Schristos# Alternatively, if you discover you've got the wrong timezone, you can just
301.1Smlelstv#	zic -l rightzone
311.1Smlelstv# to correct things.
321.1Smlelstv# Use the command
331.1Smlelstv#	make zonenames
341.1Smlelstv# to get a list of the values you can use for LOCALTIME.
351.1Smlelstv
361.4SchristosLOCALTIME=	GMT
371.1Smlelstv
381.44Schristos# The POSIXRULES macro controls interpretation of nonstandard and obsolete
391.44Schristos# POSIX-like TZ settings like TZ='EET-2EEST' that lack DST transition rules.
401.44Schristos# In the reference implementation, if you want something other than Eastern
411.44Schristos# United States time as a template for handling these settings, you can
421.41Schristos# change the line below (after finding the timezone you want in the
431.41Schristos# one of the $(TDATA) source files, or adding it to a source file).
441.44Schristos# A setting like TZ='EET-2EEST' is supposed to use the rules in the
451.43Schristos# template file to determine "spring forward" and "fall back" days and
461.15Schristos# times; the environment variable itself specifies UT offsets of standard and
471.40Schristos# daylight saving time.
481.41Schristos# Alternatively, if you discover you've got the wrong timezone, you can just
491.1Smlelstv#	zic -p rightzone
501.1Smlelstv# to correct things.
511.1Smlelstv# Use the command
521.1Smlelstv#	make zonenames
531.1Smlelstv# to get a list of the values you can use for POSIXRULES.
541.44Schristos#
551.44Schristos# If POSIXRULES is empty, no template is installed; this is the intended
561.44Schristos# future default for POSIXRULES.
571.44Schristos#
581.44Schristos# Nonempty POSIXRULES is obsolete and should not be relied on, because:
591.44Schristos# * It does not work correctly in popular implementations such as GNU/Linux.
601.44Schristos# * It does not work in the tzdb implementation for timestamps after 2037.
611.44Schristos# * It is incompatible with 'zic -b slim' if POSIXRULES specifies transitions
621.44Schristos#   at standard time or UT rather than at local time.
631.44Schristos# In short, software should avoid ruleless settings like TZ='EET-2EEST'
641.44Schristos# and so should not depend on the value of POSIXRULES.
651.1Smlelstv
661.1SmlelstvPOSIXRULES=	America/New_York
671.1Smlelstv
681.1Smlelstv# Also see TZDEFRULESTRING below, which takes effect only
691.1Smlelstv# if the time zone files cannot be accessed.
701.1Smlelstv
711.1Smlelstv
721.39Schristos# Installation locations.
731.39Schristos#
741.39Schristos# The defaults are suitable for Debian, except that if REDO is
751.39Schristos# posix_right or right_posix then files that Debian puts under
761.39Schristos# /usr/share/zoneinfo/posix and /usr/share/zoneinfo/right are instead
771.39Schristos# put under /usr/share/zoneinfo-posix and /usr/share/zoneinfo-leaps,
781.39Schristos# respectively.  Problems with the Debian approach are discussed in
791.39Schristos# the commentary for the right_posix rule (below).
801.39Schristos
811.39Schristos# Destination directory, which can be used for staging.
821.39Schristos# 'make DESTDIR=/stage install' installs under /stage (e.g., to
831.39Schristos# /stage/etc/localtime instead of to /etc/localtime).  Files under
841.39Schristos# /stage are not intended to work as-is, but can be copied by hand to
851.39Schristos# the root directory later.  If DESTDIR is empty, 'make install' does
861.39Schristos# not stage, but installs directly into production locations.
871.39SchristosDESTDIR =
881.39Schristos
891.39Schristos# Everything is installed into subdirectories of TOPDIR, and used there.
901.39Schristos# TOPDIR should be empty (meaning the root directory),
911.39Schristos# or a directory name that does not end in "/".
921.39Schristos# TOPDIR should be empty or an absolute name unless you're just testing.
931.39SchristosTOPDIR =
941.39Schristos
951.41Schristos# The default local timezone is taken from the file TZDEFAULT.
961.39SchristosTZDEFAULT = $(TOPDIR)/etc/localtime
971.39Schristos
981.39Schristos# The subdirectory containing installed program and data files, and
991.39Schristos# likewise for installed files that can be shared among architectures.
1001.39Schristos# These should be relative file names.
1011.39SchristosUSRDIR = usr
1021.39SchristosUSRSHAREDIR = $(USRDIR)/share
1031.1Smlelstv
1041.41Schristos# "Compiled" timezone information is placed in the "TZDIR" directory
1051.1Smlelstv# (and subdirectories).
1061.38Schristos# TZDIR_BASENAME should not contain "/" and should not be ".", ".." or empty.
1071.15SchristosTZDIR_BASENAME=	zoneinfo
1081.39SchristosTZDIR = $(TOPDIR)/$(USRSHAREDIR)/$(TZDIR_BASENAME)
1091.1Smlelstv
1101.39Schristos# The "tzselect" and (if you do "make INSTALL") "date" commands go in:
1111.39SchristosBINDIR = $(TOPDIR)/$(USRDIR)/bin
1121.1Smlelstv
1131.39Schristos# The "zdump" command goes in:
1141.39SchristosZDUMPDIR = $(BINDIR)
1151.1Smlelstv
1161.39Schristos# The "zic" command goes in:
1171.39SchristosZICDIR = $(TOPDIR)/$(USRDIR)/sbin
1181.1Smlelstv
1191.1Smlelstv# Manual pages go in subdirectories of. . .
1201.39SchristosMANDIR = $(TOPDIR)/$(USRSHAREDIR)/man
1211.1Smlelstv
1221.39Schristos# Library functions are put in an archive in LIBDIR.
1231.39SchristosLIBDIR = $(TOPDIR)/$(USRDIR)/lib
1241.1Smlelstv
1251.1Smlelstv
1261.41Schristos# Types to try, as an alternative to time_t.
1271.41SchristosTIME_T_ALTERNATIVES = $(TIME_T_ALTERNATIVES_HEAD) $(TIME_T_ALTERNATIVES_TAIL)
1281.41SchristosTIME_T_ALTERNATIVES_HEAD = int64_t
1291.41SchristosTIME_T_ALTERNATIVES_TAIL = int32_t uint32_t uint64_t
1301.1Smlelstv
1311.43Schristos# What kind of TZif data files to generate.  (TZif is the binary time
1321.43Schristos# zone data format that zic generates; see Internet RFC 8536.)
1331.37Schristos# If you want only POSIX time, with time values interpreted as
1341.37Schristos# seconds since the epoch (not counting leap seconds), use
1351.1Smlelstv#	REDO=		posix_only
1361.38Schristos# below.  If you want only "right" time, with values interpreted
1371.37Schristos# as seconds since the epoch (counting leap seconds), use
1381.1Smlelstv#	REDO=		right_only
1391.1Smlelstv# below.  If you want both sets of data available, with leap seconds not
1401.1Smlelstv# counted normally, use
1411.1Smlelstv#	REDO=		posix_right
1421.1Smlelstv# below.  If you want both sets of data available, with leap seconds counted
1431.1Smlelstv# normally, use
1441.1Smlelstv#	REDO=		right_posix
1451.32Schristos# below.  POSIX mandates that leap seconds not be counted; for compatibility
1461.37Schristos# with it, use "posix_only" or "posix_right".  Use POSIX time on systems with
1471.37Schristos# leap smearing; this can work better than unsmeared "right" time with
1481.37Schristos# applications that are not leap second aware, and is closer to unsmeared
1491.37Schristos# "right" time than unsmeared POSIX time is (e.g., 0.5 vs 1.0 s max error).
1501.1Smlelstv
1511.1SmlelstvREDO=		posix_right
1521.1Smlelstv
1531.45Schristos# Whether to put an "Expires" line in the leapseconds file.
1541.45Schristos# Use EXPIRES_LINE=1 to put the line in, 0 to omit it.
1551.45Schristos# The EXPIRES_LINE value matters only if REDO's value contains "right".
1561.45Schristos# If you change EXPIRES_LINE, remove the leapseconds file before running "make".
1571.45Schristos# zic's support for the Expires line was introduced in tzdb 2020a,
1581.45Schristos# and EXPIRES_LINE defaults to 0 for now so that the leapseconds file
1591.45Schristos# can be given to older zic implementations.
1601.45SchristosEXPIRES_LINE=	0
1611.45Schristos
1621.41Schristos# To install data in text form that has all the information of the TZif data,
1631.38Schristos# (optionally incorporating leap second information), use
1641.38Schristos#	TZDATA_TEXT=	tzdata.zi leapseconds
1651.38Schristos# To install text data without leap second information (e.g., because
1661.38Schristos# REDO='posix_only'), use
1671.38Schristos#	TZDATA_TEXT=	tzdata.zi
1681.38Schristos# To avoid installing text data, use
1691.38Schristos#	TZDATA_TEXT=
1701.38Schristos
1711.38SchristosTZDATA_TEXT=	leapseconds tzdata.zi
1721.38Schristos
1731.38Schristos# For backward-compatibility links for old zone names, use
1741.39Schristos#	BACKWARD=	backward
1751.39Schristos# If you also want the link US/Pacific-New, even though it is confusing
1761.39Schristos# and is planned to be removed from the database eventually, use
1771.38Schristos#	BACKWARD=	backward pacificnew
1781.38Schristos# To omit these links, use
1791.38Schristos#	BACKWARD=
1801.38Schristos
1811.39SchristosBACKWARD=	backward
1821.38Schristos
1831.32Schristos# If you want out-of-scope and often-wrong data from the file 'backzone', use
1841.32Schristos#	PACKRATDATA=	backzone
1851.32Schristos# To omit this data, use
1861.32Schristos#	PACKRATDATA=
1871.32Schristos
1881.32SchristosPACKRATDATA=
1891.32Schristos
1901.38Schristos# The name of a locale using the UTF-8 encoding, used during self-tests.
1911.38Schristos# The tests are skipped if the name does not appear to work on this system.
1921.38Schristos
1931.38SchristosUTF8_LOCALE=	en_US.utf8
1941.38Schristos
1951.1Smlelstv# Since "." may not be in PATH...
1961.1Smlelstv
1971.1SmlelstvYEARISTYPE=	./yearistype
1981.1Smlelstv
1991.1Smlelstv# Non-default libraries needed to link.
2001.1SmlelstvLDLIBS=
2011.1Smlelstv
2021.38Schristos# Add the following to the end of the "CFLAGS=" line as needed to override
2031.38Schristos# defaults specified in the source code.  "-DFOO" is equivalent to "-DFOO=1".
2041.38Schristos#  -DDEPRECATE_TWO_DIGIT_YEARS for optional runtime warnings about strftime
2051.38Schristos#	formats that generate only the last two digits of year numbers
2061.38Schristos#  -DEPOCH_LOCAL if the 'time' function returns local time not UT
2071.38Schristos#  -DEPOCH_OFFSET=N if the 'time' function returns a value N greater
2081.38Schristos#	than what POSIX specifies, assuming local time is UT.
2091.38Schristos#	For example, N is 252460800 on AmigaOS.
2101.32Schristos#  -DHAVE_DECL_ASCTIME_R=0 if <time.h> does not declare asctime_r
2111.38Schristos#  -DHAVE_DECL_ENVIRON if <unistd.h> declares 'environ'
2121.32Schristos#  -DHAVE_DIRECT_H if mkdir needs <direct.h> (MS-Windows)
2131.38Schristos#  -DHAVE_GENERIC=0 if _Generic does not work
2141.38Schristos#  -DHAVE_GETTEXT if 'gettext' works (e.g., GNU/Linux, FreeBSD, Solaris)
2151.38Schristos#  -DHAVE_INCOMPATIBLE_CTIME_R if your system's time.h declares
2161.35Schristos#	ctime_r and asctime_r incompatibly with the POSIX standard
2171.35Schristos#	(Solaris when _POSIX_PTHREAD_SEMANTICS is not defined).
2181.38Schristos#  -DHAVE_INTTYPES_H if you have a non-C99 compiler with <inttypes.h>
2191.16Schristos#  -DHAVE_LINK=0 if your system lacks a link function
2201.23Schristos#  -DHAVE_LOCALTIME_R=0 if your system lacks a localtime_r function
2211.23Schristos#  -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz
2221.23Schristos#	localtime_rz can make zdump significantly faster, but is nonstandard.
2231.32Schristos#  -DHAVE_POSIX_DECLS=0 if your system's include files do not declare
2241.32Schristos#	functions like 'link' or variables like 'tzname' required by POSIX
2251.38Schristos#  -DHAVE_SNPRINTF=0 if your system lacks the snprintf function
2261.38Schristos#  -DHAVE_STDBOOL_H if you have a non-C99 compiler with <stdbool.h>
2271.38Schristos#  -DHAVE_STDINT_H if you have a non-C99 compiler with <stdint.h>
2281.38Schristos#  -DHAVE_STRFTIME_L if <time.h> declares locale_t and strftime_l
2291.28Schristos#  -DHAVE_STRDUP=0 if your system lacks the strdup function
2301.40Schristos#  -DHAVE_STRTOLL=0 if your system lacks the strtoll function
2311.1Smlelstv#  -DHAVE_SYMLINK=0 if your system lacks the symlink function
2321.38Schristos#  -DHAVE_SYS_STAT_H=0 if your compiler lacks a <sys/stat.h>
2331.38Schristos#  -DHAVE_SYS_WAIT_H=0 if your compiler lacks a <sys/wait.h>
2341.23Schristos#  -DHAVE_TZSET=0 if your system lacks a tzset function
2351.38Schristos#  -DHAVE_UNISTD_H=0 if your compiler lacks a <unistd.h>
2361.38Schristos#  -Dlocale_t=XXX if your system uses XXX instead of locale_t
2371.40Schristos#  -DRESERVE_STD_EXT_IDS if your platform reserves standard identifiers
2381.40Schristos#	with external linkage, e.g., applications cannot define 'localtime'.
2391.38Schristos#  -Dssize_t=long on hosts like MS-Windows that lack ssize_t
2401.40Schristos#  -DSUPPRESS_TZDIR to not prepend TZDIR to file names; this has
2411.40Schristos#	security implications and is not recommended for general use
2421.38Schristos#  -DTHREAD_SAFE to make localtime.c thread-safe, as POSIX requires;
2431.23Schristos#	not needed by the main-program tz code, which is single-threaded.
2441.23Schristos#	Append other compiler flags as needed, e.g., -pthread on GNU/Linux.
2451.14Schristos#  -Dtime_tz=\"T\" to use T as the time_t type, rather than the system time_t
2461.38Schristos#	This is intended for internal use only; it mangles external names.
2471.1Smlelstv#  -DTZ_DOMAIN=\"foo\" to use "foo" for gettext domain name; default is "tz"
2481.22Schristos#  -DTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory;
2491.1Smlelstv#	the default is system-supplied, typically "/usr/lib/locale"
2501.14Schristos#  -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified
2511.38Schristos#	DST transitions if the time zone files cannot be accessed
2521.38Schristos#  -DUNINIT_TRAP if reading uninitialized storage can cause problems
2531.23Schristos#	other than simply getting garbage data
2541.23Schristos#  -DUSE_LTZ=0 to build zdump with the system time zone library
2551.23Schristos#	Also set TZDOBJS=zdump.o and CHECK_TIME_T_ALTERNATIVES= below.
2561.44Schristos#  -DZIC_BLOAT_DEFAULT=\"slim\" to default zic's -b option to "slim", and
2571.44Schristos#	similarly for "fat".  Fat TZif files work around incompatibilities
2581.44Schristos#	and bugs in some TZif readers, notably readers that mishandle 64-bit
2591.44Schristos#	data in TZif files.  Slim TZif files are more efficient and do not
2601.44Schristos#	work around these incompatibilities and bugs.  If not given, the
2611.44Schristos#	current default is "fat" but this is intended to change as readers
2621.44Schristos#	requiring fat files often mishandle timestamps after 2037 anyway.
2631.1Smlelstv#  -DZIC_MAX_ABBR_LEN_WO_WARN=3
2641.1Smlelstv#	(or some other number) to set the maximum time zone abbreviation length
2651.1Smlelstv#	that zic will accept without a warning (the default is 6)
2661.30Schristos#  $(GCC_DEBUG_FLAGS) if you are using recent GCC and want lots of checking
2671.38Schristos# Select instrumentation via "make GCC_INSTRUMENT='whatever'".
2681.38SchristosGCC_INSTRUMENT = \
2691.38Schristos  -fsanitize=undefined -fsanitize-address-use-after-scope \
2701.38Schristos  -fsanitize-undefined-trap-on-error -fstack-protector
2711.38SchristosGCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
2721.38Schristos  $(GCC_INSTRUMENT) \
2731.38Schristos  -Wall -Wextra \
2741.38Schristos  -Walloc-size-larger-than=100000 -Warray-bounds=2 \
2751.40Schristos  -Wbad-function-cast -Wcast-align=strict -Wdate-time \
2761.38Schristos  -Wdeclaration-after-statement -Wdouble-promotion \
2771.38Schristos  -Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation \
2781.38Schristos  -Winit-self -Wjump-misses-init -Wlogical-op \
2791.38Schristos  -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
2801.38Schristos  -Wold-style-definition -Woverlength-strings -Wpointer-arith \
2811.40Schristos  -Wshadow -Wshift-overflow=2 -Wstrict-prototypes -Wstringop-overflow=4 \
2821.40Schristos  -Wstringop-truncation -Wsuggest-attribute=cold \
2831.38Schristos  -Wsuggest-attribute=const -Wsuggest-attribute=format \
2841.40Schristos  -Wsuggest-attribute=malloc \
2851.38Schristos  -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure \
2861.38Schristos  -Wtrampolines -Wundef -Wuninitialized -Wunused \
2871.38Schristos  -Wvariadic-macros -Wvla -Wwrite-strings \
2881.38Schristos  -Wno-address -Wno-format-nonliteral -Wno-sign-compare \
2891.38Schristos  -Wno-type-limits -Wno-unused-parameter
2901.1Smlelstv#
2911.1Smlelstv# If your system has a "GMT offset" field in its "struct tm"s
2921.1Smlelstv# (or if you decide to add such a field in your system's "time.h" file),
2931.1Smlelstv# add the name to a define such as
2941.1Smlelstv#	-DTM_GMTOFF=tm_gmtoff
2951.23Schristos# to the end of the "CFLAGS=" line.  If not defined, the code attempts to
2961.23Schristos# guess TM_GMTOFF from other macros; define NO_TM_GMTOFF to suppress this.
2971.23Schristos# Similarly, if your system has a "zone abbreviation" field, define
2981.1Smlelstv#	-DTM_ZONE=tm_zone
2991.23Schristos# and define NO_TM_ZONE to suppress any guessing.  These two fields are not
3001.23Schristos# required by POSIX, but are widely available on GNU/Linux and BSD systems.
3011.1Smlelstv#
3021.38Schristos# The next batch of options control support for external variables
3031.38Schristos# exported by tzcode.  In practice these variables are less useful
3041.38Schristos# than TM_GMTOFF and TM_ZONE.  However, most of them are standardized.
3051.38Schristos# #
3061.38Schristos# # To omit or support the external variable "tzname", add one of:
3071.45Schristos# #	-DHAVE_TZNAME=0 # do not support "tzname"
3081.45Schristos# #	-DHAVE_TZNAME=1 # support "tzname", which is defined by system library
3091.45Schristos# #	-DHAVE_TZNAME=2 # support and define "tzname"
3101.38Schristos# # to the "CFLAGS=" line.  "tzname" is required by POSIX 1988 and later.
3111.38Schristos# # If not defined, the code attempts to guess HAVE_TZNAME from other macros.
3121.38Schristos# # Warning: unless time_tz is also defined, HAVE_TZNAME=1 can cause
3131.38Schristos# # crashes when combined with some platforms' standard libraries,
3141.38Schristos# # presumably due to memory allocation issues.
3151.38Schristos# #
3161.38Schristos# # To omit or support the external variables "timezone" and "daylight", add
3171.45Schristos# #	-DUSG_COMPAT=0 # do not support
3181.45Schristos# #	-DUSG_COMPAT=1 # support, and variables are defined by system library
3191.45Schristos# #	-DUSG_COMPAT=2 # support and define variables
3201.38Schristos# # to the "CFLAGS=" line; "timezone" and "daylight" are inspired by
3211.38Schristos# # Unix Systems Group code and are required by POSIX 2008 (with XSI) and later.
3221.38Schristos# # If not defined, the code attempts to guess USG_COMPAT from other macros.
3231.38Schristos# #
3241.38Schristos# # To support the external variable "altzone", add
3251.45Schristos# #	-DALTZONE=0 # do not support
3261.45Schristos# #	-DALTZONE=1 # support "altzone", which is defined by system library
3271.45Schristos# #	-DALTZONE=2 # support and define "altzone"
3281.38Schristos# # to the end of the "CFLAGS=" line; although "altzone" appeared in
3291.38Schristos# # System V Release 3.1 it has not been standardized.
3301.45Schristos# # If not defined, the code attempts to guess ALTZONE from other macros.
3311.38Schristos#
3321.1Smlelstv# If you want functions that were inspired by early versions of X3J11's work,
3331.1Smlelstv# add
3341.1Smlelstv#	-DSTD_INSPIRED
3351.1Smlelstv# to the end of the "CFLAGS=" line.  This arranges for the functions
3361.1Smlelstv# "tzsetwall", "offtime", "timelocal", "timegm", "timeoff",
3371.1Smlelstv# "posix2time", and "time2posix" to be added to the time conversion library.
3381.45Schristos# "tzsetwall" is deprecated and is intended to be removed soon; see NEWS.
3391.1Smlelstv# "offtime" is like "gmtime" except that it accepts a second (long) argument
3401.1Smlelstv# that gives an offset to add to the time_t when converting it.
3411.1Smlelstv# "timelocal" is equivalent to "mktime".
3421.1Smlelstv# "timegm" is like "timelocal" except that it turns a struct tm into
3431.15Schristos# a time_t using UT (rather than local time as "timelocal" does).
3441.1Smlelstv# "timeoff" is like "timegm" except that it accepts a second (long) argument
3451.1Smlelstv# that gives an offset to use when converting to a time_t.
3461.1Smlelstv# "posix2time" and "time2posix" are described in an included manual page.
3471.1Smlelstv# X3J11's work does not describe any of these functions.
3481.1Smlelstv# These functions may well disappear in future releases of the time
3491.1Smlelstv# conversion package.
3501.1Smlelstv#
3511.23Schristos# If you don't want functions that were inspired by NetBSD, add
3521.23Schristos#	-DNETBSD_INSPIRED=0
3531.23Schristos# to the end of the "CFLAGS=" line.  Otherwise, the functions
3541.23Schristos# "localtime_rz", "mktime_z", "tzalloc", and "tzfree" are added to the
3551.23Schristos# time library, and if STD_INSPIRED is also defined the functions
3561.23Schristos# "posix2time_z" and "time2posix_z" are added as well.
3571.23Schristos# The functions ending in "_z" (or "_rz") are like their unsuffixed
3581.23Schristos# (or suffixed-by-"_r") counterparts, except with an extra first
3591.41Schristos# argument of opaque type timezone_t that specifies the timezone.
3601.23Schristos# "tzalloc" allocates a timezone_t value, and "tzfree" frees it.
3611.23Schristos#
3621.1Smlelstv# If you want to allocate state structures in localtime, add
3631.1Smlelstv#	-DALL_STATE
3641.1Smlelstv# to the end of the "CFLAGS=" line.  Storage is obtained by calling malloc.
3651.1Smlelstv#
3661.1Smlelstv# NIST-PCTS:151-2, Version 1.4, (1993-12-03) is a test suite put
3671.1Smlelstv# out by the National Institute of Standards and Technology
3681.1Smlelstv# which claims to test C and Posix conformance.  If you want to pass PCTS, add
3691.1Smlelstv#	-DPCTS
3701.1Smlelstv# to the end of the "CFLAGS=" line.
3711.1Smlelstv#
3721.1Smlelstv# If you want strict compliance with XPG4 as of 1994-04-09, add
3731.1Smlelstv#	-DXPG4_1994_04_09
3741.1Smlelstv# to the end of the "CFLAGS=" line.  This causes "strftime" to always return
3751.38Schristos# 53 as a week number (rather than 52 or 53) for January days before
3761.38Schristos# January's first Monday when a "%V" format is used and January 1
3771.1Smlelstv# falls on a Friday, Saturday, or Sunday.
3781.1Smlelstv
3791.1SmlelstvCFLAGS=
3801.1Smlelstv
3811.9Schristos# Linker flags.  Default to $(LFLAGS) for backwards compatibility
3821.34Schristos# to release 2012h and earlier.
3831.9Schristos
3841.9SchristosLDFLAGS=	$(LFLAGS)
3851.1Smlelstv
3861.32Schristos# For leap seconds, this Makefile uses LEAPSECONDS='-L leapseconds' in
3871.32Schristos# submake command lines.  The default is no leap seconds.
3881.32Schristos
3891.32SchristosLEAPSECONDS=
3901.32Schristos
3911.32Schristos# The zic command and its arguments.
3921.32Schristos
3931.1Smlelstvzic=		./zic
3941.1SmlelstvZIC=		$(zic) $(ZFLAGS)
3951.1Smlelstv
3961.43Schristos# To shrink the size of installed TZif files,
3971.43Schristos# append "-r @N" to omit data before N-seconds-after-the-Epoch.
3981.44Schristos# You can also append "-b slim" if that is not already the default;
3991.44Schristos# see ZIC_BLOAT_DEFAULT above.
4001.44Schristos# See the zic man page for more about -b and -r.
4011.15SchristosZFLAGS=
4021.15Schristos
4031.41Schristos# How to use zic to install TZif files.
4041.32Schristos
4051.39SchristosZIC_INSTALL=	$(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS)
4061.32Schristos
4071.22Schristos# The name of a Posix-compliant 'awk' on your system.
4081.41Schristos# Older 'mawk' versions, such as the 'mawk' in Ubuntu 16.04, might dump core;
4091.41Schristos# on Ubuntu you can work around this with
4101.41Schristos#	AWK=		gawk
4111.9SchristosAWK=		awk
4121.9Schristos
4131.16Schristos# The full path name of a Posix-compliant shell, preferably one that supports
4141.16Schristos# the Korn shell's 'select' statement as an extension.
4151.16Schristos# These days, Bash is the most popular.
4161.16Schristos# It should be OK to set this to /bin/sh, on platforms where /bin/sh
4171.16Schristos# lacks 'select' or doesn't completely conform to Posix, but /bin/bash
4181.16Schristos# is typically nicer if it works.
4191.9SchristosKSHELL=		/bin/bash
4201.1Smlelstv
4211.42Schristos# Name of curl <https://curl.haxx.se/>, used for HTML validation.
4221.42SchristosCURL=		curl
4231.42Schristos
4241.44Schristos# Name of GNU Privacy Guard <https://gnupg.org/>, used to sign distributions.
4251.44SchristosGPG=		gpg
4261.44Schristos
4271.18Schristos# The path where SGML DTDs are kept and the catalog file(s) to use when
4281.42Schristos# validating HTML 4.01.  The default should work on both Debian and Red Hat.
4291.10SchristosSGML_TOPDIR= /usr
4301.9SchristosSGML_DTDDIR= $(SGML_TOPDIR)/share/xml/w3c-sgml-lib/schema/dtd
4311.9SchristosSGML_SEARCH_PATH= $(SGML_DTDDIR)/REC-html401-19991224
4321.18SchristosSGML_CATALOG_FILES= \
4331.34Schristos  $(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
4341.1Smlelstv
4351.42Schristos# The name, arguments and environment of a program to validate HTML 4.01.
4361.34Schristos# See <http://openjade.sourceforge.net/doc/> for a validator, and
4371.34Schristos# <https://validator.w3.org/source/> for a validation library.
4381.38Schristos# Set VALIDATE=':' if you do not have such a program.
4391.1SmlelstvVALIDATE = nsgmls
4401.1SmlelstvVALIDATE_FLAGS = -s -B -wall -wno-unused-param
4411.1SmlelstvVALIDATE_ENV = \
4421.39Schristos  SGML_CATALOG_FILES='$(SGML_CATALOG_FILES)' \
4431.39Schristos  SGML_SEARCH_PATH='$(SGML_SEARCH_PATH)' \
4441.1Smlelstv  SP_CHARSET_FIXED=YES \
4451.1Smlelstv  SP_ENCODING=UTF-8
4461.1Smlelstv
4471.23Schristos# This expensive test requires USE_LTZ.
4481.23Schristos# To suppress it, define this macro to be empty.
4491.23SchristosCHECK_TIME_T_ALTERNATIVES = check_time_t_alternatives
4501.23Schristos
4511.22Schristos# SAFE_CHAR is a regular expression that matches a safe character.
4521.22Schristos# Some parts of this distribution are limited to safe characters;
4531.22Schristos# others can use any UTF-8 character.
4541.22Schristos# For now, the safe characters are a safe subset of ASCII.
4551.9Schristos# The caller must set the shell variable 'sharp' to the character '#',
4561.9Schristos# since Makefile macros cannot contain '#'.
4571.9Schristos# TAB_CHAR is a single tab character, in single quotes.
4581.9SchristosTAB_CHAR=	'	'
4591.22SchristosSAFE_CHARSET1=	$(TAB_CHAR)' !\"'$$sharp'$$%&'\''()*+,./0123456789:;<=>?@'
4601.22SchristosSAFE_CHARSET2=	'ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\^_`'
4611.22SchristosSAFE_CHARSET3=	'abcdefghijklmnopqrstuvwxyz{|}~'
4621.29SchristosSAFE_CHARSET=	$(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3)
4631.29SchristosSAFE_CHAR=	'[]'$(SAFE_CHARSET)'-]'
4641.29Schristos
4651.41Schristos# These characters are Latin-1, and so are likely to be displayable
4661.41Schristos# even in editors with limited character sets.
4671.41SchristosUNUSUAL_OK_LATIN_1 = «°±»½¾×
4681.41Schristos# This IPA symbol is represented in Unicode as the composition of
4691.41Schristos# U+0075 and U+032F, and U+032F is not considered alphabetic by some
4701.41Schristos# grep implementations that do not grok composition.
4711.41SchristosUNUSUAL_OK_IPA = u̯
4721.40Schristos# Non-ASCII non-letters that OK_CHAR allows, as these characters are
4731.41Schristos# useful in commentary.
4741.41SchristosUNUSUAL_OK_CHARSET= $(UNUSUAL_OK_LATIN_1)$(UNUSUAL_OK_IPA)
4751.40Schristos
4761.29Schristos# OK_CHAR matches any character allowed in the distributed files.
4771.40Schristos# This is the same as SAFE_CHAR, except that UNUSUAL_OK_CHARSET and
4781.40Schristos# multibyte letters are also allowed so that commentary can contain a
4791.40Schristos# few safe symbols and people's names and can quote non-English sources.
4801.40Schristos# Other non-letters are limited to ASCII renderings for the
4811.40Schristos# convenience of maintainers using XEmacs 21.5.34, which by default
4821.40Schristos# mishandles Unicode characters U+0100 and greater.
4831.40SchristosOK_CHAR=	'[][:alpha:]$(UNUSUAL_OK_CHARSET)'$(SAFE_CHARSET)'-]'
4841.22Schristos
4851.22Schristos# SAFE_LINE matches a line of safe characters.
4861.29Schristos# SAFE_SHARP_LINE is similar, except any OK character can follow '#';
4871.22Schristos# this is so that comments can contain non-ASCII characters.
4881.29Schristos# OK_LINE matches a line of OK characters.
4891.22SchristosSAFE_LINE=	'^'$(SAFE_CHAR)'*$$'
4901.29SchristosSAFE_SHARP_LINE='^'$(SAFE_CHAR)'*('$$sharp$(OK_CHAR)'*)?$$'
4911.29SchristosOK_LINE=	'^'$(OK_CHAR)'*$$'
4921.9Schristos
4931.6Schristos# Flags to give 'tar' when making a distribution.
4941.6Schristos# Try to use flags appropriate for GNU tar.
4951.34SchristosGNUTARFLAGS= --numeric-owner --owner=0 --group=0 --mode=go+u,go-w --sort=name
4961.6SchristosTARFLAGS=	`if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \
4971.6Schristos		 then echo $(GNUTARFLAGS); \
4981.6Schristos		 else :; \
4991.6Schristos		 fi`
5001.6Schristos
5011.6Schristos# Flags to give 'gzip' when making a distribution.
5021.38SchristosGZIPFLAGS=	-9n
5031.6Schristos
5041.1Smlelstv###############################################################################
5051.1Smlelstv
5061.29Schristos#MAKE=		make
5071.29Schristos
5081.1Smlelstvcc=		cc
5091.39SchristosCC=		$(cc) -DTZDIR='"$(TZDIR)"'
5101.1Smlelstv
5111.16SchristosAR=		ar
5121.16Schristos
5131.16Schristos# ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib.
5141.16SchristosRANLIB=		:
5151.16Schristos
5161.28SchristosTZCOBJS=	zic.o
5171.38SchristosTZDOBJS=	zdump.o localtime.o asctime.o strftime.o
5181.1SmlelstvDATEOBJS=	date.o localtime.o strftime.o asctime.o
5191.45SchristosLIBSRCS=	localtime.c asctime.c difftime.c strftime.c
5201.45SchristosLIBOBJS=	localtime.o asctime.o difftime.o strftime.o
5211.1SmlelstvHEADERS=	tzfile.h private.h
5221.28SchristosNONLIBSRCS=	zic.c zdump.c
5231.45SchristosNEWUCBSRCS=	date.c
5241.23SchristosSOURCES=	$(HEADERS) $(LIBSRCS) $(NONLIBSRCS) $(NEWUCBSRCS) \
5251.35Schristos			tzselect.ksh workman.sh
5261.1SmlelstvMANS=		newctime.3 newstrftime.3 newtzset.3 time2posix.3 \
5271.1Smlelstv			tzfile.5 tzselect.8 zic.8 zdump.8
5281.16SchristosMANTXTS=	newctime.3.txt newstrftime.3.txt newtzset.3.txt \
5291.16Schristos			time2posix.3.txt \
5301.16Schristos			tzfile.5.txt tzselect.8.txt zic.8.txt zdump.8.txt \
5311.16Schristos			date.1.txt
5321.38SchristosCOMMON=		calendars CONTRIBUTING LICENSE Makefile \
5331.38Schristos			NEWS README theory.html version
5341.39SchristosWEB_PAGES=	tz-art.html tz-how-to.html tz-link.html
5351.43SchristosCHECK_WEB_PAGES=check_theory.html check_tz-art.html \
5361.43Schristos			check_tz-how-to.html check_tz-link.html
5371.23SchristosDOCS=		$(MANS) date.1 $(MANTXTS) $(WEB_PAGES)
5381.1SmlelstvPRIMARY_YDATA=	africa antarctica asia australasia \
5391.1Smlelstv		europe northamerica southamerica
5401.39SchristosYDATA=		$(PRIMARY_YDATA) etcetera
5411.4SchristosNDATA=		systemv factory
5421.39SchristosTDATA_TO_CHECK=	$(YDATA) $(NDATA) backward pacificnew
5431.39SchristosTDATA=		$(YDATA) $(NDATA) $(BACKWARD)
5441.22SchristosZONETABLES=	zone1970.tab zone.tab
5451.38SchristosTABDATA=	iso3166.tab $(TZDATA_TEXT) $(ZONETABLES)
5461.16SchristosLEAP_DEPS=	leapseconds.awk leap-seconds.list
5471.40SchristosTZDATA_ZI_DEPS=	ziguard.awk zishrink.awk version $(TDATA) $(PACKRATDATA)
5481.40SchristosDSTDATA_ZI_DEPS= ziguard.awk $(TDATA) $(PACKRATDATA)
5491.39SchristosDATA=		$(TDATA_TO_CHECK) backzone iso3166.tab leap-seconds.list \
5501.38Schristos			leapseconds yearistype.sh $(ZONETABLES)
5511.40SchristosAWK_SCRIPTS=	checklinks.awk checktab.awk leapseconds.awk \
5521.40Schristos			ziguard.awk zishrink.awk
5531.23SchristosMISC=		$(AWK_SCRIPTS) zoneinfo2tdf.pl
5541.34SchristosTZS_YEAR=	2050
5551.41SchristosTZS_CUTOFF_FLAG=	-c $(TZS_YEAR)
5561.34SchristosTZS=		to$(TZS_YEAR).tzs
5571.34SchristosTZS_NEW=	to$(TZS_YEAR)new.tzs
5581.34SchristosTZS_DEPS=	$(PRIMARY_YDATA) asctime.c localtime.c \
5591.34Schristos			private.h tzfile.h zdump.c zic.c
5601.41Schristos# EIGHT_YARDS is just a yard short of the whole ENCHILADA.
5611.41SchristosEIGHT_YARDS = $(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC) tzdata.zi
5621.41SchristosENCHILADA = $(EIGHT_YARDS) $(TZS)
5631.34Schristos
5641.34Schristos# Consult these files when deciding whether to rebuild the 'version' file.
5651.34Schristos# This list is not the same as the output of 'git ls-files', since
5661.34Schristos# .gitignore is not distributed.
5671.34SchristosVERSION_DEPS= \
5681.38Schristos		calendars CONTRIBUTING LICENSE Makefile NEWS README \
5691.34Schristos		africa antarctica asctime.c asia australasia \
5701.34Schristos		backward backzone \
5711.34Schristos		checklinks.awk checktab.awk \
5721.34Schristos		date.1 date.c difftime.c \
5731.34Schristos		etcetera europe factory iso3166.tab \
5741.34Schristos		leap-seconds.list leapseconds.awk localtime.c \
5751.34Schristos		newctime.3 newstrftime.3 newtzset.3 northamerica \
5761.34Schristos		pacificnew private.h \
5771.38Schristos		southamerica strftime.c systemv theory.html \
5781.39Schristos		time2posix.3 tz-art.html tz-how-to.html tz-link.html \
5791.34Schristos		tzfile.5 tzfile.h tzselect.8 tzselect.ksh \
5801.34Schristos		workman.sh yearistype.sh \
5811.34Schristos		zdump.8 zdump.c zic.8 zic.c \
5821.40Schristos		ziguard.awk zishrink.awk \
5831.34Schristos		zone.tab zone1970.tab zoneinfo2tdf.pl
5841.1Smlelstv
5851.1Smlelstv# And for the benefit of csh users on systems that assume the user
5861.1Smlelstv# shell should be used to handle commands in Makefiles. . .
5871.1Smlelstv
5881.1SmlelstvSHELL=		/bin/sh
5891.1Smlelstv
5901.40Schristosall:		tzselect yearistype zic zdump libtz.a $(TABDATA) \
5911.40Schristos		  vanguard.zi main.zi rearguard.zi
5921.1Smlelstv
5931.29SchristosALL:		all date $(ENCHILADA)
5941.1Smlelstv
5951.16Schristosinstall:	all $(DATA) $(REDO) $(MANS)
5961.39Schristos		mkdir -p '$(DESTDIR)$(BINDIR)' \
5971.39Schristos			'$(DESTDIR)$(ZDUMPDIR)' '$(DESTDIR)$(ZICDIR)' \
5981.39Schristos			'$(DESTDIR)$(LIBDIR)' \
5991.39Schristos			'$(DESTDIR)$(MANDIR)/man3' '$(DESTDIR)$(MANDIR)/man5' \
6001.39Schristos			'$(DESTDIR)$(MANDIR)/man8'
6011.44Schristos		$(ZIC_INSTALL) -l $(LOCALTIME) \
6021.44Schristos			`case '$(POSIXRULES)' in ?*) echo '-p';; esac \
6031.44Schristos			` $(POSIXRULES) \
6041.39Schristos			-t '$(DESTDIR)$(TZDEFAULT)'
6051.39Schristos		cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.'
6061.39Schristos		cp tzselect '$(DESTDIR)$(BINDIR)/.'
6071.39Schristos		cp zdump '$(DESTDIR)$(ZDUMPDIR)/.'
6081.39Schristos		cp zic '$(DESTDIR)$(ZICDIR)/.'
6091.39Schristos		cp libtz.a '$(DESTDIR)$(LIBDIR)/.'
6101.39Schristos		$(RANLIB) '$(DESTDIR)$(LIBDIR)/libtz.a'
6111.39Schristos		cp -f newctime.3 newtzset.3 '$(DESTDIR)$(MANDIR)/man3/.'
6121.39Schristos		cp -f tzfile.5 '$(DESTDIR)$(MANDIR)/man5/.'
6131.39Schristos		cp -f tzselect.8 zdump.8 zic.8 '$(DESTDIR)$(MANDIR)/man8/.'
6141.1Smlelstv
6151.1SmlelstvINSTALL:	ALL install date.1
6161.39Schristos		mkdir -p '$(DESTDIR)$(BINDIR)' '$(DESTDIR)$(MANDIR)/man1'
6171.39Schristos		cp date '$(DESTDIR)$(BINDIR)/.'
6181.39Schristos		cp -f date.1 '$(DESTDIR)$(MANDIR)/man1/.'
6191.1Smlelstv
6201.34Schristosversion:	$(VERSION_DEPS)
6211.35Schristos		{ (type git) >/dev/null 2>&1 && \
6221.35Schristos		  V=`git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \
6231.35Schristos				--abbrev=7 --dirty` || \
6241.39Schristos		  V='$(VERSION)'; } && \
6251.35Schristos		printf '%s\n' "$$V" >$@.out
6261.35Schristos		mv $@.out $@
6271.34Schristos
6281.41Schristos# These files can be tailored by setting BACKWARD and PACKRATDATA.
6291.40Schristosvanguard.zi main.zi rearguard.zi: $(DSTDATA_ZI_DEPS)
6301.40Schristos		$(AWK) -v DATAFORM=`expr $@ : '\(.*\).zi'` -f ziguard.awk \
6311.40Schristos		  $(TDATA) $(PACKRATDATA) >$@.out
6321.40Schristos		mv $@.out $@
6331.41Schristos# This file has a version comment that attempts to capture any tailoring
6341.41Schristos# via BACKWARD, DATAFORM, PACKRATDATA, and REDO.
6351.41Schristostzdata.zi:	$(DATAFORM).zi version zishrink.awk
6361.39Schristos		version=`sed 1q version` && \
6371.41Schristos		  LC_ALL=C $(AWK) \
6381.41Schristos		    -v dataform='$(DATAFORM)' \
6391.41Schristos		    -v deps='$(DSTDATA_ZI_DEPS) zishrink.awk' \
6401.41Schristos		    -v redo='$(REDO)' \
6411.41Schristos		    -v version="$$version" \
6421.41Schristos		    -f zishrink.awk \
6431.40Schristos		    $(DATAFORM).zi >$@.out
6441.38Schristos		mv $@.out $@
6451.38Schristos
6461.34Schristosversion.h:	version
6471.35Schristos		VERSION=`cat version` && printf '%s\n' \
6481.35Schristos		  'static char const PKGVERSION[]="($(PACKAGE)) ";' \
6491.35Schristos		  "static char const TZVERSION[]=\"$$VERSION\";" \
6501.35Schristos		  'static char const REPORT_BUGS_TO[]="$(BUGEMAIL)";' \
6511.35Schristos		  >$@.out
6521.35Schristos		mv $@.out $@
6531.6Schristos
6541.1Smlelstvzdump:		$(TZDOBJS)
6551.9Schristos		$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS)
6561.1Smlelstv
6571.32Schristoszic:		$(TZCOBJS)
6581.9Schristos		$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS)
6591.1Smlelstv
6601.1Smlelstvyearistype:	yearistype.sh
6611.1Smlelstv		cp yearistype.sh yearistype
6621.1Smlelstv		chmod +x yearistype
6631.1Smlelstv
6641.16Schristosleapseconds:	$(LEAP_DEPS)
6651.45Schristos		$(AWK) -v EXPIRES_LINE=$(EXPIRES_LINE) \
6661.45Schristos		  -f leapseconds.awk leap-seconds.list >$@.out
6671.35Schristos		mv $@.out $@
6681.15Schristos
6691.32Schristos# Arguments to pass to submakes of install_data.
6701.32Schristos# They can be overridden by later submake arguments.
6711.32SchristosINSTALLARGS = \
6721.39Schristos BACKWARD='$(BACKWARD)' \
6731.39Schristos DESTDIR='$(DESTDIR)' \
6741.32Schristos LEAPSECONDS='$(LEAPSECONDS)' \
6751.32Schristos PACKRATDATA='$(PACKRATDATA)' \
6761.39Schristos TZDEFAULT='$(TZDEFAULT)' \
6771.39Schristos TZDIR='$(TZDIR)' \
6781.39Schristos YEARISTYPE='$(YEARISTYPE)' \
6791.32Schristos ZIC='$(ZIC)'
6801.32Schristos
6811.41SchristosINSTALL_DATA_DEPS = zic leapseconds yearistype tzdata.zi
6821.41Schristos
6831.41Schristos# 'make install_data' installs one set of TZif files.
6841.41Schristosinstall_data: $(INSTALL_DATA_DEPS)
6851.38Schristos		$(ZIC_INSTALL) tzdata.zi
6861.32Schristos
6871.41Schristosposix_only: $(INSTALL_DATA_DEPS)
6881.32Schristos		$(MAKE) $(INSTALLARGS) LEAPSECONDS= install_data
6891.32Schristos
6901.41Schristosright_only: $(INSTALL_DATA_DEPS)
6911.32Schristos		$(MAKE) $(INSTALLARGS) LEAPSECONDS='-L leapseconds' \
6921.32Schristos			install_data
6931.1Smlelstv
6941.1Smlelstv# In earlier versions of this makefile, the other two directories were
6951.1Smlelstv# subdirectories of $(TZDIR).  However, this led to configuration errors.
6961.1Smlelstv# For example, with posix_right under the earlier scheme,
6971.1Smlelstv# TZ='right/Australia/Adelaide' got you localtime with leap seconds,
6981.1Smlelstv# but gmtime without leap seconds, which led to problems with applications
6991.1Smlelstv# like sendmail that subtract gmtime from localtime.
7001.1Smlelstv# Therefore, the other two directories are now siblings of $(TZDIR).
7011.1Smlelstv# You must replace all of $(TZDIR) to switch from not using leap seconds
7021.1Smlelstv# to using them, or vice versa.
7031.32Schristosright_posix:	right_only
7041.39Schristos		rm -fr '$(DESTDIR)$(TZDIR)-leaps'
7051.39Schristos		ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-leaps' || \
7061.39Schristos		  $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only
7071.39Schristos		$(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only
7081.15Schristos
7091.32Schristosposix_right:	posix_only
7101.39Schristos		rm -fr '$(DESTDIR)$(TZDIR)-posix'
7111.39Schristos		ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-posix' || \
7121.39Schristos		  $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only
7131.39Schristos		$(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only
7141.32Schristos
7151.32Schristos# This obsolescent rule is present for backwards compatibility with
7161.32Schristos# tz releases 2014g through 2015g.  It should go away eventually.
7171.41Schristosposix_packrat: $(INSTALL_DATA_DEPS)
7181.32Schristos		$(MAKE) $(INSTALLARGS) PACKRATDATA=backzone posix_only
7191.23Schristos
7201.1Smlelstvzones:		$(REDO)
7211.1Smlelstv
7221.40Schristos# dummy.zd is not a real file; it is mentioned here only so that the
7231.40Schristos# top-level 'make' does not have a syntax error.
7241.40SchristosZDS = dummy.zd
7251.40Schristos# Rule used only by submakes invoked by the $(TZS_NEW) rule.
7261.40Schristos# It is separate so that GNU 'make -j' can run instances in parallel.
7271.40Schristos$(ZDS): zdump
7281.41Schristos		./zdump -i $(TZS_CUTOFF_FLAG) '$(wd)/'$$(expr $@ : '\(.*\).zd') \
7291.41Schristos		  >$@
7301.40Schristos
7311.41SchristosTZS_NEW_DEPS = tzdata.zi zdump zic
7321.41Schristos$(TZS_NEW): $(TZS_NEW_DEPS)
7331.41Schristos		rm -fr tzs$(TZS_YEAR).dir
7341.41Schristos		mkdir tzs$(TZS_YEAR).dir
7351.41Schristos		$(zic) -d tzs$(TZS_YEAR).dir tzdata.zi
7361.38Schristos		$(AWK) '/^L/{print "Link\t" $$2 "\t" $$3}' \
7371.38Schristos		   tzdata.zi | LC_ALL=C sort >$@.out
7381.35Schristos		wd=`pwd` && \
7391.41Schristos		x=`$(AWK) '/^Z/{print "tzs$(TZS_YEAR).dir/" $$2 ".zd"}' \
7401.41Schristos				tzdata.zi \
7411.40Schristos			| LC_ALL=C sort -t . -k 2,2` && \
7421.41Schristos		set x $$x && \
7431.40Schristos		shift && \
7441.40Schristos		ZDS=$$* && \
7451.41Schristos		$(MAKE) wd="$$wd" TZS_CUTOFF_FLAG="$(TZS_CUTOFF_FLAG)" \
7461.41Schristos		  ZDS="$$ZDS" $$ZDS && \
7471.41Schristos		sed 's,^TZ=".*\.dir/,TZ=",' $$ZDS >>$@.out
7481.41Schristos		rm -fr tzs$(TZS_YEAR).dir
7491.40Schristos		mv $@.out $@
7501.34Schristos
7511.41Schristos# If $(TZS) exists but 'make check_tzs' fails, a maintainer should inspect the
7521.34Schristos# failed output and fix the inconsistency, perhaps by running 'make force_tzs'.
7531.34Schristos$(TZS):
7541.41Schristos		touch $@
7551.34Schristos
7561.34Schristosforce_tzs:	$(TZS_NEW)
7571.34Schristos		cp $(TZS_NEW) $(TZS)
7581.34Schristos
7591.16Schristoslibtz.a:	$(LIBOBJS)
7601.37Schristos		rm -f $@
7611.37Schristos		$(AR) -rc $@ $(LIBOBJS)
7621.16Schristos		$(RANLIB) $@
7631.1Smlelstv
7641.1Smlelstvdate:		$(DATEOBJS)
7651.9Schristos		$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS)
7661.1Smlelstv
7671.34Schristostzselect:	tzselect.ksh version
7681.35Schristos		VERSION=`cat version` && sed \
7691.9Schristos			-e 's|#!/bin/bash|#!$(KSHELL)|g' \
7701.1Smlelstv			-e 's|AWK=[^}]*|AWK=$(AWK)|g' \
7711.9Schristos			-e 's|\(PKGVERSION\)=.*|\1='\''($(PACKAGE)) '\''|' \
7721.9Schristos			-e 's|\(REPORT_BUGS_TO\)=.*|\1=$(BUGEMAIL)|' \
7731.1Smlelstv			-e 's|TZDIR=[^}]*|TZDIR=$(TZDIR)|' \
7741.35Schristos			-e 's|\(TZVERSION\)=.*|\1='"$$VERSION"'|' \
7751.35Schristos			<$@.ksh >$@.out
7761.35Schristos		chmod +x $@.out
7771.35Schristos		mv $@.out $@
7781.1Smlelstv
7791.38Schristoscheck:		check_character_set check_white_space check_links \
7801.38Schristos		  check_name_lengths check_sorted \
7811.38Schristos		  check_tables check_web check_zishrink check_tzs
7821.9Schristos
7831.9Schristoscheck_character_set: $(ENCHILADA)
7841.38Schristos	test ! '$(UTF8_LOCALE)' || \
7851.38Schristos	! printf 'A\304\200B\n' | \
7861.38Schristos	  LC_ALL='$(UTF8_LOCALE)' grep -q '^A.B$$' >/dev/null 2>&1 || { \
7871.38Schristos		LC_ALL='$(UTF8_LOCALE)' && export LC_ALL && \
7881.22Schristos		sharp='#' && \
7891.35Schristos		! grep -Env $(SAFE_LINE) $(MANS) date.1 $(MANTXTS) \
7901.35Schristos			$(MISC) $(SOURCES) $(WEB_PAGES) \
7911.40Schristos			CONTRIBUTING LICENSE README \
7921.38Schristos			version tzdata.zi && \
7931.41Schristos		! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_'$(OK_CHAR)'*$$' \
7941.40Schristos			Makefile && \
7951.39Schristos		! grep -Env $(SAFE_SHARP_LINE) $(TDATA_TO_CHECK) backzone \
7961.29Schristos			leapseconds yearistype.sh zone.tab && \
7971.38Schristos		! grep -Env $(OK_LINE) $(ENCHILADA); \
7981.38Schristos	}
7991.41Schristos	touch $@
8001.22Schristos
8011.23Schristoscheck_white_space: $(ENCHILADA)
8021.35Schristos		patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \
8031.41Schristos		! grep -En "$$pat" \
8041.41Schristos			$$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list)
8051.39Schristos		! grep -n '[[:space:]]$$' \
8061.39Schristos			$$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list)
8071.41Schristos		touch $@
8081.23Schristos
8091.38SchristosPRECEDES_FILE_NAME = ^(Zone|Link[[:space:]]+[^[:space:]]+)[[:space:]]+
8101.38SchristosFILE_NAME_COMPONENT_TOO_LONG = \
8111.38Schristos  $(PRECEDES_FILE_NAME)[^[:space:]]*[^/[:space:]]{15}
8121.38Schristos
8131.39Schristoscheck_name_lengths: $(TDATA_TO_CHECK) backzone
8141.39Schristos		! grep -En '$(FILE_NAME_COMPONENT_TOO_LONG)' \
8151.39Schristos			$(TDATA_TO_CHECK) backzone
8161.41Schristos		touch $@
8171.38Schristos
8181.23SchristosCHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; }
8191.23Schristos
8201.23Schristoscheck_sorted: backward backzone iso3166.tab zone.tab zone1970.tab
8211.23Schristos		$(AWK) '/^Link/ {print $$3}' backward | LC_ALL=C sort -cu
8221.23Schristos		$(AWK) '/^Zone/ {print $$2}' backzone | LC_ALL=C sort -cu
8231.41Schristos		touch $@
8241.23Schristos
8251.40Schristoscheck_links:	checklinks.awk $(TDATA_TO_CHECK) tzdata.zi
8261.39Schristos		$(AWK) -f checklinks.awk $(TDATA_TO_CHECK)
8271.38Schristos		$(AWK) -f checklinks.awk tzdata.zi
8281.41Schristos		touch $@
8291.26Schristos
8301.22Schristoscheck_tables:	checktab.awk $(PRIMARY_YDATA) $(ZONETABLES)
8311.22Schristos		for tab in $(ZONETABLES); do \
8321.22Schristos		  $(AWK) -f checktab.awk -v zone_table=$$tab $(PRIMARY_YDATA) \
8331.22Schristos		    || exit; \
8341.22Schristos		done
8351.41Schristos		touch $@
8361.1Smlelstv
8371.34Schristoscheck_tzs:	$(TZS) $(TZS_NEW)
8381.41Schristos		if test -s $(TZS); then \
8391.41Schristos		  diff -u $(TZS) $(TZS_NEW); \
8401.41Schristos		else \
8411.41Schristos		  cp $(TZS_NEW) $(TZS); \
8421.41Schristos		fi
8431.41Schristos		touch $@
8441.34Schristos
8451.42Schristoscheck_web:	$(CHECK_WEB_PAGES)
8461.43Schristoscheck_theory.html: theory.html
8471.42Schristoscheck_tz-art.html: tz-art.html
8481.42Schristoscheck_tz-link.html: tz-link.html
8491.43Schristoscheck_theory.html check_tz-art.html check_tz-link.html:
8501.42Schristos		$(CURL) -sS --url https://validator.w3.org/nu/ -F out=gnu \
8511.42Schristos		    -F file=@$$(expr $@ : 'check_\(.*\)') -o $@.out && \
8521.42Schristos		  test ! -s $@.out || { cat $@.out; exit 1; }
8531.42Schristos		mv $@.out $@
8541.42Schristoscheck_tz-how-to.html: tz-how-to.html
8551.38Schristos		$(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) tz-how-to.html
8561.41Schristos		touch $@
8571.38Schristos
8581.40Schristos# Check that zishrink.awk does not alter the data, and that ziguard.awk
8591.40Schristos# preserves main-format data.
8601.41Schristoscheck_zishrink: check_zishrink_posix check_zishrink_right
8611.41Schristoscheck_zishrink_posix check_zishrink_right: \
8621.41Schristos  zic leapseconds $(PACKRATDATA) $(TDATA) $(DATAFORM).zi tzdata.zi
8631.41Schristos		rm -fr $@.dir $@-t.dir $@-shrunk.dir
8641.41Schristos		mkdir $@.dir $@-t.dir $@-shrunk.dir
8651.41Schristos		case $@ in \
8661.41Schristos		  *_right) leap='-L leapseconds';; \
8671.41Schristos		  *) leap=;; \
8681.41Schristos		esac && \
8691.41Schristos		  $(ZIC) $$leap -d $@.dir $(DATAFORM).zi && \
8701.41Schristos		  $(ZIC) $$leap -d $@-shrunk.dir tzdata.zi && \
8711.40Schristos		  case $(DATAFORM) in \
8721.40Schristos		    main) \
8731.41Schristos		      $(ZIC) $$leap -d $@-t.dir $(TDATA) && \
8741.40Schristos		      $(AWK) '/^Rule/' $(TDATA) | \
8751.41Schristos			$(ZIC) $$leap -d $@-t.dir - $(PACKRATDATA) && \
8761.41Schristos		      diff -r $@.dir $@-t.dir;; \
8771.41Schristos		  esac
8781.41Schristos		diff -r $@.dir $@-shrunk.dir
8791.41Schristos		rm -fr $@.dir $@-t.dir $@-shrunk.dir
8801.41Schristos		touch $@
8811.1Smlelstv
8821.14Schristosclean_misc:
8831.43Schristos		rm -fr check_*.dir
8841.41Schristos		rm -f *.o *.out $(TIME_T_ALTERNATIVES) \
8851.41Schristos		  check_* core typecheck_* \
8861.18Schristos		  date tzselect version.h zdump zic yearistype libtz.a
8871.14Schristosclean:		clean_misc
8881.43Schristos		rm -fr *.dir tzdb-*/
8891.43Schristos		rm -f *.zi $(TZS_NEW)
8901.1Smlelstv
8911.1Smlelstvmaintainer-clean: clean
8921.1Smlelstv		@echo 'This command is intended for maintainers to use; it'
8931.1Smlelstv		@echo 'deletes files that may need special tools to rebuild.'
8941.34Schristos		rm -f leapseconds version $(MANTXTS) $(TZS) *.asc *.tar.*
8951.1Smlelstv
8961.1Smlelstvnames:
8971.1Smlelstv		@echo $(ENCHILADA)
8981.1Smlelstv
8991.23Schristospublic:		check check_public $(CHECK_TIME_T_ALTERNATIVES) \
9001.16Schristos		tarballs signatures
9011.16Schristos
9021.16Schristosdate.1.txt:	date.1
9031.16Schristosnewctime.3.txt:	newctime.3
9041.16Schristosnewstrftime.3.txt: newstrftime.3
9051.16Schristosnewtzset.3.txt:	newtzset.3
9061.16Schristostime2posix.3.txt: time2posix.3
9071.16Schristostzfile.5.txt:	tzfile.5
9081.16Schristostzselect.8.txt:	tzselect.8
9091.16Schristoszdump.8.txt:	zdump.8
9101.16Schristoszic.8.txt:	zic.8
9111.16Schristos
9121.16Schristos$(MANTXTS):	workman.sh
9131.35Schristos		LC_ALL=C sh workman.sh `expr $@ : '\(.*\)\.txt$$'` >$@.out
9141.35Schristos		mv $@.out $@
9151.9Schristos
9161.41Schristos# Set the timestamps to those of the git repository, if available,
9171.6Schristos# and if the files have not changed since then.
9181.6Schristos# This uses GNU 'touch' syntax 'touch -d@N FILE',
9191.6Schristos# where N is the number of seconds since 1970.
9201.16Schristos# If git or GNU 'touch' is absent, don't bother to sync with git timestamps.
9211.16Schristos# Also, set the timestamp of each prebuilt file like 'leapseconds'
9221.16Schristos# to be the maximum of the files it depends on.
9231.41Schristosset-timestamps.out: $(EIGHT_YARDS)
9241.16Schristos		rm -f $@
9251.35Schristos		if (type git) >/dev/null 2>&1 && \
9261.41Schristos		   files=`git ls-files $(EIGHT_YARDS)` && \
9271.16Schristos		   touch -md @1 test.out; then \
9281.16Schristos		  rm -f test.out && \
9291.16Schristos		  for file in $$files; do \
9301.16Schristos		    if git diff --quiet $$file; then \
9311.16Schristos		      time=`git log -1 --format='tformat:%ct' $$file` && \
9321.16Schristos		      touch -cmd @$$time $$file; \
9331.16Schristos		    else \
9341.16Schristos		      echo >&2 "$$file: warning: does not match repository"; \
9351.16Schristos		    fi || exit; \
9361.16Schristos		  done; \
9371.16Schristos		fi
9381.16Schristos		touch -cmr `ls -t $(LEAP_DEPS) | sed 1q` leapseconds
9391.16Schristos		for file in `ls $(MANTXTS) | sed 's/\.txt$$//'`; do \
9401.16Schristos		  touch -cmr `ls -t $$file workman.sh | sed 1q` $$file.txt || \
9411.16Schristos		    exit; \
9421.6Schristos		done
9431.38Schristos		touch -cmr `ls -t $(TZDATA_ZI_DEPS) | sed 1q` tzdata.zi
9441.41Schristos		touch -cmr `ls -t $(VERSION_DEPS) | sed 1q` version
9451.41Schristos		touch $@
9461.41Schristosset-tzs-timestamp.out: $(TZS)
9471.35Schristos		touch -cmr `ls -t $(TZS_DEPS) | sed 1q` $(TZS)
9481.16Schristos		touch $@
9491.6Schristos
9501.1Smlelstv# The zics below ensure that each data file can stand on its own.
9511.1Smlelstv# We also do an all-files run to catch links to links.
9521.1Smlelstv
9531.41Schristoscheck_public: $(VERSION_DEPS)
9541.41Schristos		rm -fr public.dir
9551.41Schristos		mkdir public.dir
9561.41Schristos		ln $(VERSION_DEPS) public.dir
9571.41Schristos		cd public.dir && $(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' ALL
9581.41Schristos		for i in $(TDATA_TO_CHECK) public.dir/tzdata.zi; do \
9591.41Schristos		  public.dir/zic -v -d public.dir/zoneinfo $$i 2>&1 || exit; \
9601.9Schristos		done
9611.41Schristos		public.dir/zic -v -d public.dir/zoneinfo-all $(TDATA_TO_CHECK)
9621.34Schristos		rm -fr public.dir
9631.41Schristos		touch $@
9641.9Schristos
9651.14Schristos# Check that the code works under various alternative
9661.14Schristos# implementations of time_t.
9671.41Schristoscheck_time_t_alternatives: $(TIME_T_ALTERNATIVES)
9681.41Schristos$(TIME_T_ALTERNATIVES_TAIL): $(TIME_T_ALTERNATIVES_HEAD)
9691.41Schristos$(TIME_T_ALTERNATIVES): $(VERSION_DEPS)
9701.41Schristos		rm -fr $@.dir
9711.41Schristos		mkdir $@.dir
9721.41Schristos		ln $(VERSION_DEPS) $@.dir
9731.41Schristos		case $@ in \
9741.41Schristos		  int32_t) range=-2147483648,2147483648;; \
9751.41Schristos		  u*) range=0,4294967296;; \
9761.41Schristos		  *) range=-4294967296,4294967296;; \
9771.41Schristos		esac && \
9781.41Schristos		wd=`pwd` && \
9791.41Schristos		zones=`$(AWK) '/^[^#]/ { print $$3 }' <zone1970.tab` && \
9801.41Schristos		if test $@ = $(TIME_T_ALTERNATIVES_HEAD); then \
9811.41Schristos		  range_target=; \
9821.23Schristos		else \
9831.41Schristos		  range_target=to$$range.tzs; \
9841.23Schristos		fi && \
9851.41Schristos		(cd $@.dir && \
9861.41Schristos		  $(MAKE) TOPDIR="$$wd/$@.dir" \
9871.41Schristos		    CFLAGS='$(CFLAGS) -Dtime_tz='"'$@'" \
9881.23Schristos		    REDO='$(REDO)' \
9891.41Schristos			D=$$wd/$@.dir \
9901.41Schristos		    TZS_YEAR="$$range" TZS_CUTOFF_FLAG="-t $$range" \
9911.41Schristos		    install $$range_target) && \
9921.41Schristos		test $@ = $(TIME_T_ALTERNATIVES_HEAD) || { \
9931.41Schristos		  (cd $(TIME_T_ALTERNATIVES_HEAD).dir && \
9941.41Schristos		    $(MAKE) TOPDIR="$$wd/$@.dir" \
9951.41Schristos		      TZS_YEAR="$$range" TZS_CUTOFF_FLAG="-t $$range" \
9961.41Schristos			D=$$wd/$@.dir \
9971.41Schristos		      to$$range.tzs) && \
9981.41Schristos		  diff -u $(TIME_T_ALTERNATIVES_HEAD).dir/to$$range.tzs \
9991.41Schristos			  $@.dir/to$$range.tzs && \
10001.41Schristos		  if diff -q Makefile Makefile 2>/dev/null; then \
10011.41Schristos		    quiet_option='-q'; \
10021.41Schristos		  else \
10031.41Schristos		    quiet_option=''; \
10041.41Schristos		  fi && \
10051.41Schristos		    diff $$quiet_option -r $(TIME_T_ALTERNATIVES_HEAD).dir/etc \
10061.41Schristos					   $@.dir/etc && \
10071.41Schristos		    diff $$quiet_option -r \
10081.41Schristos		      $(TIME_T_ALTERNATIVES_HEAD).dir/usr/share \
10091.41Schristos		      $@.dir/usr/share; \
10101.41Schristos		}
10111.41Schristos		touch $@
10121.34Schristos
10131.40SchristosTRADITIONAL_ASC = \
10141.40Schristos  tzcode$(VERSION).tar.gz.asc \
10151.40Schristos  tzdata$(VERSION).tar.gz.asc
10161.41SchristosREARGUARD_ASC = \
10171.41Schristos  tzdata$(VERSION)-rearguard.tar.gz.asc
10181.41SchristosALL_ASC = $(TRADITIONAL_ASC) $(REARGUARD_ASC) \
10191.40Schristos  tzdb-$(VERSION).tar.lz.asc
10201.40Schristos
10211.41Schristostarballs rearguard_tarballs traditional_tarballs \
10221.41Schristossignatures rearguard_signatures traditional_signatures: \
10231.41Schristos  version set-timestamps.out rearguard.zi
10241.35Schristos		VERSION=`cat version` && \
10251.35Schristos		$(MAKE) VERSION="$$VERSION" $@_version
10261.35Schristos
10271.40Schristos# These *_version rules are intended for use if VERSION is set by some
10281.40Schristos# other means.  Ordinarily these rules are used only by the above
10291.40Schristos# non-_version rules, which set VERSION on the 'make' command line.
10301.41Schristostarballs_version: traditional_tarballs_version rearguard_tarballs_version \
10311.40Schristos  tzdb-$(VERSION).tar.lz
10321.41Schristosrearguard_tarballs_version: \
10331.41Schristos  tzdata$(VERSION)-rearguard.tar.gz
10341.38Schristostraditional_tarballs_version: \
10351.38Schristos  tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz
10361.40Schristossignatures_version: $(ALL_ASC)
10371.41Schristosrearguard_signatures_version: $(REARGUARD_ASC)
10381.40Schristostraditional_signatures_version: $(TRADITIONAL_ASC)
10391.9Schristos
10401.16Schristostzcode$(VERSION).tar.gz: set-timestamps.out
10411.6Schristos		LC_ALL=C && export LC_ALL && \
10421.7Schristos		tar $(TARFLAGS) -cf - \
10431.23Schristos		    $(COMMON) $(DOCS) $(SOURCES) | \
10441.38Schristos		  gzip $(GZIPFLAGS) >$@.out
10451.35Schristos		mv $@.out $@
10461.10Schristos
10471.16Schristostzdata$(VERSION).tar.gz: set-timestamps.out
10481.6Schristos		LC_ALL=C && export LC_ALL && \
10491.23Schristos		tar $(TARFLAGS) -cf - $(COMMON) $(DATA) $(MISC) | \
10501.38Schristos		  gzip $(GZIPFLAGS) >$@.out
10511.35Schristos		mv $@.out $@
10521.9Schristos
10531.40Schristostzdata$(VERSION)-rearguard.tar.gz: rearguard.zi set-timestamps.out
10541.40Schristos		rm -fr tzdata$(VERSION)-rearguard.dir
10551.40Schristos		mkdir tzdata$(VERSION)-rearguard.dir
10561.40Schristos		ln $(COMMON) $(DATA) $(MISC) tzdata$(VERSION)-rearguard.dir
10571.40Schristos		cd tzdata$(VERSION)-rearguard.dir && \
10581.40Schristos		  rm -f $(TDATA) $(PACKRATDATA) version
10591.40Schristos		for f in $(TDATA) $(PACKRATDATA); do \
10601.40Schristos		  rearf=tzdata$(VERSION)-rearguard.dir/$$f; \
10611.40Schristos		  $(AWK) -v DATAFORM=rearguard -f ziguard.awk $$f >$$rearf && \
10621.40Schristos		  touch -cmr `ls -t ziguard.awk $$f` $$rearf || exit; \
10631.40Schristos		done
10641.40Schristos		sed '1s/$$/-rearguard/' \
10651.40Schristos		  <version >tzdata$(VERSION)-rearguard.dir/version
10661.40Schristos		touch -cmr version tzdata$(VERSION)-rearguard.dir/version
10671.40Schristos		LC_ALL=C && export LC_ALL && \
10681.40Schristos		  (cd tzdata$(VERSION)-rearguard.dir && \
10691.40Schristos		   tar $(TARFLAGS) -cf - $(COMMON) $(DATA) $(MISC) | \
10701.40Schristos		     gzip $(GZIPFLAGS)) >$@.out
10711.40Schristos		mv $@.out $@
10721.40Schristos
10731.41Schristostzdb-$(VERSION).tar.lz: set-timestamps.out set-tzs-timestamp.out
10741.34Schristos		rm -fr tzdb-$(VERSION)
10751.34Schristos		mkdir tzdb-$(VERSION)
10761.34Schristos		ln $(ENCHILADA) tzdb-$(VERSION)
10771.35Schristos		touch -cmr `ls -t tzdb-$(VERSION)/* | sed 1q` tzdb-$(VERSION)
10781.34Schristos		LC_ALL=C && export LC_ALL && \
10791.35Schristos		tar $(TARFLAGS) -cf - tzdb-$(VERSION) | lzip -9 >$@.out
10801.35Schristos		mv $@.out $@
10811.9Schristos
10821.9Schristostzcode$(VERSION).tar.gz.asc: tzcode$(VERSION).tar.gz
10831.9Schristostzdata$(VERSION).tar.gz.asc: tzdata$(VERSION).tar.gz
10841.40Schristostzdata$(VERSION)-rearguard.tar.gz.asc: tzdata$(VERSION)-rearguard.tar.gz
10851.34Schristostzdb-$(VERSION).tar.lz.asc: tzdb-$(VERSION).tar.lz
10861.40Schristos$(ALL_ASC):
10871.44Schristos		$(GPG) --armor --detach-sign $?
10881.34Schristos
10891.41SchristosTYPECHECK_CFLAGS = $(CFLAGS) -DTYPECHECK -D__time_t_defined -D_TIME_T
10901.41Schristostypecheck: typecheck_long_long typecheck_unsigned
10911.41Schristostypecheck_long_long typecheck_unsigned: $(VERSION_DEPS)
10921.41Schristos		rm -fr $@.dir
10931.41Schristos		mkdir $@.dir
10941.41Schristos		ln $(VERSION_DEPS) $@.dir
10951.41Schristos		cd $@.dir && \
10961.41Schristos		  case $@ in \
10971.41Schristos		    *_long_long) i="long long";; \
10981.41Schristos		    *_unsigned ) i="unsigned" ;; \
10991.41Schristos		  esac && \
11001.41Schristos		  typecheck_cflags='' && \
11011.41Schristos		  $(MAKE) \
11021.41Schristos		    CFLAGS="$(TYPECHECK_CFLAGS) \"-Dtime_t=$$i\"" \
11031.41Schristos		    TOPDIR="`pwd`" \
11041.41Schristos		    install
11051.41Schristos		$@.dir/zdump -i -c 1970,1971 Europe/Rome
11061.41Schristos		touch $@
11071.1Smlelstv
11081.38Schristoszonenames:	tzdata.zi
11091.38Schristos		@$(AWK) '/^Z/ { print $$2 } /^L/ { print $$3 }' tzdata.zi
11101.1Smlelstv
11111.1Smlelstvasctime.o:	private.h tzfile.h
11121.1Smlelstvdate.o:		private.h
11131.1Smlelstvdifftime.o:	private.h
11141.1Smlelstvlocaltime.o:	private.h tzfile.h
11151.23Schristosstrftime.o:	private.h tzfile.h
11161.6Schristoszdump.o:	version.h
11171.6Schristoszic.o:		private.h tzfile.h version.h
11181.1Smlelstv
11191.1Smlelstv.KEEP_STATE:
11201.22Schristos
11211.22Schristos.PHONY: ALL INSTALL all
11221.41Schristos.PHONY: check check_time_t_alternatives
11231.42Schristos.PHONY: check_web check_zishrink
11241.40Schristos.PHONY: clean clean_misc dummy.zd force_tzs
11251.32Schristos.PHONY: install install_data maintainer-clean names
11261.41Schristos.PHONY: posix_only posix_packrat posix_right public
11271.41Schristos.PHONY: rearguard_signatures rearguard_signatures_version
11281.41Schristos.PHONY: rearguard_tarballs rearguard_tarballs_version
11291.41Schristos.PHONY: right_only right_posix signatures signatures_version
11301.40Schristos.PHONY: tarballs tarballs_version
11311.40Schristos.PHONY: traditional_signatures traditional_signatures_version
11321.40Schristos.PHONY: traditional_tarballs traditional_tarballs_version
11331.40Schristos.PHONY: typecheck
11341.22Schristos.PHONY: zonenames zones
11351.40Schristos.PHONY: $(ZDS)
1136