Makefile revision 1.55
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.46Schristos# Rearguard users might also want "ZFLAGS = -b fat"; see below. 261.40SchristosDATAFORM= main 271.40Schristos 281.41Schristos# Change the line below for your timezone (after finding the one you want in 291.41Schristos# one of the $(TDATA) source files, or adding it to a source file). 301.41Schristos# Alternatively, if you discover you've got the wrong timezone, you can just 311.46Schristos# 'zic -l -' to remove it, or 'zic -l rightzone' to change it. 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.51SchristosLOCALTIME= Factory 371.1Smlelstv 381.55Schristos# The POSIXRULES macro controls interpretation of POSIX-like TZ 391.55Schristos# settings like TZ='EET-2EEST' that lack DST transition rules. 401.46Schristos# If POSIXRULES is '-', no template is installed; this is the default. 411.46Schristos# Any other value for POSIXRULES is obsolete and should not be relied on, as: 421.44Schristos# * It does not work correctly in popular implementations such as GNU/Linux. 431.49Schristos# * It does not work even in tzcode, except for historical timestamps 441.49Schristos# that precede the last explicit transition in the POSIXRULES file. 451.49Schristos# Hence it typically does not work for current and future timestamps. 461.46Schristos# If, despite the above, you want a template for handling these settings, 471.46Schristos# you can change the line below (after finding the timezone you want in the 481.46Schristos# one of the $(TDATA) source files, or adding it to a source file). 491.46Schristos# Alternatively, if you discover you've got the wrong timezone, you can just 501.46Schristos# 'zic -p -' to remove it, or 'zic -p rightzone' to change it. 511.46Schristos# Use the command 521.46Schristos# make zonenames 531.46Schristos# to get a list of the values you can use for POSIXRULES. 541.1Smlelstv 551.46SchristosPOSIXRULES= - 561.1Smlelstv 571.1Smlelstv# Also see TZDEFRULESTRING below, which takes effect only 581.55Schristos# if POSIXRULES is '-' or if the template file cannot be accessed. 591.1Smlelstv 601.1Smlelstv 611.39Schristos# Installation locations. 621.39Schristos# 631.39Schristos# The defaults are suitable for Debian, except that if REDO is 641.39Schristos# posix_right or right_posix then files that Debian puts under 651.39Schristos# /usr/share/zoneinfo/posix and /usr/share/zoneinfo/right are instead 661.39Schristos# put under /usr/share/zoneinfo-posix and /usr/share/zoneinfo-leaps, 671.39Schristos# respectively. Problems with the Debian approach are discussed in 681.39Schristos# the commentary for the right_posix rule (below). 691.39Schristos 701.39Schristos# Destination directory, which can be used for staging. 711.39Schristos# 'make DESTDIR=/stage install' installs under /stage (e.g., to 721.39Schristos# /stage/etc/localtime instead of to /etc/localtime). Files under 731.39Schristos# /stage are not intended to work as-is, but can be copied by hand to 741.39Schristos# the root directory later. If DESTDIR is empty, 'make install' does 751.39Schristos# not stage, but installs directly into production locations. 761.39SchristosDESTDIR = 771.39Schristos 781.39Schristos# Everything is installed into subdirectories of TOPDIR, and used there. 791.39Schristos# TOPDIR should be empty (meaning the root directory), 801.39Schristos# or a directory name that does not end in "/". 811.39Schristos# TOPDIR should be empty or an absolute name unless you're just testing. 821.39SchristosTOPDIR = 831.39Schristos 841.41Schristos# The default local timezone is taken from the file TZDEFAULT. 851.39SchristosTZDEFAULT = $(TOPDIR)/etc/localtime 861.39Schristos 871.39Schristos# The subdirectory containing installed program and data files, and 881.39Schristos# likewise for installed files that can be shared among architectures. 891.39Schristos# These should be relative file names. 901.39SchristosUSRDIR = usr 911.39SchristosUSRSHAREDIR = $(USRDIR)/share 921.1Smlelstv 931.41Schristos# "Compiled" timezone information is placed in the "TZDIR" directory 941.1Smlelstv# (and subdirectories). 951.38Schristos# TZDIR_BASENAME should not contain "/" and should not be ".", ".." or empty. 961.15SchristosTZDIR_BASENAME= zoneinfo 971.39SchristosTZDIR = $(TOPDIR)/$(USRSHAREDIR)/$(TZDIR_BASENAME) 981.1Smlelstv 991.39Schristos# The "tzselect" and (if you do "make INSTALL") "date" commands go in: 1001.39SchristosBINDIR = $(TOPDIR)/$(USRDIR)/bin 1011.1Smlelstv 1021.39Schristos# The "zdump" command goes in: 1031.39SchristosZDUMPDIR = $(BINDIR) 1041.1Smlelstv 1051.39Schristos# The "zic" command goes in: 1061.39SchristosZICDIR = $(TOPDIR)/$(USRDIR)/sbin 1071.1Smlelstv 1081.1Smlelstv# Manual pages go in subdirectories of. . . 1091.39SchristosMANDIR = $(TOPDIR)/$(USRSHAREDIR)/man 1101.1Smlelstv 1111.39Schristos# Library functions are put in an archive in LIBDIR. 1121.39SchristosLIBDIR = $(TOPDIR)/$(USRDIR)/lib 1131.1Smlelstv 1141.1Smlelstv 1151.41Schristos# Types to try, as an alternative to time_t. 1161.41SchristosTIME_T_ALTERNATIVES = $(TIME_T_ALTERNATIVES_HEAD) $(TIME_T_ALTERNATIVES_TAIL) 1171.49SchristosTIME_T_ALTERNATIVES_HEAD = int_least64_t 1181.49SchristosTIME_T_ALTERNATIVES_TAIL = int_least32_t uint_least32_t uint_least64_t 1191.1Smlelstv 1201.43Schristos# What kind of TZif data files to generate. (TZif is the binary time 1211.43Schristos# zone data format that zic generates; see Internet RFC 8536.) 1221.37Schristos# If you want only POSIX time, with time values interpreted as 1231.37Schristos# seconds since the epoch (not counting leap seconds), use 1241.1Smlelstv# REDO= posix_only 1251.38Schristos# below. If you want only "right" time, with values interpreted 1261.37Schristos# as seconds since the epoch (counting leap seconds), use 1271.1Smlelstv# REDO= right_only 1281.1Smlelstv# below. If you want both sets of data available, with leap seconds not 1291.1Smlelstv# counted normally, use 1301.1Smlelstv# REDO= posix_right 1311.1Smlelstv# below. If you want both sets of data available, with leap seconds counted 1321.1Smlelstv# normally, use 1331.1Smlelstv# REDO= right_posix 1341.32Schristos# below. POSIX mandates that leap seconds not be counted; for compatibility 1351.37Schristos# with it, use "posix_only" or "posix_right". Use POSIX time on systems with 1361.37Schristos# leap smearing; this can work better than unsmeared "right" time with 1371.37Schristos# applications that are not leap second aware, and is closer to unsmeared 1381.37Schristos# "right" time than unsmeared POSIX time is (e.g., 0.5 vs 1.0 s max error). 1391.1Smlelstv 1401.1SmlelstvREDO= posix_right 1411.1Smlelstv 1421.45Schristos# Whether to put an "Expires" line in the leapseconds file. 1431.45Schristos# Use EXPIRES_LINE=1 to put the line in, 0 to omit it. 1441.45Schristos# The EXPIRES_LINE value matters only if REDO's value contains "right". 1451.45Schristos# If you change EXPIRES_LINE, remove the leapseconds file before running "make". 1461.45Schristos# zic's support for the Expires line was introduced in tzdb 2020a, 1471.49Schristos# and was modified in tzdb 2021b to generate version 4 TZif files. 1481.49Schristos# EXPIRES_LINE defaults to 0 for now so that the leapseconds file 1491.49Schristos# can be given to pre-2020a zic implementations and so that TZif files 1501.49Schristos# built by newer zic implementations can be read by pre-2021b libraries. 1511.45SchristosEXPIRES_LINE= 0 1521.45Schristos 1531.41Schristos# To install data in text form that has all the information of the TZif data, 1541.38Schristos# (optionally incorporating leap second information), use 1551.38Schristos# TZDATA_TEXT= tzdata.zi leapseconds 1561.38Schristos# To install text data without leap second information (e.g., because 1571.38Schristos# REDO='posix_only'), use 1581.38Schristos# TZDATA_TEXT= tzdata.zi 1591.38Schristos# To avoid installing text data, use 1601.38Schristos# TZDATA_TEXT= 1611.38Schristos 1621.38SchristosTZDATA_TEXT= leapseconds tzdata.zi 1631.38Schristos 1641.38Schristos# For backward-compatibility links for old zone names, use 1651.39Schristos# BACKWARD= backward 1661.38Schristos# To omit these links, use 1671.38Schristos# BACKWARD= 1681.38Schristos 1691.39SchristosBACKWARD= backward 1701.38Schristos 1711.51Schristos# If you want out-of-scope and often-wrong data from the file 'backzone', 1721.51Schristos# but only for entries listed in the backward-compatibility file zone.tab, use 1731.32Schristos# PACKRATDATA= backzone 1741.51Schristos# PACKRATLIST= zone.tab 1751.51Schristos# If you want all the 'backzone' data, use 1761.51Schristos# PACKRATDATA= backzone 1771.51Schristos# PACKRATLIST= 1781.32Schristos# To omit this data, use 1791.32Schristos# PACKRATDATA= 1801.51Schristos# PACKRATLIST= 1811.32Schristos 1821.32SchristosPACKRATDATA= 1831.51SchristosPACKRATLIST= 1841.32Schristos 1851.38Schristos# The name of a locale using the UTF-8 encoding, used during self-tests. 1861.38Schristos# The tests are skipped if the name does not appear to work on this system. 1871.38Schristos 1881.38SchristosUTF8_LOCALE= en_US.utf8 1891.38Schristos 1901.1Smlelstv# Non-default libraries needed to link. 1911.54Schristos# On some hosts, this should have -lintl unless CFLAGS has -DHAVE_GETTEXT=0. 1921.1SmlelstvLDLIBS= 1931.1Smlelstv 1941.38Schristos# Add the following to the end of the "CFLAGS=" line as needed to override 1951.38Schristos# defaults specified in the source code. "-DFOO" is equivalent to "-DFOO=1". 1961.38Schristos# -DDEPRECATE_TWO_DIGIT_YEARS for optional runtime warnings about strftime 1971.38Schristos# formats that generate only the last two digits of year numbers 1981.38Schristos# -DEPOCH_LOCAL if the 'time' function returns local time not UT 1991.38Schristos# -DEPOCH_OFFSET=N if the 'time' function returns a value N greater 2001.38Schristos# than what POSIX specifies, assuming local time is UT. 2011.38Schristos# For example, N is 252460800 on AmigaOS. 2021.32Schristos# -DHAVE_DECL_ASCTIME_R=0 if <time.h> does not declare asctime_r 2031.38Schristos# -DHAVE_DECL_ENVIRON if <unistd.h> declares 'environ' 2041.54Schristos# -DHAVE_DECL_TIMEGM=0 if <time.h> does not declare timegm 2051.32Schristos# -DHAVE_DIRECT_H if mkdir needs <direct.h> (MS-Windows) 2061.55Schristos# -DHAVE__GENERIC=0 if _Generic does not work* 2071.54Schristos# -DHAVE_GETRANDOM if getrandom works (e.g., GNU/Linux), 2081.54Schristos# -DHAVE_GETRANDOM=0 to avoid using getrandom 2091.54Schristos# -DHAVE_GETTEXT if gettext works (e.g., GNU/Linux, FreeBSD, Solaris), 2101.54Schristos# where LDLIBS also needs to contain -lintl on some hosts; 2111.54Schristos# -DHAVE_GETTEXT=0 to avoid using gettext 2121.38Schristos# -DHAVE_INCOMPATIBLE_CTIME_R if your system's time.h declares 2131.35Schristos# ctime_r and asctime_r incompatibly with the POSIX standard 2141.35Schristos# (Solaris when _POSIX_PTHREAD_SEMANTICS is not defined). 2151.55Schristos# -DHAVE_INTTYPES_H=0 if <inttypes.h> does not work*+ 2161.16Schristos# -DHAVE_LINK=0 if your system lacks a link function 2171.23Schristos# -DHAVE_LOCALTIME_R=0 if your system lacks a localtime_r function 2181.23Schristos# -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz 2191.23Schristos# localtime_rz can make zdump significantly faster, but is nonstandard. 2201.49Schristos# -DHAVE_MALLOC_ERRNO=0 if malloc etc. do not set errno on failure. 2211.32Schristos# -DHAVE_POSIX_DECLS=0 if your system's include files do not declare 2221.32Schristos# functions like 'link' or variables like 'tzname' required by POSIX 2231.53Schristos# -DHAVE_SETENV=0 if your system lacks the setenv function 2241.55Schristos# -DHAVE_SNPRINTF=0 if your system lacks the snprintf function+ 2251.54Schristos# -DHAVE_STDCKDINT_H=0 if neither <stdckdint.h> nor substitutes like 2261.54Schristos# __builtin_add_overflow work* 2271.55Schristos# -DHAVE_STDINT_H=0 if <stdint.h> does not work*+ 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.55Schristos# -DHAVE_STRTOLL=0 if your system lacks the strtoll function+ 2311.1Smlelstv# -DHAVE_SYMLINK=0 if your system lacks the symlink function 2321.54Schristos# -DHAVE_SYS_STAT_H=0 if <sys/stat.h> does not work* 2331.23Schristos# -DHAVE_TZSET=0 if your system lacks a tzset function 2341.54Schristos# -DHAVE_UNISTD_H=0 if <unistd.h> does not work* 2351.54Schristos# -DHAVE_UTMPX_H=0 if <utmpx.h> does not work* 2361.38Schristos# -Dlocale_t=XXX if your system uses XXX instead of locale_t 2371.55Schristos# -DPORT_TO_C89 if tzcode should also run on C89 platforms+ 2381.40Schristos# -DRESERVE_STD_EXT_IDS if your platform reserves standard identifiers 2391.40Schristos# with external linkage, e.g., applications cannot define 'localtime'. 2401.38Schristos# -Dssize_t=long on hosts like MS-Windows that lack ssize_t 2411.55Schristos# -DSUPPORT_C89 if the tzcode library should support C89 callers+ 2421.40Schristos# -DSUPPRESS_TZDIR to not prepend TZDIR to file names; this has 2431.40Schristos# security implications and is not recommended for general use 2441.38Schristos# -DTHREAD_SAFE to make localtime.c thread-safe, as POSIX requires; 2451.23Schristos# not needed by the main-program tz code, which is single-threaded. 2461.23Schristos# Append other compiler flags as needed, e.g., -pthread on GNU/Linux. 2471.14Schristos# -Dtime_tz=\"T\" to use T as the time_t type, rather than the system time_t 2481.38Schristos# This is intended for internal use only; it mangles external names. 2491.1Smlelstv# -DTZ_DOMAIN=\"foo\" to use "foo" for gettext domain name; default is "tz" 2501.22Schristos# -DTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory; 2511.1Smlelstv# the default is system-supplied, typically "/usr/lib/locale" 2521.14Schristos# -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified 2531.55Schristos# DST transitions for POSIX-style TZ strings lacking them, 2541.55Schristos# in the usual case where POSIXRULES is '-'. If not specified, 2551.55Schristos# TZDEFRULESTRING defaults to US rules for future DST transitions. 2561.55Schristos# This mishandles some past timestamps, as US DST rules have changed. 2571.55Schristos# It also mishandles settings like TZ='EET-2EEST' for eastern Europe, 2581.55Schristos# as Europe and US DST rules differ. 2591.55Schristos# -DTZNAME_MAXIMUM=N to limit time zone abbreviations to N bytes (default 255) 2601.38Schristos# -DUNINIT_TRAP if reading uninitialized storage can cause problems 2611.23Schristos# other than simply getting garbage data 2621.23Schristos# -DUSE_LTZ=0 to build zdump with the system time zone library 2631.23Schristos# Also set TZDOBJS=zdump.o and CHECK_TIME_T_ALTERNATIVES= below. 2641.46Schristos# -DZIC_BLOAT_DEFAULT=\"fat\" to default zic's -b option to "fat", and 2651.46Schristos# similarly for "slim". Fat TZif files work around incompatibilities 2661.53Schristos# and bugs in some TZif readers, notably older ones that 2671.53Schristos# ignore or otherwise mishandle 64-bit data in TZif files; 2681.53Schristos# however, fat TZif files may trigger bugs in newer TZif readers. 2691.53Schristos# Slim TZif files are more efficient, and are the default. 2701.1Smlelstv# -DZIC_MAX_ABBR_LEN_WO_WARN=3 2711.1Smlelstv# (or some other number) to set the maximum time zone abbreviation length 2721.1Smlelstv# that zic will accept without a warning (the default is 6) 2731.30Schristos# $(GCC_DEBUG_FLAGS) if you are using recent GCC and want lots of checking 2741.53Schristos# 2751.53Schristos# * Options marked "*" can be omitted if your compiler is C23 compatible. 2761.55Schristos# * Options marked "+" are obsolescent and are planned to be removed 2771.55Schristos# once the code assumes C99 or later. 2781.53Schristos# 2791.38Schristos# Select instrumentation via "make GCC_INSTRUMENT='whatever'". 2801.38SchristosGCC_INSTRUMENT = \ 2811.38Schristos -fsanitize=undefined -fsanitize-address-use-after-scope \ 2821.38Schristos -fsanitize-undefined-trap-on-error -fstack-protector 2831.49Schristos# Omit -fanalyzer from GCC_DEBUG_FLAGS, as it makes GCC too slow. 2841.38SchristosGCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ 2851.38Schristos $(GCC_INSTRUMENT) \ 2861.38Schristos -Wall -Wextra \ 2871.38Schristos -Walloc-size-larger-than=100000 -Warray-bounds=2 \ 2881.51Schristos -Wbad-function-cast -Wbidi-chars=any,ucn -Wcast-align=strict -Wdate-time \ 2891.38Schristos -Wdeclaration-after-statement -Wdouble-promotion \ 2901.49Schristos -Wduplicated-branches -Wduplicated-cond \ 2911.38Schristos -Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation \ 2921.54Schristos -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op \ 2931.38Schristos -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ 2941.49Schristos -Wnull-dereference \ 2951.38Schristos -Wold-style-definition -Woverlength-strings -Wpointer-arith \ 2961.49Schristos -Wshadow -Wshift-overflow=2 -Wstrict-overflow \ 2971.49Schristos -Wstrict-prototypes -Wstringop-overflow=4 \ 2981.40Schristos -Wstringop-truncation -Wsuggest-attribute=cold \ 2991.38Schristos -Wsuggest-attribute=const -Wsuggest-attribute=format \ 3001.40Schristos -Wsuggest-attribute=malloc \ 3011.38Schristos -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure \ 3021.51Schristos -Wtrampolines -Wundef -Wuninitialized -Wunused-macros -Wuse-after-free=3 \ 3031.38Schristos -Wvariadic-macros -Wvla -Wwrite-strings \ 3041.38Schristos -Wno-address -Wno-format-nonliteral -Wno-sign-compare \ 3051.54Schristos -Wno-type-limits 3061.1Smlelstv# 3071.1Smlelstv# If your system has a "GMT offset" field in its "struct tm"s 3081.1Smlelstv# (or if you decide to add such a field in your system's "time.h" file), 3091.1Smlelstv# add the name to a define such as 3101.1Smlelstv# -DTM_GMTOFF=tm_gmtoff 3111.23Schristos# to the end of the "CFLAGS=" line. If not defined, the code attempts to 3121.23Schristos# guess TM_GMTOFF from other macros; define NO_TM_GMTOFF to suppress this. 3131.23Schristos# Similarly, if your system has a "zone abbreviation" field, define 3141.1Smlelstv# -DTM_ZONE=tm_zone 3151.52Schristos# and define NO_TM_ZONE to suppress any guessing. Although these two fields 3161.52Schristos# not required by POSIX, a future version of POSIX is planned to require them 3171.52Schristos# and they are widely available on GNU/Linux and BSD systems. 3181.1Smlelstv# 3191.38Schristos# The next batch of options control support for external variables 3201.38Schristos# exported by tzcode. In practice these variables are less useful 3211.38Schristos# than TM_GMTOFF and TM_ZONE. However, most of them are standardized. 3221.38Schristos# # 3231.38Schristos# # To omit or support the external variable "tzname", add one of: 3241.45Schristos# # -DHAVE_TZNAME=0 # do not support "tzname" 3251.45Schristos# # -DHAVE_TZNAME=1 # support "tzname", which is defined by system library 3261.45Schristos# # -DHAVE_TZNAME=2 # support and define "tzname" 3271.38Schristos# # to the "CFLAGS=" line. "tzname" is required by POSIX 1988 and later. 3281.38Schristos# # If not defined, the code attempts to guess HAVE_TZNAME from other macros. 3291.38Schristos# # Warning: unless time_tz is also defined, HAVE_TZNAME=1 can cause 3301.38Schristos# # crashes when combined with some platforms' standard libraries, 3311.38Schristos# # presumably due to memory allocation issues. 3321.38Schristos# # 3331.38Schristos# # To omit or support the external variables "timezone" and "daylight", add 3341.45Schristos# # -DUSG_COMPAT=0 # do not support 3351.45Schristos# # -DUSG_COMPAT=1 # support, and variables are defined by system library 3361.45Schristos# # -DUSG_COMPAT=2 # support and define variables 3371.38Schristos# # to the "CFLAGS=" line; "timezone" and "daylight" are inspired by 3381.38Schristos# # Unix Systems Group code and are required by POSIX 2008 (with XSI) and later. 3391.38Schristos# # If not defined, the code attempts to guess USG_COMPAT from other macros. 3401.38Schristos# # 3411.38Schristos# # To support the external variable "altzone", add 3421.45Schristos# # -DALTZONE=0 # do not support 3431.45Schristos# # -DALTZONE=1 # support "altzone", which is defined by system library 3441.45Schristos# # -DALTZONE=2 # support and define "altzone" 3451.38Schristos# # to the end of the "CFLAGS=" line; although "altzone" appeared in 3461.38Schristos# # System V Release 3.1 it has not been standardized. 3471.45Schristos# # If not defined, the code attempts to guess ALTZONE from other macros. 3481.38Schristos# 3491.1Smlelstv# If you want functions that were inspired by early versions of X3J11's work, 3501.1Smlelstv# add 3511.1Smlelstv# -DSTD_INSPIRED 3521.54Schristos# to the end of the "CFLAGS=" line. This arranges for the following 3531.54Schristos# functions to be added to the time conversion library. 3541.1Smlelstv# "offtime" is like "gmtime" except that it accepts a second (long) argument 3551.1Smlelstv# that gives an offset to add to the time_t when converting it. 3561.1Smlelstv# "timelocal" is equivalent to "mktime". 3571.1Smlelstv# "timeoff" is like "timegm" except that it accepts a second (long) argument 3581.1Smlelstv# that gives an offset to use when converting to a time_t. 3591.1Smlelstv# "posix2time" and "time2posix" are described in an included manual page. 3601.1Smlelstv# X3J11's work does not describe any of these functions. 3611.1Smlelstv# These functions may well disappear in future releases of the time 3621.1Smlelstv# conversion package. 3631.1Smlelstv# 3641.23Schristos# If you don't want functions that were inspired by NetBSD, add 3651.23Schristos# -DNETBSD_INSPIRED=0 3661.23Schristos# to the end of the "CFLAGS=" line. Otherwise, the functions 3671.23Schristos# "localtime_rz", "mktime_z", "tzalloc", and "tzfree" are added to the 3681.55Schristos# time library, and if STD_INSPIRED is also defined to nonzero the functions 3691.23Schristos# "posix2time_z" and "time2posix_z" are added as well. 3701.23Schristos# The functions ending in "_z" (or "_rz") are like their unsuffixed 3711.23Schristos# (or suffixed-by-"_r") counterparts, except with an extra first 3721.41Schristos# argument of opaque type timezone_t that specifies the timezone. 3731.23Schristos# "tzalloc" allocates a timezone_t value, and "tzfree" frees it. 3741.23Schristos# 3751.1Smlelstv# If you want to allocate state structures in localtime, add 3761.1Smlelstv# -DALL_STATE 3771.1Smlelstv# to the end of the "CFLAGS=" line. Storage is obtained by calling malloc. 3781.1Smlelstv# 3791.1Smlelstv# NIST-PCTS:151-2, Version 1.4, (1993-12-03) is a test suite put 3801.1Smlelstv# out by the National Institute of Standards and Technology 3811.1Smlelstv# which claims to test C and Posix conformance. If you want to pass PCTS, add 3821.1Smlelstv# -DPCTS 3831.1Smlelstv# to the end of the "CFLAGS=" line. 3841.1Smlelstv# 3851.1Smlelstv# If you want strict compliance with XPG4 as of 1994-04-09, add 3861.1Smlelstv# -DXPG4_1994_04_09 3871.1Smlelstv# to the end of the "CFLAGS=" line. This causes "strftime" to always return 3881.38Schristos# 53 as a week number (rather than 52 or 53) for January days before 3891.38Schristos# January's first Monday when a "%V" format is used and January 1 3901.1Smlelstv# falls on a Friday, Saturday, or Sunday. 3911.1Smlelstv 3921.1SmlelstvCFLAGS= 3931.1Smlelstv 3941.9Schristos# Linker flags. Default to $(LFLAGS) for backwards compatibility 3951.34Schristos# to release 2012h and earlier. 3961.9Schristos 3971.9SchristosLDFLAGS= $(LFLAGS) 3981.1Smlelstv 3991.32Schristos# For leap seconds, this Makefile uses LEAPSECONDS='-L leapseconds' in 4001.32Schristos# submake command lines. The default is no leap seconds. 4011.32Schristos 4021.32SchristosLEAPSECONDS= 4031.32Schristos 4041.32Schristos# The zic command and its arguments. 4051.32Schristos 4061.1Smlelstvzic= ./zic 4071.1SmlelstvZIC= $(zic) $(ZFLAGS) 4081.1Smlelstv 4091.43Schristos# To shrink the size of installed TZif files, 4101.43Schristos# append "-r @N" to omit data before N-seconds-after-the-Epoch. 4111.53Schristos# To grow the files and work around bugs in older applications, 4121.53Schristos# possibly at the expense of introducing bugs in newer ones, 4131.53Schristos# append "-b fat"; see ZIC_BLOAT_DEFAULT above. 4141.44Schristos# See the zic man page for more about -b and -r. 4151.15SchristosZFLAGS= 4161.15Schristos 4171.41Schristos# How to use zic to install TZif files. 4181.32Schristos 4191.39SchristosZIC_INSTALL= $(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS) 4201.32Schristos 4211.22Schristos# The name of a Posix-compliant 'awk' on your system. 4221.50Schristos# mawk 1.3.3 and Solaris 10 /usr/bin/awk do not work. 4231.50Schristos# Also, it is better (though not essential) if 'awk' supports UTF-8, 4241.50Schristos# and unfortunately mawk and busybox awk do not support UTF-8. 4251.50Schristos# Try AWK=gawk or AWK=nawk if your awk has the abovementioned problems. 4261.9SchristosAWK= awk 4271.9Schristos 4281.16Schristos# The full path name of a Posix-compliant shell, preferably one that supports 4291.16Schristos# the Korn shell's 'select' statement as an extension. 4301.16Schristos# These days, Bash is the most popular. 4311.16Schristos# It should be OK to set this to /bin/sh, on platforms where /bin/sh 4321.16Schristos# lacks 'select' or doesn't completely conform to Posix, but /bin/bash 4331.16Schristos# is typically nicer if it works. 4341.9SchristosKSHELL= /bin/bash 4351.1Smlelstv 4361.42Schristos# Name of curl <https://curl.haxx.se/>, used for HTML validation. 4371.42SchristosCURL= curl 4381.42Schristos 4391.44Schristos# Name of GNU Privacy Guard <https://gnupg.org/>, used to sign distributions. 4401.44SchristosGPG= gpg 4411.44Schristos 4421.23Schristos# This expensive test requires USE_LTZ. 4431.23Schristos# To suppress it, define this macro to be empty. 4441.23SchristosCHECK_TIME_T_ALTERNATIVES = check_time_t_alternatives 4451.23Schristos 4461.22Schristos# SAFE_CHAR is a regular expression that matches a safe character. 4471.22Schristos# Some parts of this distribution are limited to safe characters; 4481.22Schristos# others can use any UTF-8 character. 4491.22Schristos# For now, the safe characters are a safe subset of ASCII. 4501.9Schristos# The caller must set the shell variable 'sharp' to the character '#', 4511.9Schristos# since Makefile macros cannot contain '#'. 4521.9Schristos# TAB_CHAR is a single tab character, in single quotes. 4531.9SchristosTAB_CHAR= ' ' 4541.22SchristosSAFE_CHARSET1= $(TAB_CHAR)' !\"'$$sharp'$$%&'\''()*+,./0123456789:;<=>?@' 4551.22SchristosSAFE_CHARSET2= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\^_`' 4561.22SchristosSAFE_CHARSET3= 'abcdefghijklmnopqrstuvwxyz{|}~' 4571.29SchristosSAFE_CHARSET= $(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3) 4581.29SchristosSAFE_CHAR= '[]'$(SAFE_CHARSET)'-]' 4591.29Schristos 4601.55Schristos# These non-alphabetic, non-ASCII printable characters are Latin-1, 4611.55Schristos# and so are likely displayable even in editors like XEmacs 21 4621.55Schristos# that have limited display capabilities. 4631.55SchristosUNUSUAL_OK_LATIN_1 = ¡¢£¤¥¦§¨©«¬®¯°±²³´¶·¸¹»¼½¾¿×÷ 4641.40Schristos# Non-ASCII non-letters that OK_CHAR allows, as these characters are 4651.41Schristos# useful in commentary. 4661.55SchristosUNUSUAL_OK_CHARSET= $(UNUSUAL_OK_LATIN_1) 4671.40Schristos 4681.51Schristos# Put this in a bracket expression to match spaces. 4691.51Schristoss = [:space:] 4701.51Schristos 4711.29Schristos# OK_CHAR matches any character allowed in the distributed files. 4721.40Schristos# This is the same as SAFE_CHAR, except that UNUSUAL_OK_CHARSET and 4731.40Schristos# multibyte letters are also allowed so that commentary can contain a 4741.40Schristos# few safe symbols and people's names and can quote non-English sources. 4751.40Schristos# Other non-letters are limited to ASCII renderings for the 4761.40Schristos# convenience of maintainers using XEmacs 21.5.34, which by default 4771.40Schristos# mishandles Unicode characters U+0100 and greater. 4781.40SchristosOK_CHAR= '[][:alpha:]$(UNUSUAL_OK_CHARSET)'$(SAFE_CHARSET)'-]' 4791.22Schristos 4801.22Schristos# SAFE_LINE matches a line of safe characters. 4811.29Schristos# SAFE_SHARP_LINE is similar, except any OK character can follow '#'; 4821.22Schristos# this is so that comments can contain non-ASCII characters. 4831.29Schristos# OK_LINE matches a line of OK characters. 4841.22SchristosSAFE_LINE= '^'$(SAFE_CHAR)'*$$' 4851.29SchristosSAFE_SHARP_LINE='^'$(SAFE_CHAR)'*('$$sharp$(OK_CHAR)'*)?$$' 4861.29SchristosOK_LINE= '^'$(OK_CHAR)'*$$' 4871.9Schristos 4881.6Schristos# Flags to give 'tar' when making a distribution. 4891.6Schristos# Try to use flags appropriate for GNU tar. 4901.50SchristosGNUTARFLAGS= --format=pax --pax-option='delete=atime,delete=ctime' \ 4911.50Schristos --numeric-owner --owner=0 --group=0 \ 4921.50Schristos --mode=go+u,go-w --sort=name 4931.6SchristosTARFLAGS= `if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \ 4941.6Schristos then echo $(GNUTARFLAGS); \ 4951.6Schristos else :; \ 4961.6Schristos fi` 4971.6Schristos 4981.6Schristos# Flags to give 'gzip' when making a distribution. 4991.38SchristosGZIPFLAGS= -9n 5001.6Schristos 5011.54Schristos# When comparing .tzs files, use GNU diff's -F'^TZ=' option if supported. 5021.54Schristos# This makes it easier to see which Zone has been affected. 5031.54SchristosDIFF_TZS= diff -u$$(! diff -u -F'^TZ=' - - <>/dev/null >&0 2>&1 \ 5041.54Schristos || echo ' -F^TZ=') 5051.54Schristos 5061.1Smlelstv############################################################################### 5071.1Smlelstv 5081.29Schristos#MAKE= make 5091.29Schristos 5101.1Smlelstvcc= cc 5111.39SchristosCC= $(cc) -DTZDIR='"$(TZDIR)"' 5121.1Smlelstv 5131.16SchristosAR= ar 5141.16Schristos 5151.16Schristos# ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib. 5161.16SchristosRANLIB= : 5171.16Schristos 5181.28SchristosTZCOBJS= zic.o 5191.38SchristosTZDOBJS= zdump.o localtime.o asctime.o strftime.o 5201.1SmlelstvDATEOBJS= date.o localtime.o strftime.o asctime.o 5211.45SchristosLIBSRCS= localtime.c asctime.c difftime.c strftime.c 5221.45SchristosLIBOBJS= localtime.o asctime.o difftime.o strftime.o 5231.1SmlelstvHEADERS= tzfile.h private.h 5241.28SchristosNONLIBSRCS= zic.c zdump.c 5251.45SchristosNEWUCBSRCS= date.c 5261.23SchristosSOURCES= $(HEADERS) $(LIBSRCS) $(NONLIBSRCS) $(NEWUCBSRCS) \ 5271.35Schristos tzselect.ksh workman.sh 5281.1SmlelstvMANS= newctime.3 newstrftime.3 newtzset.3 time2posix.3 \ 5291.1Smlelstv tzfile.5 tzselect.8 zic.8 zdump.8 5301.16SchristosMANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.txt \ 5311.16Schristos time2posix.3.txt \ 5321.16Schristos tzfile.5.txt tzselect.8.txt zic.8.txt zdump.8.txt \ 5331.16Schristos date.1.txt 5341.38SchristosCOMMON= calendars CONTRIBUTING LICENSE Makefile \ 5351.49Schristos NEWS README SECURITY theory.html version 5361.39SchristosWEB_PAGES= tz-art.html tz-how-to.html tz-link.html 5371.43SchristosCHECK_WEB_PAGES=check_theory.html check_tz-art.html \ 5381.43Schristos check_tz-how-to.html check_tz-link.html 5391.23SchristosDOCS= $(MANS) date.1 $(MANTXTS) $(WEB_PAGES) 5401.1SmlelstvPRIMARY_YDATA= africa antarctica asia australasia \ 5411.1Smlelstv europe northamerica southamerica 5421.39SchristosYDATA= $(PRIMARY_YDATA) etcetera 5431.46SchristosNDATA= factory 5441.46SchristosTDATA_TO_CHECK= $(YDATA) $(NDATA) backward 5451.39SchristosTDATA= $(YDATA) $(NDATA) $(BACKWARD) 5461.22SchristosZONETABLES= zone1970.tab zone.tab 5471.38SchristosTABDATA= iso3166.tab $(TZDATA_TEXT) $(ZONETABLES) 5481.16SchristosLEAP_DEPS= leapseconds.awk leap-seconds.list 5491.51SchristosTZDATA_ZI_DEPS= ziguard.awk zishrink.awk version $(TDATA) \ 5501.51Schristos $(PACKRATDATA) $(PACKRATLIST) 5511.51SchristosDSTDATA_ZI_DEPS= ziguard.awk $(TDATA) $(PACKRATDATA) $(PACKRATLIST) 5521.39SchristosDATA= $(TDATA_TO_CHECK) backzone iso3166.tab leap-seconds.list \ 5531.46Schristos leapseconds $(ZONETABLES) 5541.40SchristosAWK_SCRIPTS= checklinks.awk checktab.awk leapseconds.awk \ 5551.40Schristos ziguard.awk zishrink.awk 5561.52SchristosMISC= $(AWK_SCRIPTS) 5571.34SchristosTZS_YEAR= 2050 5581.41SchristosTZS_CUTOFF_FLAG= -c $(TZS_YEAR) 5591.34SchristosTZS= to$(TZS_YEAR).tzs 5601.34SchristosTZS_NEW= to$(TZS_YEAR)new.tzs 5611.49SchristosTZS_DEPS= $(YDATA) asctime.c localtime.c \ 5621.34Schristos private.h tzfile.h zdump.c zic.c 5631.51SchristosTZDATA_DIST = $(COMMON) $(DATA) $(MISC) 5641.41Schristos# EIGHT_YARDS is just a yard short of the whole ENCHILADA. 5651.51SchristosEIGHT_YARDS = $(TZDATA_DIST) $(DOCS) $(SOURCES) tzdata.zi 5661.41SchristosENCHILADA = $(EIGHT_YARDS) $(TZS) 5671.34Schristos 5681.34Schristos# Consult these files when deciding whether to rebuild the 'version' file. 5691.34Schristos# This list is not the same as the output of 'git ls-files', since 5701.34Schristos# .gitignore is not distributed. 5711.34SchristosVERSION_DEPS= \ 5721.49Schristos calendars CONTRIBUTING LICENSE Makefile NEWS README SECURITY \ 5731.34Schristos africa antarctica asctime.c asia australasia \ 5741.34Schristos backward backzone \ 5751.34Schristos checklinks.awk checktab.awk \ 5761.34Schristos date.1 date.c difftime.c \ 5771.34Schristos etcetera europe factory iso3166.tab \ 5781.34Schristos leap-seconds.list leapseconds.awk localtime.c \ 5791.34Schristos newctime.3 newstrftime.3 newtzset.3 northamerica \ 5801.46Schristos private.h southamerica strftime.c theory.html \ 5811.39Schristos time2posix.3 tz-art.html tz-how-to.html tz-link.html \ 5821.34Schristos tzfile.5 tzfile.h tzselect.8 tzselect.ksh \ 5831.46Schristos workman.sh zdump.8 zdump.c zic.8 zic.c \ 5841.40Schristos ziguard.awk zishrink.awk \ 5851.52Schristos zone.tab zone1970.tab 5861.1Smlelstv 5871.1Smlelstv# And for the benefit of csh users on systems that assume the user 5881.1Smlelstv# shell should be used to handle commands in Makefiles. . . 5891.1Smlelstv 5901.1SmlelstvSHELL= /bin/sh 5911.1Smlelstv 5921.46Schristosall: tzselect zic zdump libtz.a $(TABDATA) \ 5931.40Schristos vanguard.zi main.zi rearguard.zi 5941.1Smlelstv 5951.29SchristosALL: all date $(ENCHILADA) 5961.1Smlelstv 5971.16Schristosinstall: all $(DATA) $(REDO) $(MANS) 5981.39Schristos mkdir -p '$(DESTDIR)$(BINDIR)' \ 5991.39Schristos '$(DESTDIR)$(ZDUMPDIR)' '$(DESTDIR)$(ZICDIR)' \ 6001.39Schristos '$(DESTDIR)$(LIBDIR)' \ 6011.39Schristos '$(DESTDIR)$(MANDIR)/man3' '$(DESTDIR)$(MANDIR)/man5' \ 6021.39Schristos '$(DESTDIR)$(MANDIR)/man8' 6031.44Schristos $(ZIC_INSTALL) -l $(LOCALTIME) \ 6041.44Schristos `case '$(POSIXRULES)' in ?*) echo '-p';; esac \ 6051.44Schristos ` $(POSIXRULES) \ 6061.39Schristos -t '$(DESTDIR)$(TZDEFAULT)' 6071.39Schristos cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.' 6081.39Schristos cp tzselect '$(DESTDIR)$(BINDIR)/.' 6091.39Schristos cp zdump '$(DESTDIR)$(ZDUMPDIR)/.' 6101.39Schristos cp zic '$(DESTDIR)$(ZICDIR)/.' 6111.39Schristos cp libtz.a '$(DESTDIR)$(LIBDIR)/.' 6121.39Schristos $(RANLIB) '$(DESTDIR)$(LIBDIR)/libtz.a' 6131.39Schristos cp -f newctime.3 newtzset.3 '$(DESTDIR)$(MANDIR)/man3/.' 6141.39Schristos cp -f tzfile.5 '$(DESTDIR)$(MANDIR)/man5/.' 6151.39Schristos cp -f tzselect.8 zdump.8 zic.8 '$(DESTDIR)$(MANDIR)/man8/.' 6161.1Smlelstv 6171.1SmlelstvINSTALL: ALL install date.1 6181.39Schristos mkdir -p '$(DESTDIR)$(BINDIR)' '$(DESTDIR)$(MANDIR)/man1' 6191.39Schristos cp date '$(DESTDIR)$(BINDIR)/.' 6201.39Schristos cp -f date.1 '$(DESTDIR)$(MANDIR)/man1/.' 6211.1Smlelstv 6221.48Schristos# Calculate version number from git, if available. 6231.48Schristos# Otherwise, use $(VERSION) unless it is "unknown" and there is already 6241.48Schristos# a 'version' file, in which case reuse the existing 'version' contents 6251.48Schristos# and append "-dirty" if the contents do not already end in "-dirty". 6261.34Schristosversion: $(VERSION_DEPS) 6271.35Schristos { (type git) >/dev/null 2>&1 && \ 6281.35Schristos V=`git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \ 6291.35Schristos --abbrev=7 --dirty` || \ 6301.48Schristos if test '$(VERSION)' = unknown && V=`cat $@`; then \ 6311.48Schristos case $$V in *-dirty);; *) V=$$V-dirty;; esac; \ 6321.48Schristos else \ 6331.48Schristos V='$(VERSION)'; \ 6341.48Schristos fi; } && \ 6351.35Schristos printf '%s\n' "$$V" >$@.out 6361.35Schristos mv $@.out $@ 6371.34Schristos 6381.51Schristos# These files can be tailored by setting BACKWARD, PACKRATDATA, PACKRATLIST. 6391.40Schristosvanguard.zi main.zi rearguard.zi: $(DSTDATA_ZI_DEPS) 6401.51Schristos $(AWK) \ 6411.51Schristos -v DATAFORM=`expr $@ : '\(.*\).zi'` \ 6421.51Schristos -v PACKRATDATA='$(PACKRATDATA)' \ 6431.51Schristos -v PACKRATLIST='$(PACKRATLIST)' \ 6441.51Schristos -f ziguard.awk \ 6451.40Schristos $(TDATA) $(PACKRATDATA) >$@.out 6461.40Schristos mv $@.out $@ 6471.41Schristos# This file has a version comment that attempts to capture any tailoring 6481.51Schristos# via BACKWARD, DATAFORM, PACKRATDATA, PACKRATLIST, and REDO. 6491.41Schristostzdata.zi: $(DATAFORM).zi version zishrink.awk 6501.39Schristos version=`sed 1q version` && \ 6511.41Schristos LC_ALL=C $(AWK) \ 6521.41Schristos -v dataform='$(DATAFORM)' \ 6531.41Schristos -v deps='$(DSTDATA_ZI_DEPS) zishrink.awk' \ 6541.41Schristos -v redo='$(REDO)' \ 6551.41Schristos -v version="$$version" \ 6561.41Schristos -f zishrink.awk \ 6571.40Schristos $(DATAFORM).zi >$@.out 6581.38Schristos mv $@.out $@ 6591.38Schristos 6601.34Schristosversion.h: version 6611.35Schristos VERSION=`cat version` && printf '%s\n' \ 6621.35Schristos 'static char const PKGVERSION[]="($(PACKAGE)) ";' \ 6631.35Schristos "static char const TZVERSION[]=\"$$VERSION\";" \ 6641.35Schristos 'static char const REPORT_BUGS_TO[]="$(BUGEMAIL)";' \ 6651.35Schristos >$@.out 6661.35Schristos mv $@.out $@ 6671.6Schristos 6681.1Smlelstvzdump: $(TZDOBJS) 6691.9Schristos $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS) 6701.1Smlelstv 6711.32Schristoszic: $(TZCOBJS) 6721.9Schristos $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS) 6731.1Smlelstv 6741.16Schristosleapseconds: $(LEAP_DEPS) 6751.45Schristos $(AWK) -v EXPIRES_LINE=$(EXPIRES_LINE) \ 6761.45Schristos -f leapseconds.awk leap-seconds.list >$@.out 6771.35Schristos mv $@.out $@ 6781.15Schristos 6791.32Schristos# Arguments to pass to submakes of install_data. 6801.32Schristos# They can be overridden by later submake arguments. 6811.32SchristosINSTALLARGS = \ 6821.39Schristos BACKWARD='$(BACKWARD)' \ 6831.39Schristos DESTDIR='$(DESTDIR)' \ 6841.32Schristos LEAPSECONDS='$(LEAPSECONDS)' \ 6851.32Schristos PACKRATDATA='$(PACKRATDATA)' \ 6861.51Schristos PACKRATLIST='$(PACKRATLIST)' \ 6871.39Schristos TZDEFAULT='$(TZDEFAULT)' \ 6881.39Schristos TZDIR='$(TZDIR)' \ 6891.32Schristos ZIC='$(ZIC)' 6901.32Schristos 6911.46SchristosINSTALL_DATA_DEPS = zic leapseconds tzdata.zi 6921.41Schristos 6931.41Schristos# 'make install_data' installs one set of TZif files. 6941.41Schristosinstall_data: $(INSTALL_DATA_DEPS) 6951.38Schristos $(ZIC_INSTALL) tzdata.zi 6961.32Schristos 6971.41Schristosposix_only: $(INSTALL_DATA_DEPS) 6981.32Schristos $(MAKE) $(INSTALLARGS) LEAPSECONDS= install_data 6991.32Schristos 7001.41Schristosright_only: $(INSTALL_DATA_DEPS) 7011.32Schristos $(MAKE) $(INSTALLARGS) LEAPSECONDS='-L leapseconds' \ 7021.32Schristos install_data 7031.1Smlelstv 7041.1Smlelstv# In earlier versions of this makefile, the other two directories were 7051.1Smlelstv# subdirectories of $(TZDIR). However, this led to configuration errors. 7061.1Smlelstv# For example, with posix_right under the earlier scheme, 7071.1Smlelstv# TZ='right/Australia/Adelaide' got you localtime with leap seconds, 7081.1Smlelstv# but gmtime without leap seconds, which led to problems with applications 7091.1Smlelstv# like sendmail that subtract gmtime from localtime. 7101.1Smlelstv# Therefore, the other two directories are now siblings of $(TZDIR). 7111.1Smlelstv# You must replace all of $(TZDIR) to switch from not using leap seconds 7121.1Smlelstv# to using them, or vice versa. 7131.32Schristosright_posix: right_only 7141.39Schristos rm -fr '$(DESTDIR)$(TZDIR)-leaps' 7151.39Schristos ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-leaps' || \ 7161.39Schristos $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only 7171.39Schristos $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only 7181.15Schristos 7191.32Schristosposix_right: posix_only 7201.39Schristos rm -fr '$(DESTDIR)$(TZDIR)-posix' 7211.39Schristos ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-posix' || \ 7221.39Schristos $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only 7231.39Schristos $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only 7241.32Schristos 7251.1Smlelstvzones: $(REDO) 7261.1Smlelstv 7271.40Schristos# dummy.zd is not a real file; it is mentioned here only so that the 7281.40Schristos# top-level 'make' does not have a syntax error. 7291.40SchristosZDS = dummy.zd 7301.40Schristos# Rule used only by submakes invoked by the $(TZS_NEW) rule. 7311.40Schristos# It is separate so that GNU 'make -j' can run instances in parallel. 7321.40Schristos$(ZDS): zdump 7331.41Schristos ./zdump -i $(TZS_CUTOFF_FLAG) '$(wd)/'$$(expr $@ : '\(.*\).zd') \ 7341.41Schristos >$@ 7351.40Schristos 7361.41SchristosTZS_NEW_DEPS = tzdata.zi zdump zic 7371.41Schristos$(TZS_NEW): $(TZS_NEW_DEPS) 7381.41Schristos rm -fr tzs$(TZS_YEAR).dir 7391.41Schristos mkdir tzs$(TZS_YEAR).dir 7401.41Schristos $(zic) -d tzs$(TZS_YEAR).dir tzdata.zi 7411.38Schristos $(AWK) '/^L/{print "Link\t" $$2 "\t" $$3}' \ 7421.38Schristos tzdata.zi | LC_ALL=C sort >$@.out 7431.35Schristos wd=`pwd` && \ 7441.41Schristos x=`$(AWK) '/^Z/{print "tzs$(TZS_YEAR).dir/" $$2 ".zd"}' \ 7451.41Schristos tzdata.zi \ 7461.40Schristos | LC_ALL=C sort -t . -k 2,2` && \ 7471.41Schristos set x $$x && \ 7481.40Schristos shift && \ 7491.40Schristos ZDS=$$* && \ 7501.41Schristos $(MAKE) wd="$$wd" TZS_CUTOFF_FLAG="$(TZS_CUTOFF_FLAG)" \ 7511.41Schristos ZDS="$$ZDS" $$ZDS && \ 7521.41Schristos sed 's,^TZ=".*\.dir/,TZ=",' $$ZDS >>$@.out 7531.41Schristos rm -fr tzs$(TZS_YEAR).dir 7541.40Schristos mv $@.out $@ 7551.34Schristos 7561.41Schristos# If $(TZS) exists but 'make check_tzs' fails, a maintainer should inspect the 7571.34Schristos# failed output and fix the inconsistency, perhaps by running 'make force_tzs'. 7581.34Schristos$(TZS): 7591.41Schristos touch $@ 7601.34Schristos 7611.34Schristosforce_tzs: $(TZS_NEW) 7621.34Schristos cp $(TZS_NEW) $(TZS) 7631.34Schristos 7641.16Schristoslibtz.a: $(LIBOBJS) 7651.37Schristos rm -f $@ 7661.37Schristos $(AR) -rc $@ $(LIBOBJS) 7671.16Schristos $(RANLIB) $@ 7681.1Smlelstv 7691.1Smlelstvdate: $(DATEOBJS) 7701.9Schristos $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS) 7711.1Smlelstv 7721.34Schristostzselect: tzselect.ksh version 7731.35Schristos VERSION=`cat version` && sed \ 7741.9Schristos -e 's|#!/bin/bash|#!$(KSHELL)|g' \ 7751.50Schristos -e 's|AWK=[^}]*|AWK='\''$(AWK)'\''|g' \ 7761.9Schristos -e 's|\(PKGVERSION\)=.*|\1='\''($(PACKAGE)) '\''|' \ 7771.9Schristos -e 's|\(REPORT_BUGS_TO\)=.*|\1=$(BUGEMAIL)|' \ 7781.1Smlelstv -e 's|TZDIR=[^}]*|TZDIR=$(TZDIR)|' \ 7791.35Schristos -e 's|\(TZVERSION\)=.*|\1='"$$VERSION"'|' \ 7801.35Schristos <$@.ksh >$@.out 7811.35Schristos chmod +x $@.out 7821.35Schristos mv $@.out $@ 7831.1Smlelstv 7841.54Schristoscheck: check_back check_mild 7851.54Schristoscheck_mild: check_character_set check_white_space check_links \ 7861.51Schristos check_name_lengths check_slashed_abbrs check_sorted \ 7871.51Schristos check_tables check_web check_ziguard check_zishrink check_tzs 7881.9Schristos 7891.9Schristoscheck_character_set: $(ENCHILADA) 7901.38Schristos test ! '$(UTF8_LOCALE)' || \ 7911.38Schristos ! printf 'A\304\200B\n' | \ 7921.38Schristos LC_ALL='$(UTF8_LOCALE)' grep -q '^A.B$$' >/dev/null 2>&1 || { \ 7931.38Schristos LC_ALL='$(UTF8_LOCALE)' && export LC_ALL && \ 7941.22Schristos sharp='#' && \ 7951.35Schristos ! grep -Env $(SAFE_LINE) $(MANS) date.1 $(MANTXTS) \ 7961.35Schristos $(MISC) $(SOURCES) $(WEB_PAGES) \ 7971.49Schristos CONTRIBUTING LICENSE README SECURITY \ 7981.38Schristos version tzdata.zi && \ 7991.41Schristos ! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_'$(OK_CHAR)'*$$' \ 8001.40Schristos Makefile && \ 8011.39Schristos ! grep -Env $(SAFE_SHARP_LINE) $(TDATA_TO_CHECK) backzone \ 8021.46Schristos leapseconds zone.tab && \ 8031.38Schristos ! grep -Env $(OK_LINE) $(ENCHILADA); \ 8041.38Schristos } 8051.41Schristos touch $@ 8061.22Schristos 8071.23Schristoscheck_white_space: $(ENCHILADA) 8081.35Schristos patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \ 8091.41Schristos ! grep -En "$$pat" \ 8101.41Schristos $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list) 8111.51Schristos ! grep -n '[$s]$$' \ 8121.39Schristos $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list) 8131.41Schristos touch $@ 8141.23Schristos 8151.51SchristosPRECEDES_FILE_NAME = ^(Zone|Link[$s]+[^$s]+)[$s]+ 8161.51SchristosFILE_NAME_COMPONENT_TOO_LONG = $(PRECEDES_FILE_NAME)[^$s]*[^/$s]{15} 8171.38Schristos 8181.39Schristoscheck_name_lengths: $(TDATA_TO_CHECK) backzone 8191.39Schristos ! grep -En '$(FILE_NAME_COMPONENT_TOO_LONG)' \ 8201.39Schristos $(TDATA_TO_CHECK) backzone 8211.41Schristos touch $@ 8221.38Schristos 8231.51SchristosPRECEDES_STDOFF = ^(Zone[$s]+[^$s]+)?[$s]+ 8241.51SchristosSTDOFF = [-+]?[0-9:.]+ 8251.51SchristosRULELESS_SAVE = (-|$(STDOFF)[sd]?) 8261.51SchristosRULELESS_SLASHED_ABBRS = \ 8271.51Schristos $(PRECEDES_STDOFF)$(STDOFF)[$s]+$(RULELESS_SAVE)[$s]+[^$s]*/ 8281.51Schristos 8291.51Schristoscheck_slashed_abbrs: $(TDATA_TO_CHECK) 8301.51Schristos ! grep -En '$(RULELESS_SLASHED_ABBRS)' $(TDATA_TO_CHECK) 8311.51Schristos touch $@ 8321.51Schristos 8331.23SchristosCHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; } 8341.23Schristos 8351.55Schristoscheck_sorted: backward backzone 8361.54Schristos $(AWK) '/^Link/ {printf "%.5d %s\n", g, $$3} !/./ {g++}' \ 8371.53Schristos backward | LC_ALL=C sort -cu 8381.23Schristos $(AWK) '/^Zone/ {print $$2}' backzone | LC_ALL=C sort -cu 8391.41Schristos touch $@ 8401.23Schristos 8411.54Schristoscheck_back: checklinks.awk $(TDATA_TO_CHECK) 8421.53Schristos $(AWK) \ 8431.53Schristos -v DATAFORM=$(DATAFORM) \ 8441.53Schristos -v backcheck=backward \ 8451.53Schristos -f checklinks.awk $(TDATA_TO_CHECK) 8461.54Schristos touch $@ 8471.54Schristos 8481.54Schristoscheck_links: checklinks.awk tzdata.zi 8491.53Schristos $(AWK) \ 8501.53Schristos -v DATAFORM=$(DATAFORM) \ 8511.53Schristos -f checklinks.awk tzdata.zi 8521.41Schristos touch $@ 8531.26Schristos 8541.49Schristoscheck_tables: checktab.awk $(YDATA) backward $(ZONETABLES) 8551.22Schristos for tab in $(ZONETABLES); do \ 8561.49Schristos test "$$tab" = zone.tab && links='$(BACKWARD)' || links=''; \ 8571.49Schristos $(AWK) -f checktab.awk -v zone_table=$$tab $(YDATA) $$links \ 8581.22Schristos || exit; \ 8591.22Schristos done 8601.41Schristos touch $@ 8611.1Smlelstv 8621.34Schristoscheck_tzs: $(TZS) $(TZS_NEW) 8631.41Schristos if test -s $(TZS); then \ 8641.54Schristos $(DIFF_TZS) $(TZS) $(TZS_NEW); \ 8651.41Schristos else \ 8661.41Schristos cp $(TZS_NEW) $(TZS); \ 8671.41Schristos fi 8681.41Schristos touch $@ 8691.34Schristos 8701.42Schristoscheck_web: $(CHECK_WEB_PAGES) 8711.43Schristoscheck_theory.html: theory.html 8721.42Schristoscheck_tz-art.html: tz-art.html 8731.46Schristoscheck_tz-how-to.html: tz-how-to.html 8741.42Schristoscheck_tz-link.html: tz-link.html 8751.46Schristoscheck_theory.html check_tz-art.html check_tz-how-to.html check_tz-link.html: 8761.42Schristos $(CURL) -sS --url https://validator.w3.org/nu/ -F out=gnu \ 8771.42Schristos -F file=@$$(expr $@ : 'check_\(.*\)') -o $@.out && \ 8781.42Schristos test ! -s $@.out || { cat $@.out; exit 1; } 8791.42Schristos mv $@.out $@ 8801.38Schristos 8811.51Schristoscheck_ziguard: rearguard.zi vanguard.zi ziguard.awk 8821.51Schristos $(AWK) -v DATAFORM=rearguard -f ziguard.awk vanguard.zi | \ 8831.51Schristos diff -u rearguard.zi - 8841.51Schristos $(AWK) -v DATAFORM=vanguard -f ziguard.awk rearguard.zi | \ 8851.51Schristos diff -u vanguard.zi - 8861.51Schristos touch $@ 8871.51Schristos 8881.40Schristos# Check that zishrink.awk does not alter the data, and that ziguard.awk 8891.40Schristos# preserves main-format data. 8901.41Schristoscheck_zishrink: check_zishrink_posix check_zishrink_right 8911.41Schristoscheck_zishrink_posix check_zishrink_right: \ 8921.51Schristos zic leapseconds $(PACKRATDATA) $(PACKRATLIST) \ 8931.51Schristos $(TDATA) $(DATAFORM).zi tzdata.zi 8941.41Schristos rm -fr $@.dir $@-t.dir $@-shrunk.dir 8951.41Schristos mkdir $@.dir $@-t.dir $@-shrunk.dir 8961.41Schristos case $@ in \ 8971.41Schristos *_right) leap='-L leapseconds';; \ 8981.41Schristos *) leap=;; \ 8991.41Schristos esac && \ 9001.41Schristos $(ZIC) $$leap -d $@.dir $(DATAFORM).zi && \ 9011.41Schristos $(ZIC) $$leap -d $@-shrunk.dir tzdata.zi && \ 9021.51Schristos case $(DATAFORM),$(PACKRATLIST) in \ 9031.51Schristos main,) \ 9041.41Schristos $(ZIC) $$leap -d $@-t.dir $(TDATA) && \ 9051.40Schristos $(AWK) '/^Rule/' $(TDATA) | \ 9061.41Schristos $(ZIC) $$leap -d $@-t.dir - $(PACKRATDATA) && \ 9071.41Schristos diff -r $@.dir $@-t.dir;; \ 9081.41Schristos esac 9091.41Schristos diff -r $@.dir $@-shrunk.dir 9101.41Schristos rm -fr $@.dir $@-t.dir $@-shrunk.dir 9111.41Schristos touch $@ 9121.1Smlelstv 9131.14Schristosclean_misc: 9141.43Schristos rm -fr check_*.dir 9151.41Schristos rm -f *.o *.out $(TIME_T_ALTERNATIVES) \ 9161.41Schristos check_* core typecheck_* \ 9171.46Schristos date tzselect version.h zdump zic libtz.a 9181.14Schristosclean: clean_misc 9191.43Schristos rm -fr *.dir tzdb-*/ 9201.43Schristos rm -f *.zi $(TZS_NEW) 9211.1Smlelstv 9221.1Smlelstvmaintainer-clean: clean 9231.1Smlelstv @echo 'This command is intended for maintainers to use; it' 9241.1Smlelstv @echo 'deletes files that may need special tools to rebuild.' 9251.34Schristos rm -f leapseconds version $(MANTXTS) $(TZS) *.asc *.tar.* 9261.1Smlelstv 9271.1Smlelstvnames: 9281.1Smlelstv @echo $(ENCHILADA) 9291.1Smlelstv 9301.23Schristospublic: check check_public $(CHECK_TIME_T_ALTERNATIVES) \ 9311.16Schristos tarballs signatures 9321.16Schristos 9331.16Schristosdate.1.txt: date.1 9341.16Schristosnewctime.3.txt: newctime.3 9351.16Schristosnewstrftime.3.txt: newstrftime.3 9361.16Schristosnewtzset.3.txt: newtzset.3 9371.16Schristostime2posix.3.txt: time2posix.3 9381.16Schristostzfile.5.txt: tzfile.5 9391.16Schristostzselect.8.txt: tzselect.8 9401.16Schristoszdump.8.txt: zdump.8 9411.16Schristoszic.8.txt: zic.8 9421.16Schristos 9431.16Schristos$(MANTXTS): workman.sh 9441.35Schristos LC_ALL=C sh workman.sh `expr $@ : '\(.*\)\.txt$$'` >$@.out 9451.35Schristos mv $@.out $@ 9461.9Schristos 9471.48Schristos# Set file timestamps deterministically if possible, 9481.48Schristos# so that tarballs containing the timestamps are reproducible. 9491.48Schristos# 9501.48Schristos# '$(SET_TIMESTAMP_N) N DEST A B C ...' sets the timestamp of the 9511.48Schristos# file DEST to the maximum of the timestamps of the files A B C ..., 9521.48Schristos# plus N if GNU ls and touch are available. 9531.48SchristosSET_TIMESTAMP_N = sh -c '\ 9541.48Schristos n=$$0 dest=$$1; shift; \ 9551.48Schristos touch -cmr `ls -t "$$@" | sed 1q` "$$dest" && \ 9561.48Schristos if test $$n != 0 && \ 9571.48Schristos lsout=`ls -n --time-style="+%s" "$$dest" 2>/dev/null`; then \ 9581.48Schristos set x $$lsout && \ 9591.48Schristos touch -cmd @`expr $$7 + $$n` "$$dest"; \ 9601.48Schristos else :; fi' 9611.48Schristos# If DEST depends on A B C ... in this Makefile, callers should use 9621.48Schristos# $(SET_TIMESTAMP_DEP) DEST A B C ..., for the benefit of any 9631.48Schristos# downstream 'make' that considers equal timestamps to be out of date. 9641.48Schristos# POSIX allows this 'make' behavior, and HP-UX 'make' does it. 9651.48Schristos# If all that matters is that the timestamp be reproducible 9661.48Schristos# and plausible, use $(SET_TIMESTAMP). 9671.48SchristosSET_TIMESTAMP = $(SET_TIMESTAMP_N) 0 9681.48SchristosSET_TIMESTAMP_DEP = $(SET_TIMESTAMP_N) 1 9691.48Schristos 9701.41Schristos# Set the timestamps to those of the git repository, if available, 9711.6Schristos# and if the files have not changed since then. 9721.48Schristos# This uses GNU 'ls --time-style=+%s', which outputs the seconds count, 9731.48Schristos# and GNU 'touch -d@N FILE', where N is the number of seconds since 1970. 9741.48Schristos# If git or GNU is absent, don't bother to sync with git timestamps. 9751.16Schristos# Also, set the timestamp of each prebuilt file like 'leapseconds' 9761.16Schristos# to be the maximum of the files it depends on. 9771.41Schristosset-timestamps.out: $(EIGHT_YARDS) 9781.16Schristos rm -f $@ 9791.35Schristos if (type git) >/dev/null 2>&1 && \ 9801.41Schristos files=`git ls-files $(EIGHT_YARDS)` && \ 9811.16Schristos touch -md @1 test.out; then \ 9821.16Schristos rm -f test.out && \ 9831.16Schristos for file in $$files; do \ 9841.16Schristos if git diff --quiet $$file; then \ 9851.16Schristos time=`git log -1 --format='tformat:%ct' $$file` && \ 9861.16Schristos touch -cmd @$$time $$file; \ 9871.16Schristos else \ 9881.16Schristos echo >&2 "$$file: warning: does not match repository"; \ 9891.16Schristos fi || exit; \ 9901.16Schristos done; \ 9911.16Schristos fi 9921.48Schristos $(SET_TIMESTAMP_DEP) leapseconds $(LEAP_DEPS) 9931.16Schristos for file in `ls $(MANTXTS) | sed 's/\.txt$$//'`; do \ 9941.48Schristos $(SET_TIMESTAMP_DEP) $$file.txt $$file workman.sh || \ 9951.16Schristos exit; \ 9961.6Schristos done 9971.48Schristos $(SET_TIMESTAMP_DEP) version $(VERSION_DEPS) 9981.48Schristos $(SET_TIMESTAMP_DEP) tzdata.zi $(TZDATA_ZI_DEPS) 9991.41Schristos touch $@ 10001.41Schristosset-tzs-timestamp.out: $(TZS) 10011.48Schristos $(SET_TIMESTAMP_DEP) $(TZS) $(TZS_DEPS) 10021.16Schristos touch $@ 10031.6Schristos 10041.1Smlelstv# The zics below ensure that each data file can stand on its own. 10051.1Smlelstv# We also do an all-files run to catch links to links. 10061.1Smlelstv 10071.41Schristoscheck_public: $(VERSION_DEPS) 10081.41Schristos rm -fr public.dir 10091.41Schristos mkdir public.dir 10101.41Schristos ln $(VERSION_DEPS) public.dir 10111.41Schristos cd public.dir && $(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' ALL 10121.48Schristos for i in $(TDATA_TO_CHECK) public.dir/tzdata.zi \ 10131.48Schristos public.dir/vanguard.zi public.dir/main.zi \ 10141.48Schristos public.dir/rearguard.zi; \ 10151.48Schristos do \ 10161.41Schristos public.dir/zic -v -d public.dir/zoneinfo $$i 2>&1 || exit; \ 10171.9Schristos done 10181.41Schristos public.dir/zic -v -d public.dir/zoneinfo-all $(TDATA_TO_CHECK) 10191.49Schristos : 10201.49Schristos : Also check 'backzone' syntax. 10211.49Schristos rm public.dir/main.zi 10221.49Schristos cd public.dir && $(MAKE) PACKRATDATA=backzone main.zi 10231.49Schristos public.dir/zic -d public.dir/zoneinfo main.zi 10241.51Schristos rm public.dir/main.zi 10251.51Schristos cd public.dir && \ 10261.51Schristos $(MAKE) PACKRATDATA=backzone PACKRATLIST=zone.tab main.zi 10271.51Schristos public.dir/zic -d public.dir/zoneinfo main.zi 10281.49Schristos : 10291.34Schristos rm -fr public.dir 10301.41Schristos touch $@ 10311.9Schristos 10321.14Schristos# Check that the code works under various alternative 10331.14Schristos# implementations of time_t. 10341.41Schristoscheck_time_t_alternatives: $(TIME_T_ALTERNATIVES) 10351.41Schristos$(TIME_T_ALTERNATIVES_TAIL): $(TIME_T_ALTERNATIVES_HEAD) 10361.41Schristos$(TIME_T_ALTERNATIVES): $(VERSION_DEPS) 10371.41Schristos rm -fr $@.dir 10381.41Schristos mkdir $@.dir 10391.41Schristos ln $(VERSION_DEPS) $@.dir 10401.41Schristos case $@ in \ 10411.49Schristos int*32_t) range=-2147483648,2147483648;; \ 10421.41Schristos u*) range=0,4294967296;; \ 10431.41Schristos *) range=-4294967296,4294967296;; \ 10441.41Schristos esac && \ 10451.41Schristos wd=`pwd` && \ 10461.41Schristos zones=`$(AWK) '/^[^#]/ { print $$3 }' <zone1970.tab` && \ 10471.41Schristos if test $@ = $(TIME_T_ALTERNATIVES_HEAD); then \ 10481.41Schristos range_target=; \ 10491.23Schristos else \ 10501.41Schristos range_target=to$$range.tzs; \ 10511.23Schristos fi && \ 10521.41Schristos (cd $@.dir && \ 10531.41Schristos $(MAKE) TOPDIR="$$wd/$@.dir" \ 10541.41Schristos CFLAGS='$(CFLAGS) -Dtime_tz='"'$@'" \ 10551.23Schristos REDO='$(REDO)' \ 10561.41Schristos D=$$wd/$@.dir \ 10571.41Schristos TZS_YEAR="$$range" TZS_CUTOFF_FLAG="-t $$range" \ 10581.41Schristos install $$range_target) && \ 10591.41Schristos test $@ = $(TIME_T_ALTERNATIVES_HEAD) || { \ 10601.41Schristos (cd $(TIME_T_ALTERNATIVES_HEAD).dir && \ 10611.41Schristos $(MAKE) TOPDIR="$$wd/$@.dir" \ 10621.41Schristos TZS_YEAR="$$range" TZS_CUTOFF_FLAG="-t $$range" \ 10631.41Schristos D=$$wd/$@.dir \ 10641.41Schristos to$$range.tzs) && \ 10651.54Schristos $(DIFF_TZS) $(TIME_T_ALTERNATIVES_HEAD).dir/to$$range.tzs \ 10661.41Schristos $@.dir/to$$range.tzs && \ 10671.41Schristos if diff -q Makefile Makefile 2>/dev/null; then \ 10681.41Schristos quiet_option='-q'; \ 10691.41Schristos else \ 10701.41Schristos quiet_option=''; \ 10711.41Schristos fi && \ 10721.41Schristos diff $$quiet_option -r $(TIME_T_ALTERNATIVES_HEAD).dir/etc \ 10731.41Schristos $@.dir/etc && \ 10741.41Schristos diff $$quiet_option -r \ 10751.41Schristos $(TIME_T_ALTERNATIVES_HEAD).dir/usr/share \ 10761.41Schristos $@.dir/usr/share; \ 10771.41Schristos } 10781.41Schristos touch $@ 10791.34Schristos 10801.40SchristosTRADITIONAL_ASC = \ 10811.40Schristos tzcode$(VERSION).tar.gz.asc \ 10821.40Schristos tzdata$(VERSION).tar.gz.asc 10831.41SchristosREARGUARD_ASC = \ 10841.41Schristos tzdata$(VERSION)-rearguard.tar.gz.asc 10851.41SchristosALL_ASC = $(TRADITIONAL_ASC) $(REARGUARD_ASC) \ 10861.40Schristos tzdb-$(VERSION).tar.lz.asc 10871.40Schristos 10881.51Schristostarballs rearguard_tarballs tailored_tarballs traditional_tarballs \ 10891.41Schristossignatures rearguard_signatures traditional_signatures: \ 10901.51Schristos version set-timestamps.out rearguard.zi vanguard.zi 10911.35Schristos VERSION=`cat version` && \ 10921.48Schristos $(MAKE) AWK='$(AWK)' VERSION="$$VERSION" $@_version 10931.35Schristos 10941.40Schristos# These *_version rules are intended for use if VERSION is set by some 10951.40Schristos# other means. Ordinarily these rules are used only by the above 10961.40Schristos# non-_version rules, which set VERSION on the 'make' command line. 10971.41Schristostarballs_version: traditional_tarballs_version rearguard_tarballs_version \ 10981.40Schristos tzdb-$(VERSION).tar.lz 10991.41Schristosrearguard_tarballs_version: \ 11001.41Schristos tzdata$(VERSION)-rearguard.tar.gz 11011.38Schristostraditional_tarballs_version: \ 11021.38Schristos tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz 11031.51Schristostailored_tarballs_version: \ 11041.51Schristos tzdata$(VERSION)-tailored.tar.gz 11051.40Schristossignatures_version: $(ALL_ASC) 11061.41Schristosrearguard_signatures_version: $(REARGUARD_ASC) 11071.40Schristostraditional_signatures_version: $(TRADITIONAL_ASC) 11081.9Schristos 11091.16Schristostzcode$(VERSION).tar.gz: set-timestamps.out 11101.6Schristos LC_ALL=C && export LC_ALL && \ 11111.7Schristos tar $(TARFLAGS) -cf - \ 11121.23Schristos $(COMMON) $(DOCS) $(SOURCES) | \ 11131.38Schristos gzip $(GZIPFLAGS) >$@.out 11141.35Schristos mv $@.out $@ 11151.10Schristos 11161.16Schristostzdata$(VERSION).tar.gz: set-timestamps.out 11171.6Schristos LC_ALL=C && export LC_ALL && \ 11181.51Schristos tar $(TARFLAGS) -cf - $(TZDATA_DIST) | \ 11191.38Schristos gzip $(GZIPFLAGS) >$@.out 11201.35Schristos mv $@.out $@ 11211.9Schristos 11221.51Schristos# Create empty files with a reproducible timestamp. 11231.51SchristosCREATE_EMPTY = TZ=UTC0 touch -mt 202010122253.00 11241.51Schristos 11251.51Schristos# The obsolescent *rearguard* targets and related macros are present 11261.51Schristos# for backwards compatibility with tz releases 2018e through 2022a. 11271.51Schristos# They should go away eventually. To build rearguard tarballs you 11281.51Schristos# can instead use 'make DATAFORM=rearguard tailored_tarballs'. 11291.40Schristostzdata$(VERSION)-rearguard.tar.gz: rearguard.zi set-timestamps.out 11301.51Schristos rm -fr $@.dir 11311.51Schristos mkdir $@.dir 11321.51Schristos ln $(TZDATA_DIST) $@.dir 11331.51Schristos cd $@.dir && rm -f $(TDATA) $(PACKRATDATA) version 11341.40Schristos for f in $(TDATA) $(PACKRATDATA); do \ 11351.51Schristos rearf=$@.dir/$$f; \ 11361.40Schristos $(AWK) -v DATAFORM=rearguard -f ziguard.awk $$f >$$rearf && \ 11371.48Schristos $(SET_TIMESTAMP_DEP) $$rearf ziguard.awk $$f || exit; \ 11381.40Schristos done 11391.51Schristos sed '1s/$$/-rearguard/' <version >$@.dir/version 11401.47Schristos : The dummy pacificnew pacifies TZUpdater 2.3.1 and earlier. 11411.51Schristos $(CREATE_EMPTY) $@.dir/pacificnew 11421.51Schristos touch -cmr version $@.dir/version 11431.40Schristos LC_ALL=C && export LC_ALL && \ 11441.51Schristos (cd $@.dir && \ 11451.47Schristos tar $(TARFLAGS) -cf - \ 11461.51Schristos $(TZDATA_DIST) pacificnew | \ 11471.40Schristos gzip $(GZIPFLAGS)) >$@.out 11481.40Schristos mv $@.out $@ 11491.40Schristos 11501.51Schristos# Create a tailored tarball suitable for TZUpdater and compatible tools. 11511.51Schristos# For example, 'make DATAFORM=vanguard tailored_tarballs' makes a tarball 11521.51Schristos# useful for testing whether TZUpdater supports vanguard form. 11531.51Schristos# The generated tarball is not byte-for-byte equivalent to a hand-tailored 11541.51Schristos# traditional tarball, as data entries are put into 'etcetera' even if they 11551.51Schristos# came from some other source file. However, the effect should be the same 11561.51Schristos# for ordinary use, which reads all the source files. 11571.51Schristostzdata$(VERSION)-tailored.tar.gz: set-timestamps.out 11581.51Schristos rm -fr $@.dir 11591.51Schristos mkdir $@.dir 11601.51Schristos : The dummy pacificnew pacifies TZUpdater 2.3.1 and earlier. 11611.51Schristos cd $@.dir && \ 11621.51Schristos $(CREATE_EMPTY) $(PRIMARY_YDATA) $(NDATA) backward \ 11631.51Schristos `test $(DATAFORM) = vanguard || echo pacificnew` 11641.51Schristos (grep '^#' tzdata.zi && echo && cat $(DATAFORM).zi) \ 11651.51Schristos >$@.dir/etcetera 11661.51Schristos touch -cmr tzdata.zi $@.dir/etcetera 11671.51Schristos sed -n \ 11681.51Schristos -e '/^# *version *\(.*\)/h' \ 11691.51Schristos -e '/^# *ddeps */H' \ 11701.51Schristos -e '$$!d' \ 11711.51Schristos -e 'g' \ 11721.51Schristos -e 's/^# *version *//' \ 11731.51Schristos -e 's/\n# *ddeps */-/' \ 11741.51Schristos -e 's/ /-/g' \ 11751.51Schristos -e 'p' \ 11761.51Schristos <tzdata.zi >$@.dir/version 11771.51Schristos touch -cmr version $@.dir/version 11781.51Schristos links= && \ 11791.51Schristos for file in $(TZDATA_DIST); do \ 11801.51Schristos test -f $@.dir/$$file || links="$$links $$file"; \ 11811.51Schristos done && \ 11821.51Schristos ln $$links $@.dir 11831.51Schristos LC_ALL=C && export LC_ALL && \ 11841.51Schristos (cd $@.dir && \ 11851.51Schristos tar $(TARFLAGS) -cf - * | gzip $(GZIPFLAGS)) >$@.out 11861.51Schristos mv $@.out $@ 11871.51Schristos 11881.41Schristostzdb-$(VERSION).tar.lz: set-timestamps.out set-tzs-timestamp.out 11891.34Schristos rm -fr tzdb-$(VERSION) 11901.34Schristos mkdir tzdb-$(VERSION) 11911.34Schristos ln $(ENCHILADA) tzdb-$(VERSION) 11921.48Schristos $(SET_TIMESTAMP) tzdb-$(VERSION) tzdb-$(VERSION)/* 11931.34Schristos LC_ALL=C && export LC_ALL && \ 11941.35Schristos tar $(TARFLAGS) -cf - tzdb-$(VERSION) | lzip -9 >$@.out 11951.35Schristos mv $@.out $@ 11961.9Schristos 11971.9Schristostzcode$(VERSION).tar.gz.asc: tzcode$(VERSION).tar.gz 11981.9Schristostzdata$(VERSION).tar.gz.asc: tzdata$(VERSION).tar.gz 11991.40Schristostzdata$(VERSION)-rearguard.tar.gz.asc: tzdata$(VERSION)-rearguard.tar.gz 12001.34Schristostzdb-$(VERSION).tar.lz.asc: tzdb-$(VERSION).tar.lz 12011.40Schristos$(ALL_ASC): 12021.44Schristos $(GPG) --armor --detach-sign $? 12031.34Schristos 12041.41SchristosTYPECHECK_CFLAGS = $(CFLAGS) -DTYPECHECK -D__time_t_defined -D_TIME_T 12051.41Schristostypecheck: typecheck_long_long typecheck_unsigned 12061.41Schristostypecheck_long_long typecheck_unsigned: $(VERSION_DEPS) 12071.41Schristos rm -fr $@.dir 12081.41Schristos mkdir $@.dir 12091.41Schristos ln $(VERSION_DEPS) $@.dir 12101.41Schristos cd $@.dir && \ 12111.41Schristos case $@ in \ 12121.41Schristos *_long_long) i="long long";; \ 12131.41Schristos *_unsigned ) i="unsigned" ;; \ 12141.41Schristos esac && \ 12151.41Schristos typecheck_cflags='' && \ 12161.41Schristos $(MAKE) \ 12171.41Schristos CFLAGS="$(TYPECHECK_CFLAGS) \"-Dtime_t=$$i\"" \ 12181.41Schristos TOPDIR="`pwd`" \ 12191.41Schristos install 12201.41Schristos $@.dir/zdump -i -c 1970,1971 Europe/Rome 12211.41Schristos touch $@ 12221.1Smlelstv 12231.38Schristoszonenames: tzdata.zi 12241.38Schristos @$(AWK) '/^Z/ { print $$2 } /^L/ { print $$3 }' tzdata.zi 12251.1Smlelstv 12261.1Smlelstvasctime.o: private.h tzfile.h 12271.1Smlelstvdate.o: private.h 12281.1Smlelstvdifftime.o: private.h 12291.1Smlelstvlocaltime.o: private.h tzfile.h 12301.23Schristosstrftime.o: private.h tzfile.h 12311.6Schristoszdump.o: version.h 12321.6Schristoszic.o: private.h tzfile.h version.h 12331.1Smlelstv 12341.22Schristos.PHONY: ALL INSTALL all 12351.54Schristos.PHONY: check check_mild check_time_t_alternatives 12361.42Schristos.PHONY: check_web check_zishrink 12371.40Schristos.PHONY: clean clean_misc dummy.zd force_tzs 12381.32Schristos.PHONY: install install_data maintainer-clean names 12391.51Schristos.PHONY: posix_only posix_right public 12401.41Schristos.PHONY: rearguard_signatures rearguard_signatures_version 12411.41Schristos.PHONY: rearguard_tarballs rearguard_tarballs_version 12421.41Schristos.PHONY: right_only right_posix signatures signatures_version 12431.40Schristos.PHONY: tarballs tarballs_version 12441.40Schristos.PHONY: traditional_signatures traditional_signatures_version 12451.40Schristos.PHONY: traditional_tarballs traditional_tarballs_version 12461.51Schristos.PHONY: tailored_tarballs tailored_tarballs_version 12471.40Schristos.PHONY: typecheck 12481.22Schristos.PHONY: zonenames zones 12491.40Schristos.PHONY: $(ZDS) 1250