1bc421551SDag-Erling Smørgrav# Make and install tzdb code and data. 2bc421551SDag-Erling Smørgrav# This file is in the public domain, so clarified as of 3bc421551SDag-Erling Smørgrav# 2009-05-17 by Arthur David Olson. 4*46c59934SDag-Erling Smørgrav# Request POSIX conformance; this must be the first non-comment line. 5*46c59934SDag-Erling Smørgrav.POSIX: 6*46c59934SDag-Erling Smørgrav# On older platforms you may need to scrounge for a POSIX-conforming 'make'. 7*46c59934SDag-Erling Smørgrav# For example, on Solaris 10 (2005), use /usr/sfw/bin/gmake or 8*46c59934SDag-Erling Smørgrav# /usr/xpg4/bin/make, not /usr/ccs/bin/make. 9*46c59934SDag-Erling Smørgrav 10*46c59934SDag-Erling Smørgrav# To affect how this Makefile works, you can run a shell script like this: 11*46c59934SDag-Erling Smørgrav# 12*46c59934SDag-Erling Smørgrav# #!/bin/sh 13*46c59934SDag-Erling Smørgrav# make CC='gcc -std=gnu11' "$@" 14*46c59934SDag-Erling Smørgrav# 15*46c59934SDag-Erling Smørgrav# This example script is appropriate for a pre-2017 GNU/Linux system 16*46c59934SDag-Erling Smørgrav# where a non-default setting is needed to support this package's use of C99. 17*46c59934SDag-Erling Smørgrav# 18*46c59934SDag-Erling Smørgrav# Alternatively, you can simply edit this Makefile to tailor the following 19*46c59934SDag-Erling Smørgrav# macro definitions. 20*46c59934SDag-Erling Smørgrav 21*46c59934SDag-Erling Smørgrav############################################################################### 22*46c59934SDag-Erling Smørgrav# Start of macros that one plausibly might want to tailor. 23bc421551SDag-Erling Smørgrav 24bc421551SDag-Erling Smørgrav# Package name for the code distribution. 25bc421551SDag-Erling SmørgravPACKAGE= tzcode 26bc421551SDag-Erling Smørgrav 27bc421551SDag-Erling Smørgrav# Version number for the distribution, overridden in the 'tarballs' rule below. 28bc421551SDag-Erling SmørgravVERSION= unknown 29bc421551SDag-Erling Smørgrav 30bc421551SDag-Erling Smørgrav# Email address for bug reports. 31bc421551SDag-Erling SmørgravBUGEMAIL= tz@iana.org 32bc421551SDag-Erling Smørgrav 33bc421551SDag-Erling Smørgrav# DATAFORM selects the data format. 34bc421551SDag-Erling Smørgrav# Available formats represent essentially the same data, albeit 35bc421551SDag-Erling Smørgrav# possibly with minor discrepancies that users are not likely to notice. 36bc421551SDag-Erling Smørgrav# To get new features and the best data right away, use: 37bc421551SDag-Erling Smørgrav# DATAFORM= vanguard 38bc421551SDag-Erling Smørgrav# To wait a while before using new features, to give downstream users 39bc421551SDag-Erling Smørgrav# time to upgrade zic (the default), use: 40bc421551SDag-Erling Smørgrav# DATAFORM= main 41bc421551SDag-Erling Smørgrav# To wait even longer for new features, use: 42bc421551SDag-Erling Smørgrav# DATAFORM= rearguard 43bc421551SDag-Erling Smørgrav# Rearguard users might also want "ZFLAGS = -b fat"; see below. 44bc421551SDag-Erling SmørgravDATAFORM= main 45bc421551SDag-Erling Smørgrav 46bc421551SDag-Erling Smørgrav# Change the line below for your timezone (after finding the one you want in 47bc421551SDag-Erling Smørgrav# one of the $(TDATA) source files, or adding it to a source file). 48bc421551SDag-Erling Smørgrav# Alternatively, if you discover you've got the wrong timezone, you can just 49bc421551SDag-Erling Smørgrav# 'zic -l -' to remove it, or 'zic -l rightzone' to change it. 50bc421551SDag-Erling Smørgrav# Use the command 51bc421551SDag-Erling Smørgrav# make zonenames 52bc421551SDag-Erling Smørgrav# to get a list of the values you can use for LOCALTIME. 53bc421551SDag-Erling Smørgrav 54bc421551SDag-Erling SmørgravLOCALTIME= Factory 55bc421551SDag-Erling Smørgrav 56*46c59934SDag-Erling Smørgrav# The POSIXRULES macro controls interpretation of POSIX-2017.1-like TZ 5775411d15SDag-Erling Smørgrav# settings like TZ='EET-2EEST' that lack DST transition rules. 58bc421551SDag-Erling Smørgrav# If POSIXRULES is '-', no template is installed; this is the default. 59bc421551SDag-Erling Smørgrav# Any other value for POSIXRULES is obsolete and should not be relied on, as: 60bc421551SDag-Erling Smørgrav# * It does not work correctly in popular implementations such as GNU/Linux. 61bc421551SDag-Erling Smørgrav# * It does not work even in tzcode, except for historical timestamps 62bc421551SDag-Erling Smørgrav# that precede the last explicit transition in the POSIXRULES file. 63bc421551SDag-Erling Smørgrav# Hence it typically does not work for current and future timestamps. 64bc421551SDag-Erling Smørgrav# If, despite the above, you want a template for handling these settings, 65bc421551SDag-Erling Smørgrav# you can change the line below (after finding the timezone you want in the 66bc421551SDag-Erling Smørgrav# one of the $(TDATA) source files, or adding it to a source file). 67bc421551SDag-Erling Smørgrav# Alternatively, if you discover you've got the wrong timezone, you can just 68bc421551SDag-Erling Smørgrav# 'zic -p -' to remove it, or 'zic -p rightzone' to change it. 69bc421551SDag-Erling Smørgrav# Use the command 70bc421551SDag-Erling Smørgrav# make zonenames 71bc421551SDag-Erling Smørgrav# to get a list of the values you can use for POSIXRULES. 72bc421551SDag-Erling Smørgrav 73bc421551SDag-Erling SmørgravPOSIXRULES= - 74bc421551SDag-Erling Smørgrav 75bc421551SDag-Erling Smørgrav# Also see TZDEFRULESTRING below, which takes effect only 7675411d15SDag-Erling Smørgrav# if POSIXRULES is '-' or if the template file cannot be accessed. 77bc421551SDag-Erling Smørgrav 78bc421551SDag-Erling Smørgrav 79bc421551SDag-Erling Smørgrav# Installation locations. 80bc421551SDag-Erling Smørgrav# 81bc421551SDag-Erling Smørgrav# The defaults are suitable for Debian, except that if REDO is 82bc421551SDag-Erling Smørgrav# posix_right or right_posix then files that Debian puts under 83bc421551SDag-Erling Smørgrav# /usr/share/zoneinfo/posix and /usr/share/zoneinfo/right are instead 84bc421551SDag-Erling Smørgrav# put under /usr/share/zoneinfo-posix and /usr/share/zoneinfo-leaps, 85bc421551SDag-Erling Smørgrav# respectively. Problems with the Debian approach are discussed in 86bc421551SDag-Erling Smørgrav# the commentary for the right_posix rule (below). 87bc421551SDag-Erling Smørgrav 88bc421551SDag-Erling Smørgrav# Destination directory, which can be used for staging. 89bc421551SDag-Erling Smørgrav# 'make DESTDIR=/stage install' installs under /stage (e.g., to 90bc421551SDag-Erling Smørgrav# /stage/etc/localtime instead of to /etc/localtime). Files under 91bc421551SDag-Erling Smørgrav# /stage are not intended to work as-is, but can be copied by hand to 92bc421551SDag-Erling Smørgrav# the root directory later. If DESTDIR is empty, 'make install' does 93bc421551SDag-Erling Smørgrav# not stage, but installs directly into production locations. 94bc421551SDag-Erling SmørgravDESTDIR = 95bc421551SDag-Erling Smørgrav 96bc421551SDag-Erling Smørgrav# Everything is installed into subdirectories of TOPDIR, and used there. 97bc421551SDag-Erling Smørgrav# TOPDIR should be empty (meaning the root directory), 98bc421551SDag-Erling Smørgrav# or a directory name that does not end in "/". 99bc421551SDag-Erling Smørgrav# TOPDIR should be empty or an absolute name unless you're just testing. 100bc421551SDag-Erling SmørgravTOPDIR = 101bc421551SDag-Erling Smørgrav 102bc421551SDag-Erling Smørgrav# The default local timezone is taken from the file TZDEFAULT. 103bc421551SDag-Erling SmørgravTZDEFAULT = $(TOPDIR)/etc/localtime 104bc421551SDag-Erling Smørgrav 105bc421551SDag-Erling Smørgrav# The subdirectory containing installed program and data files, and 106bc421551SDag-Erling Smørgrav# likewise for installed files that can be shared among architectures. 107bc421551SDag-Erling Smørgrav# These should be relative file names. 108bc421551SDag-Erling SmørgravUSRDIR = usr 109bc421551SDag-Erling SmørgravUSRSHAREDIR = $(USRDIR)/share 110bc421551SDag-Erling Smørgrav 111bc421551SDag-Erling Smørgrav# "Compiled" timezone information is placed in the "TZDIR" directory 112bc421551SDag-Erling Smørgrav# (and subdirectories). 113bc421551SDag-Erling Smørgrav# TZDIR_BASENAME should not contain "/" and should not be ".", ".." or empty. 114bc421551SDag-Erling SmørgravTZDIR_BASENAME= zoneinfo 115bc421551SDag-Erling SmørgravTZDIR = $(TOPDIR)/$(USRSHAREDIR)/$(TZDIR_BASENAME) 116bc421551SDag-Erling Smørgrav 117bc421551SDag-Erling Smørgrav# The "tzselect" and (if you do "make INSTALL") "date" commands go in: 118bc421551SDag-Erling SmørgravBINDIR = $(TOPDIR)/$(USRDIR)/bin 119bc421551SDag-Erling Smørgrav 120bc421551SDag-Erling Smørgrav# The "zdump" command goes in: 121bc421551SDag-Erling SmørgravZDUMPDIR = $(BINDIR) 122bc421551SDag-Erling Smørgrav 123bc421551SDag-Erling Smørgrav# The "zic" command goes in: 124bc421551SDag-Erling SmørgravZICDIR = $(TOPDIR)/$(USRDIR)/sbin 125bc421551SDag-Erling Smørgrav 126bc421551SDag-Erling Smørgrav# Manual pages go in subdirectories of. . . 127bc421551SDag-Erling SmørgravMANDIR = $(TOPDIR)/$(USRSHAREDIR)/man 128bc421551SDag-Erling Smørgrav 129bc421551SDag-Erling Smørgrav# Library functions are put in an archive in LIBDIR. 130bc421551SDag-Erling SmørgravLIBDIR = $(TOPDIR)/$(USRDIR)/lib 131bc421551SDag-Erling Smørgrav 132bc421551SDag-Erling Smørgrav 133bc421551SDag-Erling Smørgrav# Types to try, as an alternative to time_t. 134bc421551SDag-Erling SmørgravTIME_T_ALTERNATIVES = $(TIME_T_ALTERNATIVES_HEAD) $(TIME_T_ALTERNATIVES_TAIL) 135bc421551SDag-Erling SmørgravTIME_T_ALTERNATIVES_HEAD = int_least64_t 136bc421551SDag-Erling SmørgravTIME_T_ALTERNATIVES_TAIL = int_least32_t uint_least32_t uint_least64_t 137bc421551SDag-Erling Smørgrav 138bc421551SDag-Erling Smørgrav# What kind of TZif data files to generate. (TZif is the binary time 139bc421551SDag-Erling Smørgrav# zone data format that zic generates; see Internet RFC 8536.) 140bc421551SDag-Erling Smørgrav# If you want only POSIX time, with time values interpreted as 141bc421551SDag-Erling Smørgrav# seconds since the epoch (not counting leap seconds), use 142bc421551SDag-Erling Smørgrav# REDO= posix_only 143bc421551SDag-Erling Smørgrav# below. If you want only "right" time, with values interpreted 144bc421551SDag-Erling Smørgrav# as seconds since the epoch (counting leap seconds), use 145bc421551SDag-Erling Smørgrav# REDO= right_only 146bc421551SDag-Erling Smørgrav# below. If you want both sets of data available, with leap seconds not 147bc421551SDag-Erling Smørgrav# counted normally, use 148bc421551SDag-Erling Smørgrav# REDO= posix_right 149bc421551SDag-Erling Smørgrav# below. If you want both sets of data available, with leap seconds counted 150bc421551SDag-Erling Smørgrav# normally, use 151bc421551SDag-Erling Smørgrav# REDO= right_posix 152bc421551SDag-Erling Smørgrav# below. POSIX mandates that leap seconds not be counted; for compatibility 153bc421551SDag-Erling Smørgrav# with it, use "posix_only" or "posix_right". Use POSIX time on systems with 154bc421551SDag-Erling Smørgrav# leap smearing; this can work better than unsmeared "right" time with 155bc421551SDag-Erling Smørgrav# applications that are not leap second aware, and is closer to unsmeared 156bc421551SDag-Erling Smørgrav# "right" time than unsmeared POSIX time is (e.g., 0.5 vs 1.0 s max error). 157bc421551SDag-Erling Smørgrav 158bc421551SDag-Erling SmørgravREDO= posix_right 159bc421551SDag-Erling Smørgrav 160bc421551SDag-Erling Smørgrav# Whether to put an "Expires" line in the leapseconds file. 161bc421551SDag-Erling Smørgrav# Use EXPIRES_LINE=1 to put the line in, 0 to omit it. 162bc421551SDag-Erling Smørgrav# The EXPIRES_LINE value matters only if REDO's value contains "right". 163bc421551SDag-Erling Smørgrav# If you change EXPIRES_LINE, remove the leapseconds file before running "make". 164bc421551SDag-Erling Smørgrav# zic's support for the Expires line was introduced in tzdb 2020a, 165bc421551SDag-Erling Smørgrav# and was modified in tzdb 2021b to generate version 4 TZif files. 166bc421551SDag-Erling Smørgrav# EXPIRES_LINE defaults to 0 for now so that the leapseconds file 167bc421551SDag-Erling Smørgrav# can be given to pre-2020a zic implementations and so that TZif files 168bc421551SDag-Erling Smørgrav# built by newer zic implementations can be read by pre-2021b libraries. 169bc421551SDag-Erling SmørgravEXPIRES_LINE= 0 170bc421551SDag-Erling Smørgrav 171bc421551SDag-Erling Smørgrav# To install data in text form that has all the information of the TZif data, 172bc421551SDag-Erling Smørgrav# (optionally incorporating leap second information), use 173bc421551SDag-Erling Smørgrav# TZDATA_TEXT= tzdata.zi leapseconds 174bc421551SDag-Erling Smørgrav# To install text data without leap second information (e.g., because 175bc421551SDag-Erling Smørgrav# REDO='posix_only'), use 176bc421551SDag-Erling Smørgrav# TZDATA_TEXT= tzdata.zi 177bc421551SDag-Erling Smørgrav# To avoid installing text data, use 178bc421551SDag-Erling Smørgrav# TZDATA_TEXT= 179bc421551SDag-Erling Smørgrav 180bc421551SDag-Erling SmørgravTZDATA_TEXT= leapseconds tzdata.zi 181bc421551SDag-Erling Smørgrav 182bc421551SDag-Erling Smørgrav# For backward-compatibility links for old zone names, use 183bc421551SDag-Erling Smørgrav# BACKWARD= backward 184bc421551SDag-Erling Smørgrav# To omit these links, use 185bc421551SDag-Erling Smørgrav# BACKWARD= 186bc421551SDag-Erling Smørgrav 187bc421551SDag-Erling SmørgravBACKWARD= backward 188bc421551SDag-Erling Smørgrav 189bc421551SDag-Erling Smørgrav# If you want out-of-scope and often-wrong data from the file 'backzone', 190bc421551SDag-Erling Smørgrav# but only for entries listed in the backward-compatibility file zone.tab, use 191bc421551SDag-Erling Smørgrav# PACKRATDATA= backzone 192bc421551SDag-Erling Smørgrav# PACKRATLIST= zone.tab 193bc421551SDag-Erling Smørgrav# If you want all the 'backzone' data, use 194bc421551SDag-Erling Smørgrav# PACKRATDATA= backzone 195bc421551SDag-Erling Smørgrav# PACKRATLIST= 196bc421551SDag-Erling Smørgrav# To omit this data, use 197bc421551SDag-Erling Smørgrav# PACKRATDATA= 198bc421551SDag-Erling Smørgrav# PACKRATLIST= 199bc421551SDag-Erling Smørgrav 200bc421551SDag-Erling SmørgravPACKRATDATA= 201bc421551SDag-Erling SmørgravPACKRATLIST= 202bc421551SDag-Erling Smørgrav 203bc421551SDag-Erling Smørgrav# The name of a locale using the UTF-8 encoding, used during self-tests. 204bc421551SDag-Erling Smørgrav# The tests are skipped if the name does not appear to work on this system. 205bc421551SDag-Erling Smørgrav 206bc421551SDag-Erling SmørgravUTF8_LOCALE= en_US.utf8 207bc421551SDag-Erling Smørgrav 208bc421551SDag-Erling Smørgrav# Non-default libraries needed to link. 209bc421551SDag-Erling Smørgrav# On some hosts, this should have -lintl unless CFLAGS has -DHAVE_GETTEXT=0. 210bc421551SDag-Erling SmørgravLDLIBS= 211bc421551SDag-Erling Smørgrav 212*46c59934SDag-Erling Smørgrav# Add the following to an uncommented "CFLAGS=" line as needed 213*46c59934SDag-Erling Smørgrav# to override defaults specified in the source code or by the system. 214*46c59934SDag-Erling Smørgrav# "-DFOO" is equivalent to "-DFOO=1". 215bc421551SDag-Erling Smørgrav# -DDEPRECATE_TWO_DIGIT_YEARS for optional runtime warnings about strftime 216bc421551SDag-Erling Smørgrav# formats that generate only the last two digits of year numbers 217bc421551SDag-Erling Smørgrav# -DEPOCH_LOCAL if the 'time' function returns local time not UT 218bc421551SDag-Erling Smørgrav# -DEPOCH_OFFSET=N if the 'time' function returns a value N greater 219bc421551SDag-Erling Smørgrav# than what POSIX specifies, assuming local time is UT. 220bc421551SDag-Erling Smørgrav# For example, N is 252460800 on AmigaOS. 221bc421551SDag-Erling Smørgrav# -DHAVE_DECL_ASCTIME_R=0 if <time.h> does not declare asctime_r 222bc421551SDag-Erling Smørgrav# -DHAVE_DECL_ENVIRON if <unistd.h> declares 'environ' 223bc421551SDag-Erling Smørgrav# -DHAVE_DECL_TIMEGM=0 if <time.h> does not declare timegm 224bc421551SDag-Erling Smørgrav# -DHAVE_DIRECT_H if mkdir needs <direct.h> (MS-Windows) 22575411d15SDag-Erling Smørgrav# -DHAVE__GENERIC=0 if _Generic does not work* 226bc421551SDag-Erling Smørgrav# -DHAVE_GETRANDOM if getrandom works (e.g., GNU/Linux), 227bc421551SDag-Erling Smørgrav# -DHAVE_GETRANDOM=0 to avoid using getrandom 228bc421551SDag-Erling Smørgrav# -DHAVE_GETTEXT if gettext works (e.g., GNU/Linux, FreeBSD, Solaris), 229bc421551SDag-Erling Smørgrav# where LDLIBS also needs to contain -lintl on some hosts; 230bc421551SDag-Erling Smørgrav# -DHAVE_GETTEXT=0 to avoid using gettext 231bc421551SDag-Erling Smørgrav# -DHAVE_INCOMPATIBLE_CTIME_R if your system's time.h declares 232bc421551SDag-Erling Smørgrav# ctime_r and asctime_r incompatibly with the POSIX standard 233bc421551SDag-Erling Smørgrav# (Solaris when _POSIX_PTHREAD_SEMANTICS is not defined). 23475411d15SDag-Erling Smørgrav# -DHAVE_INTTYPES_H=0 if <inttypes.h> does not work*+ 235bc421551SDag-Erling Smørgrav# -DHAVE_LINK=0 if your system lacks a link function 236bc421551SDag-Erling Smørgrav# -DHAVE_LOCALTIME_R=0 if your system lacks a localtime_r function 237bc421551SDag-Erling Smørgrav# -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz 238bc421551SDag-Erling Smørgrav# localtime_rz can make zdump significantly faster, but is nonstandard. 239bc421551SDag-Erling Smørgrav# -DHAVE_MALLOC_ERRNO=0 if malloc etc. do not set errno on failure. 240bc421551SDag-Erling Smørgrav# -DHAVE_POSIX_DECLS=0 if your system's include files do not declare 241bc421551SDag-Erling Smørgrav# functions like 'link' or variables like 'tzname' required by POSIX 242bc421551SDag-Erling Smørgrav# -DHAVE_SETENV=0 if your system lacks the setenv function 24375411d15SDag-Erling Smørgrav# -DHAVE_SNPRINTF=0 if your system lacks the snprintf function+ 244bc421551SDag-Erling Smørgrav# -DHAVE_STDCKDINT_H=0 if neither <stdckdint.h> nor substitutes like 245bc421551SDag-Erling Smørgrav# __builtin_add_overflow work* 24675411d15SDag-Erling Smørgrav# -DHAVE_STDINT_H=0 if <stdint.h> does not work*+ 247bc421551SDag-Erling Smørgrav# -DHAVE_STRFTIME_L if <time.h> declares locale_t and strftime_l 248bc421551SDag-Erling Smørgrav# -DHAVE_STRDUP=0 if your system lacks the strdup function 24975411d15SDag-Erling Smørgrav# -DHAVE_STRTOLL=0 if your system lacks the strtoll function+ 250bc421551SDag-Erling Smørgrav# -DHAVE_SYMLINK=0 if your system lacks the symlink function 251bc421551SDag-Erling Smørgrav# -DHAVE_SYS_STAT_H=0 if <sys/stat.h> does not work* 252bc421551SDag-Erling Smørgrav# -DHAVE_TZSET=0 if your system lacks a tzset function 253bc421551SDag-Erling Smørgrav# -DHAVE_UNISTD_H=0 if <unistd.h> does not work* 254bc421551SDag-Erling Smørgrav# -DHAVE_UTMPX_H=0 if <utmpx.h> does not work* 255bc421551SDag-Erling Smørgrav# -Dlocale_t=XXX if your system uses XXX instead of locale_t 256*46c59934SDag-Erling Smørgrav# -DPORT_TO_C89 if tzcode should also run on mostly-C89 platforms+ 257*46c59934SDag-Erling Smørgrav# Typically it is better to use a later standard. For example, 258*46c59934SDag-Erling Smørgrav# with GCC 4.9.4 (2016), prefer '-std=gnu11' to '-DPORT_TO_C89'. 259*46c59934SDag-Erling Smørgrav# Even with -DPORT_TO_C89, the code needs at least one C99 260*46c59934SDag-Erling Smørgrav# feature (integers at least 64 bits wide) and maybe more. 261bc421551SDag-Erling Smørgrav# -DRESERVE_STD_EXT_IDS if your platform reserves standard identifiers 262bc421551SDag-Erling Smørgrav# with external linkage, e.g., applications cannot define 'localtime'. 263bc421551SDag-Erling Smørgrav# -Dssize_t=long on hosts like MS-Windows that lack ssize_t 26475411d15SDag-Erling Smørgrav# -DSUPPORT_C89 if the tzcode library should support C89 callers+ 265*46c59934SDag-Erling Smørgrav# However, this might trigger latent bugs in C99-or-later callers. 266bc421551SDag-Erling Smørgrav# -DSUPPRESS_TZDIR to not prepend TZDIR to file names; this has 267bc421551SDag-Erling Smørgrav# security implications and is not recommended for general use 268bc421551SDag-Erling Smørgrav# -DTHREAD_SAFE to make localtime.c thread-safe, as POSIX requires; 269bc421551SDag-Erling Smørgrav# not needed by the main-program tz code, which is single-threaded. 270bc421551SDag-Erling Smørgrav# Append other compiler flags as needed, e.g., -pthread on GNU/Linux. 271bc421551SDag-Erling Smørgrav# -Dtime_tz=\"T\" to use T as the time_t type, rather than the system time_t 272bc421551SDag-Erling Smørgrav# This is intended for internal use only; it mangles external names. 273bc421551SDag-Erling Smørgrav# -DTZ_DOMAIN=\"foo\" to use "foo" for gettext domain name; default is "tz" 274bc421551SDag-Erling Smørgrav# -DTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory; 275bc421551SDag-Erling Smørgrav# the default is system-supplied, typically "/usr/lib/locale" 276bc421551SDag-Erling Smørgrav# -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified 277*46c59934SDag-Erling Smørgrav# DST transitions for POSIX.1-2017-style TZ strings lacking them, 27875411d15SDag-Erling Smørgrav# in the usual case where POSIXRULES is '-'. If not specified, 27975411d15SDag-Erling Smørgrav# TZDEFRULESTRING defaults to US rules for future DST transitions. 28075411d15SDag-Erling Smørgrav# This mishandles some past timestamps, as US DST rules have changed. 28175411d15SDag-Erling Smørgrav# It also mishandles settings like TZ='EET-2EEST' for eastern Europe, 28275411d15SDag-Erling Smørgrav# as Europe and US DST rules differ. 28375411d15SDag-Erling Smørgrav# -DTZNAME_MAXIMUM=N to limit time zone abbreviations to N bytes (default 255) 284bc421551SDag-Erling Smørgrav# -DUNINIT_TRAP if reading uninitialized storage can cause problems 285bc421551SDag-Erling Smørgrav# other than simply getting garbage data 286bc421551SDag-Erling Smørgrav# -DUSE_LTZ=0 to build zdump with the system time zone library 287bc421551SDag-Erling Smørgrav# Also set TZDOBJS=zdump.o and CHECK_TIME_T_ALTERNATIVES= below. 288bc421551SDag-Erling Smørgrav# -DZIC_BLOAT_DEFAULT=\"fat\" to default zic's -b option to "fat", and 289bc421551SDag-Erling Smørgrav# similarly for "slim". Fat TZif files work around incompatibilities 290bc421551SDag-Erling Smørgrav# and bugs in some TZif readers, notably older ones that 291bc421551SDag-Erling Smørgrav# ignore or otherwise mishandle 64-bit data in TZif files; 292bc421551SDag-Erling Smørgrav# however, fat TZif files may trigger bugs in newer TZif readers. 293bc421551SDag-Erling Smørgrav# Slim TZif files are more efficient, and are the default. 294bc421551SDag-Erling Smørgrav# -DZIC_MAX_ABBR_LEN_WO_WARN=3 295bc421551SDag-Erling Smørgrav# (or some other number) to set the maximum time zone abbreviation length 296bc421551SDag-Erling Smørgrav# that zic will accept without a warning (the default is 6) 297*46c59934SDag-Erling Smørgrav# -g to generate symbolic debugging info 298*46c59934SDag-Erling Smørgrav# -Idir to include from directory 'dir' 299*46c59934SDag-Erling Smørgrav# -O0 to disable optimization; other -O options to enable more optimization 300*46c59934SDag-Erling Smørgrav# -Uname to remove any definition of the macro 'name' 301bc421551SDag-Erling Smørgrav# $(GCC_DEBUG_FLAGS) if you are using recent GCC and want lots of checking 302bc421551SDag-Erling Smørgrav# 303bc421551SDag-Erling Smørgrav# * Options marked "*" can be omitted if your compiler is C23 compatible. 30475411d15SDag-Erling Smørgrav# * Options marked "+" are obsolescent and are planned to be removed 305*46c59934SDag-Erling Smørgrav# once the code assumes C99 or later, say in the year 2029. 306bc421551SDag-Erling Smørgrav# 307bc421551SDag-Erling Smørgrav# Select instrumentation via "make GCC_INSTRUMENT='whatever'". 308bc421551SDag-Erling SmørgravGCC_INSTRUMENT = \ 309bc421551SDag-Erling Smørgrav -fsanitize=undefined -fsanitize-address-use-after-scope \ 310bc421551SDag-Erling Smørgrav -fsanitize-undefined-trap-on-error -fstack-protector 311bc421551SDag-Erling Smørgrav# Omit -fanalyzer from GCC_DEBUG_FLAGS, as it makes GCC too slow. 312bc421551SDag-Erling SmørgravGCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ 313bc421551SDag-Erling Smørgrav $(GCC_INSTRUMENT) \ 314bc421551SDag-Erling Smørgrav -Wall -Wextra \ 315bc421551SDag-Erling Smørgrav -Walloc-size-larger-than=100000 -Warray-bounds=2 \ 316bc421551SDag-Erling Smørgrav -Wbad-function-cast -Wbidi-chars=any,ucn -Wcast-align=strict -Wdate-time \ 317bc421551SDag-Erling Smørgrav -Wdeclaration-after-statement -Wdouble-promotion \ 318bc421551SDag-Erling Smørgrav -Wduplicated-branches -Wduplicated-cond \ 319bc421551SDag-Erling Smørgrav -Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation \ 320bc421551SDag-Erling Smørgrav -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op \ 321bc421551SDag-Erling Smørgrav -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ 322bc421551SDag-Erling Smørgrav -Wnull-dereference \ 323bc421551SDag-Erling Smørgrav -Wold-style-definition -Woverlength-strings -Wpointer-arith \ 324bc421551SDag-Erling Smørgrav -Wshadow -Wshift-overflow=2 -Wstrict-overflow \ 325bc421551SDag-Erling Smørgrav -Wstrict-prototypes -Wstringop-overflow=4 \ 326bc421551SDag-Erling Smørgrav -Wstringop-truncation -Wsuggest-attribute=cold \ 327bc421551SDag-Erling Smørgrav -Wsuggest-attribute=const -Wsuggest-attribute=format \ 328bc421551SDag-Erling Smørgrav -Wsuggest-attribute=malloc \ 329bc421551SDag-Erling Smørgrav -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure \ 330bc421551SDag-Erling Smørgrav -Wtrampolines -Wundef -Wuninitialized -Wunused-macros -Wuse-after-free=3 \ 331bc421551SDag-Erling Smørgrav -Wvariadic-macros -Wvla -Wwrite-strings \ 332bc421551SDag-Erling Smørgrav -Wno-address -Wno-format-nonliteral -Wno-sign-compare \ 333bc421551SDag-Erling Smørgrav -Wno-type-limits 334bc421551SDag-Erling Smørgrav# 335bc421551SDag-Erling Smørgrav# If your system has a "GMT offset" field in its "struct tm"s 336bc421551SDag-Erling Smørgrav# (or if you decide to add such a field in your system's "time.h" file), 337bc421551SDag-Erling Smørgrav# add the name to a define such as 338bc421551SDag-Erling Smørgrav# -DTM_GMTOFF=tm_gmtoff 339bc421551SDag-Erling Smørgrav# to the end of the "CFLAGS=" line. If not defined, the code attempts to 340bc421551SDag-Erling Smørgrav# guess TM_GMTOFF from other macros; define NO_TM_GMTOFF to suppress this. 341bc421551SDag-Erling Smørgrav# Similarly, if your system has a "zone abbreviation" field, define 342bc421551SDag-Erling Smørgrav# -DTM_ZONE=tm_zone 343*46c59934SDag-Erling Smørgrav# and define NO_TM_ZONE to suppress any guessing. 344*46c59934SDag-Erling Smørgrav# Although these two fields are not required by POSIX.1-2017, 345*46c59934SDag-Erling Smørgrav# POSIX 202x/D4 requires them and they are widely available 346*46c59934SDag-Erling Smørgrav# on GNU/Linux and BSD systems. 347bc421551SDag-Erling Smørgrav# 348bc421551SDag-Erling Smørgrav# The next batch of options control support for external variables 349bc421551SDag-Erling Smørgrav# exported by tzcode. In practice these variables are less useful 350bc421551SDag-Erling Smørgrav# than TM_GMTOFF and TM_ZONE. However, most of them are standardized. 351bc421551SDag-Erling Smørgrav# # 352bc421551SDag-Erling Smørgrav# # To omit or support the external variable "tzname", add one of: 353bc421551SDag-Erling Smørgrav# # -DHAVE_TZNAME=0 # do not support "tzname" 354bc421551SDag-Erling Smørgrav# # -DHAVE_TZNAME=1 # support "tzname", which is defined by system library 355bc421551SDag-Erling Smørgrav# # -DHAVE_TZNAME=2 # support and define "tzname" 356*46c59934SDag-Erling Smørgrav# # to the "CFLAGS=" line. "tzname" is required by POSIX.1-1988 and later. 357bc421551SDag-Erling Smørgrav# # If not defined, the code attempts to guess HAVE_TZNAME from other macros. 358bc421551SDag-Erling Smørgrav# # Warning: unless time_tz is also defined, HAVE_TZNAME=1 can cause 359bc421551SDag-Erling Smørgrav# # crashes when combined with some platforms' standard libraries, 360bc421551SDag-Erling Smørgrav# # presumably due to memory allocation issues. 361bc421551SDag-Erling Smørgrav# # 362bc421551SDag-Erling Smørgrav# # To omit or support the external variables "timezone" and "daylight", add 363bc421551SDag-Erling Smørgrav# # -DUSG_COMPAT=0 # do not support 364bc421551SDag-Erling Smørgrav# # -DUSG_COMPAT=1 # support, and variables are defined by system library 365bc421551SDag-Erling Smørgrav# # -DUSG_COMPAT=2 # support and define variables 366*46c59934SDag-Erling Smørgrav# # to the "CFLAGS=" line; "timezone" and "daylight" are inspired by Unix 367*46c59934SDag-Erling Smørgrav# # Systems Group code and are required by POSIX.1-2008 and later (with XSI). 368bc421551SDag-Erling Smørgrav# # If not defined, the code attempts to guess USG_COMPAT from other macros. 369bc421551SDag-Erling Smørgrav# # 370bc421551SDag-Erling Smørgrav# # To support the external variable "altzone", add 371bc421551SDag-Erling Smørgrav# # -DALTZONE=0 # do not support 372bc421551SDag-Erling Smørgrav# # -DALTZONE=1 # support "altzone", which is defined by system library 373bc421551SDag-Erling Smørgrav# # -DALTZONE=2 # support and define "altzone" 374bc421551SDag-Erling Smørgrav# # to the end of the "CFLAGS=" line; although "altzone" appeared in 375bc421551SDag-Erling Smørgrav# # System V Release 3.1 it has not been standardized. 376bc421551SDag-Erling Smørgrav# # If not defined, the code attempts to guess ALTZONE from other macros. 377bc421551SDag-Erling Smørgrav# 378bc421551SDag-Erling Smørgrav# If you want functions that were inspired by early versions of X3J11's work, 379bc421551SDag-Erling Smørgrav# add 380bc421551SDag-Erling Smørgrav# -DSTD_INSPIRED 381bc421551SDag-Erling Smørgrav# to the end of the "CFLAGS=" line. This arranges for the following 382bc421551SDag-Erling Smørgrav# functions to be added to the time conversion library. 383bc421551SDag-Erling Smørgrav# "offtime" is like "gmtime" except that it accepts a second (long) argument 384bc421551SDag-Erling Smørgrav# that gives an offset to add to the time_t when converting it. 385*46c59934SDag-Erling Smørgrav# I.e., "offtime" is like calling "localtime_rz" with a fixed-offset zone. 386*46c59934SDag-Erling Smørgrav# "timelocal" is nearly equivalent to "mktime". 387bc421551SDag-Erling Smørgrav# "timeoff" is like "timegm" except that it accepts a second (long) argument 388bc421551SDag-Erling Smørgrav# that gives an offset to use when converting to a time_t. 389*46c59934SDag-Erling Smørgrav# I.e., "timeoff" is like calling "mktime_z" with a fixed-offset zone. 390bc421551SDag-Erling Smørgrav# "posix2time" and "time2posix" are described in an included manual page. 391bc421551SDag-Erling Smørgrav# X3J11's work does not describe any of these functions. 392bc421551SDag-Erling Smørgrav# These functions may well disappear in future releases of the time 393bc421551SDag-Erling Smørgrav# conversion package. 394bc421551SDag-Erling Smørgrav# 395bc421551SDag-Erling Smørgrav# If you don't want functions that were inspired by NetBSD, add 396bc421551SDag-Erling Smørgrav# -DNETBSD_INSPIRED=0 397bc421551SDag-Erling Smørgrav# to the end of the "CFLAGS=" line. Otherwise, the functions 398bc421551SDag-Erling Smørgrav# "localtime_rz", "mktime_z", "tzalloc", and "tzfree" are added to the 39975411d15SDag-Erling Smørgrav# time library, and if STD_INSPIRED is also defined to nonzero the functions 400bc421551SDag-Erling Smørgrav# "posix2time_z" and "time2posix_z" are added as well. 401bc421551SDag-Erling Smørgrav# The functions ending in "_z" (or "_rz") are like their unsuffixed 402bc421551SDag-Erling Smørgrav# (or suffixed-by-"_r") counterparts, except with an extra first 403bc421551SDag-Erling Smørgrav# argument of opaque type timezone_t that specifies the timezone. 404bc421551SDag-Erling Smørgrav# "tzalloc" allocates a timezone_t value, and "tzfree" frees it. 405bc421551SDag-Erling Smørgrav# 406bc421551SDag-Erling Smørgrav# If you want to allocate state structures in localtime, add 407bc421551SDag-Erling Smørgrav# -DALL_STATE 408bc421551SDag-Erling Smørgrav# to the end of the "CFLAGS=" line. Storage is obtained by calling malloc. 409bc421551SDag-Erling Smørgrav# 410bc421551SDag-Erling Smørgrav# NIST-PCTS:151-2, Version 1.4, (1993-12-03) is a test suite put 411bc421551SDag-Erling Smørgrav# out by the National Institute of Standards and Technology 412*46c59934SDag-Erling Smørgrav# which claims to test C and POSIX conformance. If you want to pass PCTS, add 413bc421551SDag-Erling Smørgrav# -DPCTS 414bc421551SDag-Erling Smørgrav# to the end of the "CFLAGS=" line. 415bc421551SDag-Erling Smørgrav# 416bc421551SDag-Erling Smørgrav# If you want strict compliance with XPG4 as of 1994-04-09, add 417bc421551SDag-Erling Smørgrav# -DXPG4_1994_04_09 418bc421551SDag-Erling Smørgrav# to the end of the "CFLAGS=" line. This causes "strftime" to always return 419bc421551SDag-Erling Smørgrav# 53 as a week number (rather than 52 or 53) for January days before 420bc421551SDag-Erling Smørgrav# January's first Monday when a "%V" format is used and January 1 421bc421551SDag-Erling Smørgrav# falls on a Friday, Saturday, or Sunday. 422*46c59934SDag-Erling Smørgrav# 423*46c59934SDag-Erling Smørgrav# POSIX says CFLAGS defaults to "-O 1". 424*46c59934SDag-Erling Smørgrav# Uncomment the following line and edit its contents as needed. 425bc421551SDag-Erling Smørgrav 426*46c59934SDag-Erling Smørgrav#CFLAGS= -O 1 427bc421551SDag-Erling Smørgrav 428bc421551SDag-Erling Smørgrav 429*46c59934SDag-Erling Smørgrav# The name of a POSIX-like library archiver, its flags, C compiler, 430*46c59934SDag-Erling Smørgrav# linker flags, and 'make' utility. Ordinarily the defaults suffice. 431*46c59934SDag-Erling Smørgrav# The commented-out values are the defaults specified by POSIX.1-202x/D4. 432*46c59934SDag-Erling Smørgrav#AR = ar 433*46c59934SDag-Erling Smørgrav#ARFLAGS = -rv 434*46c59934SDag-Erling Smørgrav#CC = c17 435*46c59934SDag-Erling Smørgrav#LDFLAGS = 436*46c59934SDag-Erling Smørgrav#MAKE = make 437bc421551SDag-Erling Smørgrav 438bc421551SDag-Erling Smørgrav# For leap seconds, this Makefile uses LEAPSECONDS='-L leapseconds' in 439bc421551SDag-Erling Smørgrav# submake command lines. The default is no leap seconds. 440bc421551SDag-Erling Smørgrav 441bc421551SDag-Erling SmørgravLEAPSECONDS= 442bc421551SDag-Erling Smørgrav 443*46c59934SDag-Erling Smørgrav# Where to fetch leap-seconds.list from. 444*46c59934SDag-Erling Smørgravleaplist_URI = \ 445*46c59934SDag-Erling Smørgrav https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list 446*46c59934SDag-Erling Smørgrav# The file is generated by the IERS Earth Orientation Centre, in Paris. 447*46c59934SDag-Erling Smørgravleaplist_TZ = Europe/Paris 448*46c59934SDag-Erling Smørgrav 449bc421551SDag-Erling Smørgrav# The zic command and its arguments. 450bc421551SDag-Erling Smørgrav 451bc421551SDag-Erling Smørgravzic= ./zic 452bc421551SDag-Erling SmørgravZIC= $(zic) $(ZFLAGS) 453bc421551SDag-Erling Smørgrav 454bc421551SDag-Erling Smørgrav# To shrink the size of installed TZif files, 455bc421551SDag-Erling Smørgrav# append "-r @N" to omit data before N-seconds-after-the-Epoch. 456bc421551SDag-Erling Smørgrav# To grow the files and work around bugs in older applications, 457bc421551SDag-Erling Smørgrav# possibly at the expense of introducing bugs in newer ones, 458bc421551SDag-Erling Smørgrav# append "-b fat"; see ZIC_BLOAT_DEFAULT above. 459bc421551SDag-Erling Smørgrav# See the zic man page for more about -b and -r. 460bc421551SDag-Erling SmørgravZFLAGS= 461bc421551SDag-Erling Smørgrav 462bc421551SDag-Erling Smørgrav# How to use zic to install TZif files. 463bc421551SDag-Erling Smørgrav 464bc421551SDag-Erling SmørgravZIC_INSTALL= $(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS) 465bc421551SDag-Erling Smørgrav 466*46c59934SDag-Erling Smørgrav# The name of a POSIX-compliant 'awk' on your system. 467bc421551SDag-Erling Smørgrav# mawk 1.3.3 and Solaris 10 /usr/bin/awk do not work. 468bc421551SDag-Erling Smørgrav# Also, it is better (though not essential) if 'awk' supports UTF-8, 469bc421551SDag-Erling Smørgrav# and unfortunately mawk and busybox awk do not support UTF-8. 470bc421551SDag-Erling Smørgrav# Try AWK=gawk or AWK=nawk if your awk has the abovementioned problems. 471bc421551SDag-Erling SmørgravAWK= awk 472bc421551SDag-Erling Smørgrav 473*46c59934SDag-Erling Smørgrav# The full path name of a POSIX-compliant shell, preferably one that supports 474bc421551SDag-Erling Smørgrav# the Korn shell's 'select' statement as an extension. 475bc421551SDag-Erling Smørgrav# These days, Bash is the most popular. 476bc421551SDag-Erling Smørgrav# It should be OK to set this to /bin/sh, on platforms where /bin/sh 477*46c59934SDag-Erling Smørgrav# lacks 'select' or doesn't completely conform to POSIX, but /bin/bash 478bc421551SDag-Erling Smørgrav# is typically nicer if it works. 479bc421551SDag-Erling SmørgravKSHELL= /bin/bash 480bc421551SDag-Erling Smørgrav 481*46c59934SDag-Erling Smørgrav# Name of curl <https://curl.haxx.se/>, used for HTML validation 482*46c59934SDag-Erling Smørgrav# and to fetch leap-seconds.list from upstream. 483bc421551SDag-Erling SmørgravCURL= curl 484bc421551SDag-Erling Smørgrav 485bc421551SDag-Erling Smørgrav# Name of GNU Privacy Guard <https://gnupg.org/>, used to sign distributions. 486bc421551SDag-Erling SmørgravGPG= gpg 487bc421551SDag-Erling Smørgrav 488bc421551SDag-Erling Smørgrav# This expensive test requires USE_LTZ. 489bc421551SDag-Erling Smørgrav# To suppress it, define this macro to be empty. 490bc421551SDag-Erling SmørgravCHECK_TIME_T_ALTERNATIVES = check_time_t_alternatives 491bc421551SDag-Erling Smørgrav 492bc421551SDag-Erling Smørgrav# SAFE_CHAR is a regular expression that matches a safe character. 493bc421551SDag-Erling Smørgrav# Some parts of this distribution are limited to safe characters; 494bc421551SDag-Erling Smørgrav# others can use any UTF-8 character. 495bc421551SDag-Erling Smørgrav# For now, the safe characters are a safe subset of ASCII. 496bc421551SDag-Erling Smørgrav# The caller must set the shell variable 'sharp' to the character '#', 497bc421551SDag-Erling Smørgrav# since Makefile macros cannot contain '#'. 498bc421551SDag-Erling Smørgrav# TAB_CHAR is a single tab character, in single quotes. 499bc421551SDag-Erling SmørgravTAB_CHAR= ' ' 500bc421551SDag-Erling SmørgravSAFE_CHARSET1= $(TAB_CHAR)' !\"'$$sharp'$$%&'\''()*+,./0123456789:;<=>?@' 501bc421551SDag-Erling SmørgravSAFE_CHARSET2= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\^_`' 502bc421551SDag-Erling SmørgravSAFE_CHARSET3= 'abcdefghijklmnopqrstuvwxyz{|}~' 503bc421551SDag-Erling SmørgravSAFE_CHARSET= $(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3) 504bc421551SDag-Erling SmørgravSAFE_CHAR= '[]'$(SAFE_CHARSET)'-]' 505bc421551SDag-Erling Smørgrav 50675411d15SDag-Erling Smørgrav# These non-alphabetic, non-ASCII printable characters are Latin-1, 50775411d15SDag-Erling Smørgrav# and so are likely displayable even in editors like XEmacs 21 50875411d15SDag-Erling Smørgrav# that have limited display capabilities. 50975411d15SDag-Erling SmørgravUNUSUAL_OK_LATIN_1 = ¡¢£¤¥¦§¨©«¬®¯°±²³´¶·¸¹»¼½¾¿×÷ 510bc421551SDag-Erling Smørgrav# Non-ASCII non-letters that OK_CHAR allows, as these characters are 511bc421551SDag-Erling Smørgrav# useful in commentary. 51275411d15SDag-Erling SmørgravUNUSUAL_OK_CHARSET= $(UNUSUAL_OK_LATIN_1) 513bc421551SDag-Erling Smørgrav 514bc421551SDag-Erling Smørgrav# Put this in a bracket expression to match spaces. 515bc421551SDag-Erling Smørgravs = [:space:] 516bc421551SDag-Erling Smørgrav 517bc421551SDag-Erling Smørgrav# OK_CHAR matches any character allowed in the distributed files. 518bc421551SDag-Erling Smørgrav# This is the same as SAFE_CHAR, except that UNUSUAL_OK_CHARSET and 519bc421551SDag-Erling Smørgrav# multibyte letters are also allowed so that commentary can contain a 520bc421551SDag-Erling Smørgrav# few safe symbols and people's names and can quote non-English sources. 521bc421551SDag-Erling Smørgrav# Other non-letters are limited to ASCII renderings for the 522bc421551SDag-Erling Smørgrav# convenience of maintainers using XEmacs 21.5.34, which by default 523bc421551SDag-Erling Smørgrav# mishandles Unicode characters U+0100 and greater. 524bc421551SDag-Erling SmørgravOK_CHAR= '[][:alpha:]$(UNUSUAL_OK_CHARSET)'$(SAFE_CHARSET)'-]' 525bc421551SDag-Erling Smørgrav 526bc421551SDag-Erling Smørgrav# SAFE_LINE matches a line of safe characters. 527bc421551SDag-Erling Smørgrav# SAFE_SHARP_LINE is similar, except any OK character can follow '#'; 528bc421551SDag-Erling Smørgrav# this is so that comments can contain non-ASCII characters. 529bc421551SDag-Erling Smørgrav# OK_LINE matches a line of OK characters. 530bc421551SDag-Erling SmørgravSAFE_LINE= '^'$(SAFE_CHAR)'*$$' 531bc421551SDag-Erling SmørgravSAFE_SHARP_LINE='^'$(SAFE_CHAR)'*('$$sharp$(OK_CHAR)'*)?$$' 532bc421551SDag-Erling SmørgravOK_LINE= '^'$(OK_CHAR)'*$$' 533bc421551SDag-Erling Smørgrav 534bc421551SDag-Erling Smørgrav# Flags to give 'tar' when making a distribution. 535bc421551SDag-Erling Smørgrav# Try to use flags appropriate for GNU tar. 536bc421551SDag-Erling SmørgravGNUTARFLAGS= --format=pax --pax-option='delete=atime,delete=ctime' \ 537bc421551SDag-Erling Smørgrav --numeric-owner --owner=0 --group=0 \ 538bc421551SDag-Erling Smørgrav --mode=go+u,go-w --sort=name 539bc421551SDag-Erling SmørgravTARFLAGS= `if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \ 540bc421551SDag-Erling Smørgrav then echo $(GNUTARFLAGS); \ 541bc421551SDag-Erling Smørgrav else :; \ 542bc421551SDag-Erling Smørgrav fi` 543bc421551SDag-Erling Smørgrav 544bc421551SDag-Erling Smørgrav# Flags to give 'gzip' when making a distribution. 545bc421551SDag-Erling SmørgravGZIPFLAGS= -9n 546bc421551SDag-Erling Smørgrav 547bc421551SDag-Erling Smørgrav# When comparing .tzs files, use GNU diff's -F'^TZ=' option if supported. 548bc421551SDag-Erling Smørgrav# This makes it easier to see which Zone has been affected. 549bc421551SDag-Erling SmørgravDIFF_TZS= diff -u$$(! diff -u -F'^TZ=' - - <>/dev/null >&0 2>&1 \ 550bc421551SDag-Erling Smørgrav || echo ' -F^TZ=') 551bc421551SDag-Erling Smørgrav 552bc421551SDag-Erling Smørgrav# ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib. 553bc421551SDag-Erling SmørgravRANLIB= : 554bc421551SDag-Erling Smørgrav 555*46c59934SDag-Erling Smørgrav# POSIX prohibits defining or using SHELL. However, csh users on systems 556*46c59934SDag-Erling Smørgrav# that use the user shell for Makefile commands may need to define SHELL. 557*46c59934SDag-Erling Smørgrav#SHELL= /bin/sh 558*46c59934SDag-Erling Smørgrav 559*46c59934SDag-Erling Smørgrav# End of macros that one plausibly might want to tailor. 560*46c59934SDag-Erling Smørgrav############################################################################### 561*46c59934SDag-Erling Smørgrav 562*46c59934SDag-Erling Smørgrav 563bc421551SDag-Erling SmørgravTZCOBJS= zic.o 564bc421551SDag-Erling SmørgravTZDOBJS= zdump.o localtime.o asctime.o strftime.o 565bc421551SDag-Erling SmørgravDATEOBJS= date.o localtime.o strftime.o asctime.o 566bc421551SDag-Erling SmørgravLIBSRCS= localtime.c asctime.c difftime.c strftime.c 567bc421551SDag-Erling SmørgravLIBOBJS= localtime.o asctime.o difftime.o strftime.o 568bc421551SDag-Erling SmørgravHEADERS= tzfile.h private.h 569bc421551SDag-Erling SmørgravNONLIBSRCS= zic.c zdump.c 570bc421551SDag-Erling SmørgravNEWUCBSRCS= date.c 571bc421551SDag-Erling SmørgravSOURCES= $(HEADERS) $(LIBSRCS) $(NONLIBSRCS) $(NEWUCBSRCS) \ 572bc421551SDag-Erling Smørgrav tzselect.ksh workman.sh 573bc421551SDag-Erling SmørgravMANS= newctime.3 newstrftime.3 newtzset.3 time2posix.3 \ 574bc421551SDag-Erling Smørgrav tzfile.5 tzselect.8 zic.8 zdump.8 575bc421551SDag-Erling SmørgravMANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.txt \ 576bc421551SDag-Erling Smørgrav time2posix.3.txt \ 577bc421551SDag-Erling Smørgrav tzfile.5.txt tzselect.8.txt zic.8.txt zdump.8.txt \ 578bc421551SDag-Erling Smørgrav date.1.txt 579bc421551SDag-Erling SmørgravCOMMON= calendars CONTRIBUTING LICENSE Makefile \ 580bc421551SDag-Erling Smørgrav NEWS README SECURITY theory.html version 581bc421551SDag-Erling SmørgravWEB_PAGES= tz-art.html tz-how-to.html tz-link.html 582bc421551SDag-Erling SmørgravCHECK_WEB_PAGES=check_theory.html check_tz-art.html \ 583bc421551SDag-Erling Smørgrav check_tz-how-to.html check_tz-link.html 584bc421551SDag-Erling SmørgravDOCS= $(MANS) date.1 $(MANTXTS) $(WEB_PAGES) 585bc421551SDag-Erling SmørgravPRIMARY_YDATA= africa antarctica asia australasia \ 586bc421551SDag-Erling Smørgrav europe northamerica southamerica 587bc421551SDag-Erling SmørgravYDATA= $(PRIMARY_YDATA) etcetera 588bc421551SDag-Erling SmørgravNDATA= factory 589bc421551SDag-Erling SmørgravTDATA_TO_CHECK= $(YDATA) $(NDATA) backward 590bc421551SDag-Erling SmørgravTDATA= $(YDATA) $(NDATA) $(BACKWARD) 591*46c59934SDag-Erling SmørgravZONETABLES= zone.tab zone1970.tab zonenow.tab 592bc421551SDag-Erling SmørgravTABDATA= iso3166.tab $(TZDATA_TEXT) $(ZONETABLES) 593bc421551SDag-Erling SmørgravLEAP_DEPS= leapseconds.awk leap-seconds.list 594bc421551SDag-Erling SmørgravTZDATA_ZI_DEPS= ziguard.awk zishrink.awk version $(TDATA) \ 595bc421551SDag-Erling Smørgrav $(PACKRATDATA) $(PACKRATLIST) 596bc421551SDag-Erling SmørgravDSTDATA_ZI_DEPS= ziguard.awk $(TDATA) $(PACKRATDATA) $(PACKRATLIST) 597bc421551SDag-Erling SmørgravDATA= $(TDATA_TO_CHECK) backzone iso3166.tab leap-seconds.list \ 598bc421551SDag-Erling Smørgrav leapseconds $(ZONETABLES) 599*46c59934SDag-Erling SmørgravAWK_SCRIPTS= checklinks.awk checknow.awk checktab.awk leapseconds.awk \ 600bc421551SDag-Erling Smørgrav ziguard.awk zishrink.awk 601bc421551SDag-Erling SmørgravMISC= $(AWK_SCRIPTS) 602bc421551SDag-Erling SmørgravTZS_YEAR= 2050 603bc421551SDag-Erling SmørgravTZS_CUTOFF_FLAG= -c $(TZS_YEAR) 604bc421551SDag-Erling SmørgravTZS= to$(TZS_YEAR).tzs 605bc421551SDag-Erling SmørgravTZS_NEW= to$(TZS_YEAR)new.tzs 606bc421551SDag-Erling SmørgravTZS_DEPS= $(YDATA) asctime.c localtime.c \ 607bc421551SDag-Erling Smørgrav private.h tzfile.h zdump.c zic.c 608bc421551SDag-Erling SmørgravTZDATA_DIST = $(COMMON) $(DATA) $(MISC) 609bc421551SDag-Erling Smørgrav# EIGHT_YARDS is just a yard short of the whole ENCHILADA. 610bc421551SDag-Erling SmørgravEIGHT_YARDS = $(TZDATA_DIST) $(DOCS) $(SOURCES) tzdata.zi 611bc421551SDag-Erling SmørgravENCHILADA = $(EIGHT_YARDS) $(TZS) 612bc421551SDag-Erling Smørgrav 613bc421551SDag-Erling Smørgrav# Consult these files when deciding whether to rebuild the 'version' file. 614bc421551SDag-Erling Smørgrav# This list is not the same as the output of 'git ls-files', since 615bc421551SDag-Erling Smørgrav# .gitignore is not distributed. 616bc421551SDag-Erling SmørgravVERSION_DEPS= \ 617bc421551SDag-Erling Smørgrav calendars CONTRIBUTING LICENSE Makefile NEWS README SECURITY \ 618bc421551SDag-Erling Smørgrav africa antarctica asctime.c asia australasia \ 619bc421551SDag-Erling Smørgrav backward backzone \ 620*46c59934SDag-Erling Smørgrav checklinks.awk checknow.awk checktab.awk \ 621bc421551SDag-Erling Smørgrav date.1 date.c difftime.c \ 622bc421551SDag-Erling Smørgrav etcetera europe factory iso3166.tab \ 623bc421551SDag-Erling Smørgrav leap-seconds.list leapseconds.awk localtime.c \ 624bc421551SDag-Erling Smørgrav newctime.3 newstrftime.3 newtzset.3 northamerica \ 625bc421551SDag-Erling Smørgrav private.h southamerica strftime.c theory.html \ 626bc421551SDag-Erling Smørgrav time2posix.3 tz-art.html tz-how-to.html tz-link.html \ 627bc421551SDag-Erling Smørgrav tzfile.5 tzfile.h tzselect.8 tzselect.ksh \ 628bc421551SDag-Erling Smørgrav workman.sh zdump.8 zdump.c zic.8 zic.c \ 629bc421551SDag-Erling Smørgrav ziguard.awk zishrink.awk \ 630*46c59934SDag-Erling Smørgrav zone.tab zone1970.tab zonenow.tab 631bc421551SDag-Erling Smørgrav 632bc421551SDag-Erling Smørgravall: tzselect zic zdump libtz.a $(TABDATA) \ 633bc421551SDag-Erling Smørgrav vanguard.zi main.zi rearguard.zi 634bc421551SDag-Erling Smørgrav 635bc421551SDag-Erling SmørgravALL: all date $(ENCHILADA) 636bc421551SDag-Erling Smørgrav 637bc421551SDag-Erling Smørgravinstall: all $(DATA) $(REDO) $(MANS) 638bc421551SDag-Erling Smørgrav mkdir -p '$(DESTDIR)$(BINDIR)' \ 639bc421551SDag-Erling Smørgrav '$(DESTDIR)$(ZDUMPDIR)' '$(DESTDIR)$(ZICDIR)' \ 640bc421551SDag-Erling Smørgrav '$(DESTDIR)$(LIBDIR)' \ 641bc421551SDag-Erling Smørgrav '$(DESTDIR)$(MANDIR)/man3' '$(DESTDIR)$(MANDIR)/man5' \ 642bc421551SDag-Erling Smørgrav '$(DESTDIR)$(MANDIR)/man8' 643bc421551SDag-Erling Smørgrav $(ZIC_INSTALL) -l $(LOCALTIME) \ 644bc421551SDag-Erling Smørgrav `case '$(POSIXRULES)' in ?*) echo '-p';; esac \ 645bc421551SDag-Erling Smørgrav ` $(POSIXRULES) \ 646bc421551SDag-Erling Smørgrav -t '$(DESTDIR)$(TZDEFAULT)' 647bc421551SDag-Erling Smørgrav cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.' 648bc421551SDag-Erling Smørgrav cp tzselect '$(DESTDIR)$(BINDIR)/.' 649bc421551SDag-Erling Smørgrav cp zdump '$(DESTDIR)$(ZDUMPDIR)/.' 650bc421551SDag-Erling Smørgrav cp zic '$(DESTDIR)$(ZICDIR)/.' 651bc421551SDag-Erling Smørgrav cp libtz.a '$(DESTDIR)$(LIBDIR)/.' 652bc421551SDag-Erling Smørgrav $(RANLIB) '$(DESTDIR)$(LIBDIR)/libtz.a' 653bc421551SDag-Erling Smørgrav cp -f newctime.3 newtzset.3 '$(DESTDIR)$(MANDIR)/man3/.' 654bc421551SDag-Erling Smørgrav cp -f tzfile.5 '$(DESTDIR)$(MANDIR)/man5/.' 655bc421551SDag-Erling Smørgrav cp -f tzselect.8 zdump.8 zic.8 '$(DESTDIR)$(MANDIR)/man8/.' 656bc421551SDag-Erling Smørgrav 657bc421551SDag-Erling SmørgravINSTALL: ALL install date.1 658bc421551SDag-Erling Smørgrav mkdir -p '$(DESTDIR)$(BINDIR)' '$(DESTDIR)$(MANDIR)/man1' 659bc421551SDag-Erling Smørgrav cp date '$(DESTDIR)$(BINDIR)/.' 660bc421551SDag-Erling Smørgrav cp -f date.1 '$(DESTDIR)$(MANDIR)/man1/.' 661bc421551SDag-Erling Smørgrav 662bc421551SDag-Erling Smørgrav# Calculate version number from git, if available. 663bc421551SDag-Erling Smørgrav# Otherwise, use $(VERSION) unless it is "unknown" and there is already 664bc421551SDag-Erling Smørgrav# a 'version' file, in which case reuse the existing 'version' contents 665bc421551SDag-Erling Smørgrav# and append "-dirty" if the contents do not already end in "-dirty". 666bc421551SDag-Erling Smørgravversion: $(VERSION_DEPS) 667bc421551SDag-Erling Smørgrav { (type git) >/dev/null 2>&1 && \ 668bc421551SDag-Erling Smørgrav V=`git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \ 669bc421551SDag-Erling Smørgrav --abbrev=7 --dirty` || \ 670bc421551SDag-Erling Smørgrav if test '$(VERSION)' = unknown && V=`cat $@`; then \ 671bc421551SDag-Erling Smørgrav case $$V in *-dirty);; *) V=$$V-dirty;; esac; \ 672bc421551SDag-Erling Smørgrav else \ 673bc421551SDag-Erling Smørgrav V='$(VERSION)'; \ 674bc421551SDag-Erling Smørgrav fi; } && \ 675bc421551SDag-Erling Smørgrav printf '%s\n' "$$V" >$@.out 676bc421551SDag-Erling Smørgrav mv $@.out $@ 677bc421551SDag-Erling Smørgrav 678bc421551SDag-Erling Smørgrav# These files can be tailored by setting BACKWARD, PACKRATDATA, PACKRATLIST. 679bc421551SDag-Erling Smørgravvanguard.zi main.zi rearguard.zi: $(DSTDATA_ZI_DEPS) 680bc421551SDag-Erling Smørgrav $(AWK) \ 681bc421551SDag-Erling Smørgrav -v DATAFORM=`expr $@ : '\(.*\).zi'` \ 682bc421551SDag-Erling Smørgrav -v PACKRATDATA='$(PACKRATDATA)' \ 683bc421551SDag-Erling Smørgrav -v PACKRATLIST='$(PACKRATLIST)' \ 684bc421551SDag-Erling Smørgrav -f ziguard.awk \ 685bc421551SDag-Erling Smørgrav $(TDATA) $(PACKRATDATA) >$@.out 686bc421551SDag-Erling Smørgrav mv $@.out $@ 687bc421551SDag-Erling Smørgrav# This file has a version comment that attempts to capture any tailoring 688bc421551SDag-Erling Smørgrav# via BACKWARD, DATAFORM, PACKRATDATA, PACKRATLIST, and REDO. 689bc421551SDag-Erling Smørgravtzdata.zi: $(DATAFORM).zi version zishrink.awk 690bc421551SDag-Erling Smørgrav version=`sed 1q version` && \ 691bc421551SDag-Erling Smørgrav LC_ALL=C $(AWK) \ 692bc421551SDag-Erling Smørgrav -v dataform='$(DATAFORM)' \ 693bc421551SDag-Erling Smørgrav -v deps='$(DSTDATA_ZI_DEPS) zishrink.awk' \ 694bc421551SDag-Erling Smørgrav -v redo='$(REDO)' \ 695bc421551SDag-Erling Smørgrav -v version="$$version" \ 696bc421551SDag-Erling Smørgrav -f zishrink.awk \ 697bc421551SDag-Erling Smørgrav $(DATAFORM).zi >$@.out 698bc421551SDag-Erling Smørgrav mv $@.out $@ 699bc421551SDag-Erling Smørgrav 700*46c59934SDag-Erling Smørgravtzdir.h: 701*46c59934SDag-Erling Smørgrav printf '%s\n' >$@.out \ 702*46c59934SDag-Erling Smørgrav '#ifndef TZDEFAULT' \ 703*46c59934SDag-Erling Smørgrav '# define TZDEFAULT "$(TZDEFAULT)" /* default zone */' \ 704*46c59934SDag-Erling Smørgrav '#endif' \ 705*46c59934SDag-Erling Smørgrav '#ifndef TZDIR' \ 706*46c59934SDag-Erling Smørgrav '# define TZDIR "$(TZDIR)" /* TZif directory */' \ 707*46c59934SDag-Erling Smørgrav '#endif' 708*46c59934SDag-Erling Smørgrav mv $@.out $@ 709*46c59934SDag-Erling Smørgrav 710bc421551SDag-Erling Smørgravversion.h: version 711bc421551SDag-Erling Smørgrav VERSION=`cat version` && printf '%s\n' \ 712bc421551SDag-Erling Smørgrav 'static char const PKGVERSION[]="($(PACKAGE)) ";' \ 713bc421551SDag-Erling Smørgrav "static char const TZVERSION[]=\"$$VERSION\";" \ 714bc421551SDag-Erling Smørgrav 'static char const REPORT_BUGS_TO[]="$(BUGEMAIL)";' \ 715bc421551SDag-Erling Smørgrav >$@.out 716bc421551SDag-Erling Smørgrav mv $@.out $@ 717bc421551SDag-Erling Smørgrav 718bc421551SDag-Erling Smørgravzdump: $(TZDOBJS) 719bc421551SDag-Erling Smørgrav $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS) 720bc421551SDag-Erling Smørgrav 721bc421551SDag-Erling Smørgravzic: $(TZCOBJS) 722bc421551SDag-Erling Smørgrav $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS) 723bc421551SDag-Erling Smørgrav 724bc421551SDag-Erling Smørgravleapseconds: $(LEAP_DEPS) 725bc421551SDag-Erling Smørgrav $(AWK) -v EXPIRES_LINE=$(EXPIRES_LINE) \ 726bc421551SDag-Erling Smørgrav -f leapseconds.awk leap-seconds.list >$@.out 727bc421551SDag-Erling Smørgrav mv $@.out $@ 728bc421551SDag-Erling Smørgrav 729*46c59934SDag-Erling Smørgrav# Awk script to extract a Git-style author from leap-seconds.list comments. 730*46c59934SDag-Erling SmørgravEXTRACT_AUTHOR = \ 731*46c59934SDag-Erling Smørgrav author_line { sub(/^.[[:space:]]*/, ""); \ 732*46c59934SDag-Erling Smørgrav sub(/:[[:space:]]*/, " <"); \ 733*46c59934SDag-Erling Smørgrav printf "%s>\n", $$0; \ 734*46c59934SDag-Erling Smørgrav success = 1; \ 735*46c59934SDag-Erling Smørgrav exit \ 736*46c59934SDag-Erling Smørgrav } \ 737*46c59934SDag-Erling Smørgrav /Questions or comments to:/ { author_line = 1 } \ 738*46c59934SDag-Erling Smørgrav END { exit !success } 739*46c59934SDag-Erling Smørgrav 740*46c59934SDag-Erling Smørgrav# Fetch leap-seconds.list from upstream. 741*46c59934SDag-Erling Smørgravfetch-leap-seconds.list: 742*46c59934SDag-Erling Smørgrav $(CURL) -OR $(leaplist_URI) 743*46c59934SDag-Erling Smørgrav 744*46c59934SDag-Erling Smørgrav# Fetch leap-seconds.list from upstream and commit it to the local repository. 745*46c59934SDag-Erling Smørgravcommit-leap-seconds.list: fetch-leap-seconds.list 746*46c59934SDag-Erling Smørgrav author=$$($(AWK) '$(EXTRACT_AUTHOR)' leap-seconds.list) && \ 747*46c59934SDag-Erling Smørgrav date=$$(TZ=$(leaplist_TZ) stat -c%y leap-seconds.list) && \ 748*46c59934SDag-Erling Smørgrav git commit --author="$$author" --date="$$date" -m'make $@' \ 749*46c59934SDag-Erling Smørgrav leap-seconds.list 750*46c59934SDag-Erling Smørgrav 751bc421551SDag-Erling Smørgrav# Arguments to pass to submakes of install_data. 752bc421551SDag-Erling Smørgrav# They can be overridden by later submake arguments. 753bc421551SDag-Erling SmørgravINSTALLARGS = \ 754bc421551SDag-Erling Smørgrav BACKWARD='$(BACKWARD)' \ 755bc421551SDag-Erling Smørgrav DESTDIR='$(DESTDIR)' \ 756bc421551SDag-Erling Smørgrav LEAPSECONDS='$(LEAPSECONDS)' \ 757bc421551SDag-Erling Smørgrav PACKRATDATA='$(PACKRATDATA)' \ 758bc421551SDag-Erling Smørgrav PACKRATLIST='$(PACKRATLIST)' \ 759bc421551SDag-Erling Smørgrav TZDEFAULT='$(TZDEFAULT)' \ 760bc421551SDag-Erling Smørgrav TZDIR='$(TZDIR)' \ 761bc421551SDag-Erling Smørgrav ZIC='$(ZIC)' 762bc421551SDag-Erling Smørgrav 763bc421551SDag-Erling SmørgravINSTALL_DATA_DEPS = zic leapseconds tzdata.zi 764bc421551SDag-Erling Smørgrav 765bc421551SDag-Erling Smørgrav# 'make install_data' installs one set of TZif files. 766bc421551SDag-Erling Smørgravinstall_data: $(INSTALL_DATA_DEPS) 767bc421551SDag-Erling Smørgrav $(ZIC_INSTALL) tzdata.zi 768bc421551SDag-Erling Smørgrav 769bc421551SDag-Erling Smørgravposix_only: $(INSTALL_DATA_DEPS) 770bc421551SDag-Erling Smørgrav $(MAKE) $(INSTALLARGS) LEAPSECONDS= install_data 771bc421551SDag-Erling Smørgrav 772bc421551SDag-Erling Smørgravright_only: $(INSTALL_DATA_DEPS) 773bc421551SDag-Erling Smørgrav $(MAKE) $(INSTALLARGS) LEAPSECONDS='-L leapseconds' \ 774bc421551SDag-Erling Smørgrav install_data 775bc421551SDag-Erling Smørgrav 776bc421551SDag-Erling Smørgrav# In earlier versions of this makefile, the other two directories were 777bc421551SDag-Erling Smørgrav# subdirectories of $(TZDIR). However, this led to configuration errors. 778bc421551SDag-Erling Smørgrav# For example, with posix_right under the earlier scheme, 779bc421551SDag-Erling Smørgrav# TZ='right/Australia/Adelaide' got you localtime with leap seconds, 780bc421551SDag-Erling Smørgrav# but gmtime without leap seconds, which led to problems with applications 781bc421551SDag-Erling Smørgrav# like sendmail that subtract gmtime from localtime. 782bc421551SDag-Erling Smørgrav# Therefore, the other two directories are now siblings of $(TZDIR). 783bc421551SDag-Erling Smørgrav# You must replace all of $(TZDIR) to switch from not using leap seconds 784bc421551SDag-Erling Smørgrav# to using them, or vice versa. 785bc421551SDag-Erling Smørgravright_posix: right_only 786bc421551SDag-Erling Smørgrav rm -fr '$(DESTDIR)$(TZDIR)-leaps' 787bc421551SDag-Erling Smørgrav ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-leaps' || \ 788bc421551SDag-Erling Smørgrav $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only 789bc421551SDag-Erling Smørgrav $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only 790bc421551SDag-Erling Smørgrav 791bc421551SDag-Erling Smørgravposix_right: posix_only 792bc421551SDag-Erling Smørgrav rm -fr '$(DESTDIR)$(TZDIR)-posix' 793bc421551SDag-Erling Smørgrav ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-posix' || \ 794bc421551SDag-Erling Smørgrav $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only 795bc421551SDag-Erling Smørgrav $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only 796bc421551SDag-Erling Smørgrav 797bc421551SDag-Erling Smørgravzones: $(REDO) 798bc421551SDag-Erling Smørgrav 799bc421551SDag-Erling Smørgrav# dummy.zd is not a real file; it is mentioned here only so that the 800bc421551SDag-Erling Smørgrav# top-level 'make' does not have a syntax error. 801bc421551SDag-Erling SmørgravZDS = dummy.zd 802bc421551SDag-Erling Smørgrav# Rule used only by submakes invoked by the $(TZS_NEW) rule. 803bc421551SDag-Erling Smørgrav# It is separate so that GNU 'make -j' can run instances in parallel. 804bc421551SDag-Erling Smørgrav$(ZDS): zdump 805bc421551SDag-Erling Smørgrav ./zdump -i $(TZS_CUTOFF_FLAG) '$(wd)/'$$(expr $@ : '\(.*\).zd') \ 806bc421551SDag-Erling Smørgrav >$@ 807bc421551SDag-Erling Smørgrav 808bc421551SDag-Erling SmørgravTZS_NEW_DEPS = tzdata.zi zdump zic 809bc421551SDag-Erling Smørgrav$(TZS_NEW): $(TZS_NEW_DEPS) 810bc421551SDag-Erling Smørgrav rm -fr tzs$(TZS_YEAR).dir 811bc421551SDag-Erling Smørgrav mkdir tzs$(TZS_YEAR).dir 812bc421551SDag-Erling Smørgrav $(zic) -d tzs$(TZS_YEAR).dir tzdata.zi 813bc421551SDag-Erling Smørgrav $(AWK) '/^L/{print "Link\t" $$2 "\t" $$3}' \ 814bc421551SDag-Erling Smørgrav tzdata.zi | LC_ALL=C sort >$@.out 815bc421551SDag-Erling Smørgrav wd=`pwd` && \ 816bc421551SDag-Erling Smørgrav x=`$(AWK) '/^Z/{print "tzs$(TZS_YEAR).dir/" $$2 ".zd"}' \ 817bc421551SDag-Erling Smørgrav tzdata.zi \ 818bc421551SDag-Erling Smørgrav | LC_ALL=C sort -t . -k 2,2` && \ 819bc421551SDag-Erling Smørgrav set x $$x && \ 820bc421551SDag-Erling Smørgrav shift && \ 821bc421551SDag-Erling Smørgrav ZDS=$$* && \ 822bc421551SDag-Erling Smørgrav $(MAKE) wd="$$wd" TZS_CUTOFF_FLAG="$(TZS_CUTOFF_FLAG)" \ 823bc421551SDag-Erling Smørgrav ZDS="$$ZDS" $$ZDS && \ 824bc421551SDag-Erling Smørgrav sed 's,^TZ=".*\.dir/,TZ=",' $$ZDS >>$@.out 825bc421551SDag-Erling Smørgrav rm -fr tzs$(TZS_YEAR).dir 826bc421551SDag-Erling Smørgrav mv $@.out $@ 827bc421551SDag-Erling Smørgrav 828bc421551SDag-Erling Smørgrav# If $(TZS) exists but 'make check_tzs' fails, a maintainer should inspect the 829bc421551SDag-Erling Smørgrav# failed output and fix the inconsistency, perhaps by running 'make force_tzs'. 830bc421551SDag-Erling Smørgrav$(TZS): 831bc421551SDag-Erling Smørgrav touch $@ 832bc421551SDag-Erling Smørgrav 833bc421551SDag-Erling Smørgravforce_tzs: $(TZS_NEW) 834bc421551SDag-Erling Smørgrav cp $(TZS_NEW) $(TZS) 835bc421551SDag-Erling Smørgrav 836bc421551SDag-Erling Smørgravlibtz.a: $(LIBOBJS) 837bc421551SDag-Erling Smørgrav rm -f $@ 838*46c59934SDag-Erling Smørgrav $(AR) $(ARFLAGS) $@ $(LIBOBJS) 839bc421551SDag-Erling Smørgrav $(RANLIB) $@ 840bc421551SDag-Erling Smørgrav 841bc421551SDag-Erling Smørgravdate: $(DATEOBJS) 842bc421551SDag-Erling Smørgrav $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS) 843bc421551SDag-Erling Smørgrav 844bc421551SDag-Erling Smørgravtzselect: tzselect.ksh version 845bc421551SDag-Erling Smørgrav VERSION=`cat version` && sed \ 846*46c59934SDag-Erling Smørgrav -e "s'#!/bin/bash'#!"'$(KSHELL)'\' \ 847*46c59934SDag-Erling Smørgrav -e s\''\(AWK\)=[^}]*'\''\1=\'\''$(AWK)\'\'\' \ 848*46c59934SDag-Erling Smørgrav -e s\''\(PKGVERSION\)=.*'\''\1=\'\''($(PACKAGE)) \'\'\' \ 849*46c59934SDag-Erling Smørgrav -e s\''\(REPORT_BUGS_TO\)=.*'\''\1=\'\''$(BUGEMAIL)\'\'\' \ 850*46c59934SDag-Erling Smørgrav -e s\''\(TZDIR\)=[^}]*'\''\1=\'\''$(TZDIR)\'\'\' \ 851*46c59934SDag-Erling Smørgrav -e s\''\(TZVERSION\)=.*'\''\1=\'"'$$VERSION\\''" \ 852bc421551SDag-Erling Smørgrav <$@.ksh >$@.out 853bc421551SDag-Erling Smørgrav chmod +x $@.out 854bc421551SDag-Erling Smørgrav mv $@.out $@ 855bc421551SDag-Erling Smørgrav 856bc421551SDag-Erling Smørgravcheck: check_back check_mild 857bc421551SDag-Erling Smørgravcheck_mild: check_character_set check_white_space check_links \ 858*46c59934SDag-Erling Smørgrav check_name_lengths check_now \ 859*46c59934SDag-Erling Smørgrav check_slashed_abbrs check_sorted \ 860bc421551SDag-Erling Smørgrav check_tables check_web check_ziguard check_zishrink check_tzs 861bc421551SDag-Erling Smørgrav 862*46c59934SDag-Erling Smørgrav# True if UTF8_LOCALE does not work; 863*46c59934SDag-Erling Smørgrav# otherwise, false but with LC_ALL set to $(UTF8_LOCALE). 864*46c59934SDag-Erling SmørgravUTF8_LOCALE_MISSING = \ 865*46c59934SDag-Erling Smørgrav { test ! '$(UTF8_LOCALE)' \ 866*46c59934SDag-Erling Smørgrav || ! printf 'A\304\200B\n' \ 867*46c59934SDag-Erling Smørgrav | LC_ALL='$(UTF8_LOCALE)' grep -q '^A.B$$' >/dev/null 2>&1 \ 868*46c59934SDag-Erling Smørgrav || { LC_ALL='$(UTF8_LOCALE)'; export LC_ALL; false; }; } 869*46c59934SDag-Erling Smørgrav 870bc421551SDag-Erling Smørgravcheck_character_set: $(ENCHILADA) 871*46c59934SDag-Erling Smørgrav $(UTF8_LOCALE_MISSING) || { \ 872bc421551SDag-Erling Smørgrav sharp='#' && \ 873bc421551SDag-Erling Smørgrav ! grep -Env $(SAFE_LINE) $(MANS) date.1 $(MANTXTS) \ 874bc421551SDag-Erling Smørgrav $(MISC) $(SOURCES) $(WEB_PAGES) \ 875bc421551SDag-Erling Smørgrav CONTRIBUTING LICENSE README SECURITY \ 876bc421551SDag-Erling Smørgrav version tzdata.zi && \ 877bc421551SDag-Erling Smørgrav ! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_'$(OK_CHAR)'*$$' \ 878bc421551SDag-Erling Smørgrav Makefile && \ 879bc421551SDag-Erling Smørgrav ! grep -Env $(SAFE_SHARP_LINE) $(TDATA_TO_CHECK) backzone \ 880bc421551SDag-Erling Smørgrav leapseconds zone.tab && \ 881bc421551SDag-Erling Smørgrav ! grep -Env $(OK_LINE) $(ENCHILADA); \ 882bc421551SDag-Erling Smørgrav } 883bc421551SDag-Erling Smørgrav touch $@ 884bc421551SDag-Erling Smørgrav 885bc421551SDag-Erling Smørgravcheck_white_space: $(ENCHILADA) 886*46c59934SDag-Erling Smørgrav $(UTF8_LOCALE_MISSING) || { \ 887bc421551SDag-Erling Smørgrav patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \ 888*46c59934SDag-Erling Smørgrav ! grep -En "$$pat|[$s]\$$" \ 889*46c59934SDag-Erling Smørgrav $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list); \ 890*46c59934SDag-Erling Smørgrav } 891bc421551SDag-Erling Smørgrav touch $@ 892bc421551SDag-Erling Smørgrav 893bc421551SDag-Erling SmørgravPRECEDES_FILE_NAME = ^(Zone|Link[$s]+[^$s]+)[$s]+ 894bc421551SDag-Erling SmørgravFILE_NAME_COMPONENT_TOO_LONG = $(PRECEDES_FILE_NAME)[^$s]*[^/$s]{15} 895bc421551SDag-Erling Smørgrav 896bc421551SDag-Erling Smørgravcheck_name_lengths: $(TDATA_TO_CHECK) backzone 897bc421551SDag-Erling Smørgrav ! grep -En '$(FILE_NAME_COMPONENT_TOO_LONG)' \ 898bc421551SDag-Erling Smørgrav $(TDATA_TO_CHECK) backzone 899bc421551SDag-Erling Smørgrav touch $@ 900bc421551SDag-Erling Smørgrav 901bc421551SDag-Erling SmørgravPRECEDES_STDOFF = ^(Zone[$s]+[^$s]+)?[$s]+ 902bc421551SDag-Erling SmørgravSTDOFF = [-+]?[0-9:.]+ 903bc421551SDag-Erling SmørgravRULELESS_SAVE = (-|$(STDOFF)[sd]?) 904bc421551SDag-Erling SmørgravRULELESS_SLASHED_ABBRS = \ 905bc421551SDag-Erling Smørgrav $(PRECEDES_STDOFF)$(STDOFF)[$s]+$(RULELESS_SAVE)[$s]+[^$s]*/ 906bc421551SDag-Erling Smørgrav 907bc421551SDag-Erling Smørgravcheck_slashed_abbrs: $(TDATA_TO_CHECK) 908bc421551SDag-Erling Smørgrav ! grep -En '$(RULELESS_SLASHED_ABBRS)' $(TDATA_TO_CHECK) 909bc421551SDag-Erling Smørgrav touch $@ 910bc421551SDag-Erling Smørgrav 911bc421551SDag-Erling SmørgravCHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; } 912bc421551SDag-Erling Smørgrav 91375411d15SDag-Erling Smørgravcheck_sorted: backward backzone 914bc421551SDag-Erling Smørgrav $(AWK) '/^Link/ {printf "%.5d %s\n", g, $$3} !/./ {g++}' \ 915bc421551SDag-Erling Smørgrav backward | LC_ALL=C sort -cu 916bc421551SDag-Erling Smørgrav $(AWK) '/^Zone/ {print $$2}' backzone | LC_ALL=C sort -cu 917bc421551SDag-Erling Smørgrav touch $@ 918bc421551SDag-Erling Smørgrav 919bc421551SDag-Erling Smørgravcheck_back: checklinks.awk $(TDATA_TO_CHECK) 920bc421551SDag-Erling Smørgrav $(AWK) \ 921bc421551SDag-Erling Smørgrav -v DATAFORM=$(DATAFORM) \ 922bc421551SDag-Erling Smørgrav -v backcheck=backward \ 923bc421551SDag-Erling Smørgrav -f checklinks.awk $(TDATA_TO_CHECK) 924bc421551SDag-Erling Smørgrav touch $@ 925bc421551SDag-Erling Smørgrav 926bc421551SDag-Erling Smørgravcheck_links: checklinks.awk tzdata.zi 927bc421551SDag-Erling Smørgrav $(AWK) \ 928bc421551SDag-Erling Smørgrav -v DATAFORM=$(DATAFORM) \ 929bc421551SDag-Erling Smørgrav -f checklinks.awk tzdata.zi 930bc421551SDag-Erling Smørgrav touch $@ 931bc421551SDag-Erling Smørgrav 932*46c59934SDag-Erling Smørgrav# Check timestamps from now through 28 years from now, to make sure 933*46c59934SDag-Erling Smørgrav# that zonenow.tab contains all sequences of planned timestamps, 934*46c59934SDag-Erling Smørgrav# without any duplicate sequences. In theory this might require 935*46c59934SDag-Erling Smørgrav# 2800 years but that would take a long time to check. 936*46c59934SDag-Erling SmørgravCHECK_NOW_TIMESTAMP = `./date +%s` 937*46c59934SDag-Erling SmørgravCHECK_NOW_FUTURE_YEARS = 28 938*46c59934SDag-Erling SmørgravCHECK_NOW_FUTURE_SECS = $(CHECK_NOW_FUTURE_YEARS) '*' 366 '*' 24 '*' 60 '*' 60 939*46c59934SDag-Erling Smørgravcheck_now: checknow.awk date tzdata.zi zdump zic zone1970.tab zonenow.tab 940*46c59934SDag-Erling Smørgrav rm -fr $@.dir 941*46c59934SDag-Erling Smørgrav mkdir $@.dir 942*46c59934SDag-Erling Smørgrav ./zic -d $@.dir tzdata.zi 943*46c59934SDag-Erling Smørgrav now=$(CHECK_NOW_TIMESTAMP) && \ 944*46c59934SDag-Erling Smørgrav future=`expr $(CHECK_NOW_FUTURE_SECS) + $$now` && \ 945*46c59934SDag-Erling Smørgrav ./zdump -i -t $$now,$$future \ 946*46c59934SDag-Erling Smørgrav $$(find $$PWD/$@.dir/????*/ -type f) \ 947*46c59934SDag-Erling Smørgrav >$@.dir/zdump.tab 948*46c59934SDag-Erling Smørgrav $(AWK) \ 949*46c59934SDag-Erling Smørgrav -v zdump_table=$@.dir/zdump.tab \ 950*46c59934SDag-Erling Smørgrav -f checknow.awk zonenow.tab 951*46c59934SDag-Erling Smørgrav rm -fr $@.dir 952*46c59934SDag-Erling Smørgrav touch $@ 953*46c59934SDag-Erling Smørgrav 954*46c59934SDag-Erling Smørgravcheck_tables: checktab.awk $(YDATA) backward zone.tab zone1970.tab 955bc421551SDag-Erling Smørgrav for tab in $(ZONETABLES); do \ 956bc421551SDag-Erling Smørgrav test "$$tab" = zone.tab && links='$(BACKWARD)' || links=''; \ 957bc421551SDag-Erling Smørgrav $(AWK) -f checktab.awk -v zone_table=$$tab $(YDATA) $$links \ 958bc421551SDag-Erling Smørgrav || exit; \ 959bc421551SDag-Erling Smørgrav done 960bc421551SDag-Erling Smørgrav touch $@ 961bc421551SDag-Erling Smørgrav 962bc421551SDag-Erling Smørgravcheck_tzs: $(TZS) $(TZS_NEW) 963bc421551SDag-Erling Smørgrav if test -s $(TZS); then \ 964bc421551SDag-Erling Smørgrav $(DIFF_TZS) $(TZS) $(TZS_NEW); \ 965bc421551SDag-Erling Smørgrav else \ 966bc421551SDag-Erling Smørgrav cp $(TZS_NEW) $(TZS); \ 967bc421551SDag-Erling Smørgrav fi 968bc421551SDag-Erling Smørgrav touch $@ 969bc421551SDag-Erling Smørgrav 970bc421551SDag-Erling Smørgravcheck_web: $(CHECK_WEB_PAGES) 971bc421551SDag-Erling Smørgravcheck_theory.html: theory.html 972bc421551SDag-Erling Smørgravcheck_tz-art.html: tz-art.html 973bc421551SDag-Erling Smørgravcheck_tz-how-to.html: tz-how-to.html 974bc421551SDag-Erling Smørgravcheck_tz-link.html: tz-link.html 975bc421551SDag-Erling Smørgravcheck_theory.html check_tz-art.html check_tz-how-to.html check_tz-link.html: 976bc421551SDag-Erling Smørgrav $(CURL) -sS --url https://validator.w3.org/nu/ -F out=gnu \ 977bc421551SDag-Erling Smørgrav -F file=@$$(expr $@ : 'check_\(.*\)') -o $@.out && \ 978bc421551SDag-Erling Smørgrav test ! -s $@.out || { cat $@.out; exit 1; } 979bc421551SDag-Erling Smørgrav mv $@.out $@ 980bc421551SDag-Erling Smørgrav 981bc421551SDag-Erling Smørgravcheck_ziguard: rearguard.zi vanguard.zi ziguard.awk 982bc421551SDag-Erling Smørgrav $(AWK) -v DATAFORM=rearguard -f ziguard.awk vanguard.zi | \ 983bc421551SDag-Erling Smørgrav diff -u rearguard.zi - 984bc421551SDag-Erling Smørgrav $(AWK) -v DATAFORM=vanguard -f ziguard.awk rearguard.zi | \ 985bc421551SDag-Erling Smørgrav diff -u vanguard.zi - 986bc421551SDag-Erling Smørgrav touch $@ 987bc421551SDag-Erling Smørgrav 988bc421551SDag-Erling Smørgrav# Check that zishrink.awk does not alter the data, and that ziguard.awk 989bc421551SDag-Erling Smørgrav# preserves main-format data. 990bc421551SDag-Erling Smørgravcheck_zishrink: check_zishrink_posix check_zishrink_right 991bc421551SDag-Erling Smørgravcheck_zishrink_posix check_zishrink_right: \ 992bc421551SDag-Erling Smørgrav zic leapseconds $(PACKRATDATA) $(PACKRATLIST) \ 993bc421551SDag-Erling Smørgrav $(TDATA) $(DATAFORM).zi tzdata.zi 994bc421551SDag-Erling Smørgrav rm -fr $@.dir $@-t.dir $@-shrunk.dir 995bc421551SDag-Erling Smørgrav mkdir $@.dir $@-t.dir $@-shrunk.dir 996bc421551SDag-Erling Smørgrav case $@ in \ 997bc421551SDag-Erling Smørgrav *_right) leap='-L leapseconds';; \ 998bc421551SDag-Erling Smørgrav *) leap=;; \ 999bc421551SDag-Erling Smørgrav esac && \ 1000bc421551SDag-Erling Smørgrav $(ZIC) $$leap -d $@.dir $(DATAFORM).zi && \ 1001bc421551SDag-Erling Smørgrav $(ZIC) $$leap -d $@-shrunk.dir tzdata.zi && \ 1002bc421551SDag-Erling Smørgrav case $(DATAFORM),$(PACKRATLIST) in \ 1003bc421551SDag-Erling Smørgrav main,) \ 1004bc421551SDag-Erling Smørgrav $(ZIC) $$leap -d $@-t.dir $(TDATA) && \ 1005bc421551SDag-Erling Smørgrav $(AWK) '/^Rule/' $(TDATA) | \ 1006bc421551SDag-Erling Smørgrav $(ZIC) $$leap -d $@-t.dir - $(PACKRATDATA) && \ 1007bc421551SDag-Erling Smørgrav diff -r $@.dir $@-t.dir;; \ 1008bc421551SDag-Erling Smørgrav esac 1009bc421551SDag-Erling Smørgrav diff -r $@.dir $@-shrunk.dir 1010bc421551SDag-Erling Smørgrav rm -fr $@.dir $@-t.dir $@-shrunk.dir 1011bc421551SDag-Erling Smørgrav touch $@ 1012bc421551SDag-Erling Smørgrav 1013bc421551SDag-Erling Smørgravclean_misc: 1014*46c59934SDag-Erling Smørgrav rm -fr check_*.dir typecheck_*.dir 1015bc421551SDag-Erling Smørgrav rm -f *.o *.out $(TIME_T_ALTERNATIVES) \ 1016bc421551SDag-Erling Smørgrav check_* core typecheck_* \ 1017*46c59934SDag-Erling Smørgrav date tzdir.h tzselect version.h zdump zic libtz.a 1018bc421551SDag-Erling Smørgravclean: clean_misc 1019bc421551SDag-Erling Smørgrav rm -fr *.dir tzdb-*/ 1020bc421551SDag-Erling Smørgrav rm -f *.zi $(TZS_NEW) 1021bc421551SDag-Erling Smørgrav 1022bc421551SDag-Erling Smørgravmaintainer-clean: clean 1023bc421551SDag-Erling Smørgrav @echo 'This command is intended for maintainers to use; it' 1024bc421551SDag-Erling Smørgrav @echo 'deletes files that may need special tools to rebuild.' 1025bc421551SDag-Erling Smørgrav rm -f leapseconds version $(MANTXTS) $(TZS) *.asc *.tar.* 1026bc421551SDag-Erling Smørgrav 1027bc421551SDag-Erling Smørgravnames: 1028bc421551SDag-Erling Smørgrav @echo $(ENCHILADA) 1029bc421551SDag-Erling Smørgrav 1030bc421551SDag-Erling Smørgravpublic: check check_public $(CHECK_TIME_T_ALTERNATIVES) \ 1031bc421551SDag-Erling Smørgrav tarballs signatures 1032bc421551SDag-Erling Smørgrav 1033bc421551SDag-Erling Smørgravdate.1.txt: date.1 1034bc421551SDag-Erling Smørgravnewctime.3.txt: newctime.3 1035bc421551SDag-Erling Smørgravnewstrftime.3.txt: newstrftime.3 1036bc421551SDag-Erling Smørgravnewtzset.3.txt: newtzset.3 1037bc421551SDag-Erling Smørgravtime2posix.3.txt: time2posix.3 1038bc421551SDag-Erling Smørgravtzfile.5.txt: tzfile.5 1039bc421551SDag-Erling Smørgravtzselect.8.txt: tzselect.8 1040bc421551SDag-Erling Smørgravzdump.8.txt: zdump.8 1041bc421551SDag-Erling Smørgravzic.8.txt: zic.8 1042bc421551SDag-Erling Smørgrav 1043bc421551SDag-Erling Smørgrav$(MANTXTS): workman.sh 1044bc421551SDag-Erling Smørgrav LC_ALL=C sh workman.sh `expr $@ : '\(.*\)\.txt$$'` >$@.out 1045bc421551SDag-Erling Smørgrav mv $@.out $@ 1046bc421551SDag-Erling Smørgrav 1047bc421551SDag-Erling Smørgrav# Set file timestamps deterministically if possible, 1048bc421551SDag-Erling Smørgrav# so that tarballs containing the timestamps are reproducible. 1049bc421551SDag-Erling Smørgrav# 1050bc421551SDag-Erling Smørgrav# '$(SET_TIMESTAMP_N) N DEST A B C ...' sets the timestamp of the 1051bc421551SDag-Erling Smørgrav# file DEST to the maximum of the timestamps of the files A B C ..., 1052bc421551SDag-Erling Smørgrav# plus N if GNU ls and touch are available. 1053bc421551SDag-Erling SmørgravSET_TIMESTAMP_N = sh -c '\ 1054bc421551SDag-Erling Smørgrav n=$$0 dest=$$1; shift; \ 1055*46c59934SDag-Erling Smørgrav <"$$dest" && \ 1056bc421551SDag-Erling Smørgrav if test $$n != 0 && \ 1057*46c59934SDag-Erling Smørgrav lsout=`ls -nt --time-style="+%s" "$$@" 2>/dev/null`; then \ 1058bc421551SDag-Erling Smørgrav set x $$lsout && \ 1059*46c59934SDag-Erling Smørgrav timestamp=`expr $$7 + $$n` && \ 1060*46c59934SDag-Erling Smørgrav echo "+ touch -md @$$timestamp $$dest" && \ 1061*46c59934SDag-Erling Smørgrav touch -md @$$timestamp "$$dest"; \ 1062*46c59934SDag-Erling Smørgrav else \ 1063*46c59934SDag-Erling Smørgrav newest=`ls -t "$$@" | sed 1q` && \ 1064*46c59934SDag-Erling Smørgrav echo "+ touch -mr $$newest $$dest" && \ 1065*46c59934SDag-Erling Smørgrav touch -mr "$$newest" "$$dest"; \ 1066*46c59934SDag-Erling Smørgrav fi' 1067bc421551SDag-Erling Smørgrav# If DEST depends on A B C ... in this Makefile, callers should use 1068bc421551SDag-Erling Smørgrav# $(SET_TIMESTAMP_DEP) DEST A B C ..., for the benefit of any 1069bc421551SDag-Erling Smørgrav# downstream 'make' that considers equal timestamps to be out of date. 1070bc421551SDag-Erling Smørgrav# POSIX allows this 'make' behavior, and HP-UX 'make' does it. 1071bc421551SDag-Erling Smørgrav# If all that matters is that the timestamp be reproducible 1072bc421551SDag-Erling Smørgrav# and plausible, use $(SET_TIMESTAMP). 1073bc421551SDag-Erling SmørgravSET_TIMESTAMP = $(SET_TIMESTAMP_N) 0 1074bc421551SDag-Erling SmørgravSET_TIMESTAMP_DEP = $(SET_TIMESTAMP_N) 1 1075bc421551SDag-Erling Smørgrav 1076bc421551SDag-Erling Smørgrav# Set the timestamps to those of the git repository, if available, 1077bc421551SDag-Erling Smørgrav# and if the files have not changed since then. 1078bc421551SDag-Erling Smørgrav# This uses GNU 'ls --time-style=+%s', which outputs the seconds count, 1079bc421551SDag-Erling Smørgrav# and GNU 'touch -d@N FILE', where N is the number of seconds since 1970. 1080bc421551SDag-Erling Smørgrav# If git or GNU is absent, don't bother to sync with git timestamps. 1081bc421551SDag-Erling Smørgrav# Also, set the timestamp of each prebuilt file like 'leapseconds' 1082bc421551SDag-Erling Smørgrav# to be the maximum of the files it depends on. 1083bc421551SDag-Erling Smørgravset-timestamps.out: $(EIGHT_YARDS) 1084bc421551SDag-Erling Smørgrav rm -f $@ 1085bc421551SDag-Erling Smørgrav if (type git) >/dev/null 2>&1 && \ 1086bc421551SDag-Erling Smørgrav files=`git ls-files $(EIGHT_YARDS)` && \ 1087bc421551SDag-Erling Smørgrav touch -md @1 test.out; then \ 1088bc421551SDag-Erling Smørgrav rm -f test.out && \ 1089bc421551SDag-Erling Smørgrav for file in $$files; do \ 1090bc421551SDag-Erling Smørgrav if git diff --quiet $$file; then \ 1091*46c59934SDag-Erling Smørgrav time=`TZ=UTC0 git log -1 \ 1092*46c59934SDag-Erling Smørgrav --format='tformat:%cd' \ 1093*46c59934SDag-Erling Smørgrav --date='format:%Y-%m-%dT%H:%M:%SZ' \ 1094*46c59934SDag-Erling Smørgrav $$file` && \ 1095*46c59934SDag-Erling Smørgrav echo "+ touch -md $$time $$file" && \ 1096*46c59934SDag-Erling Smørgrav touch -md $$time $$file; \ 1097bc421551SDag-Erling Smørgrav else \ 1098bc421551SDag-Erling Smørgrav echo >&2 "$$file: warning: does not match repository"; \ 1099bc421551SDag-Erling Smørgrav fi || exit; \ 1100bc421551SDag-Erling Smørgrav done; \ 1101bc421551SDag-Erling Smørgrav fi 1102bc421551SDag-Erling Smørgrav $(SET_TIMESTAMP_DEP) leapseconds $(LEAP_DEPS) 1103bc421551SDag-Erling Smørgrav for file in `ls $(MANTXTS) | sed 's/\.txt$$//'`; do \ 1104bc421551SDag-Erling Smørgrav $(SET_TIMESTAMP_DEP) $$file.txt $$file workman.sh || \ 1105bc421551SDag-Erling Smørgrav exit; \ 1106bc421551SDag-Erling Smørgrav done 1107bc421551SDag-Erling Smørgrav $(SET_TIMESTAMP_DEP) version $(VERSION_DEPS) 1108bc421551SDag-Erling Smørgrav $(SET_TIMESTAMP_DEP) tzdata.zi $(TZDATA_ZI_DEPS) 1109bc421551SDag-Erling Smørgrav touch $@ 1110bc421551SDag-Erling Smørgravset-tzs-timestamp.out: $(TZS) 1111bc421551SDag-Erling Smørgrav $(SET_TIMESTAMP_DEP) $(TZS) $(TZS_DEPS) 1112bc421551SDag-Erling Smørgrav touch $@ 1113bc421551SDag-Erling Smørgrav 1114bc421551SDag-Erling Smørgrav# The zics below ensure that each data file can stand on its own. 1115bc421551SDag-Erling Smørgrav# We also do an all-files run to catch links to links. 1116bc421551SDag-Erling Smørgrav 1117bc421551SDag-Erling Smørgravcheck_public: $(VERSION_DEPS) 1118bc421551SDag-Erling Smørgrav rm -fr public.dir 1119bc421551SDag-Erling Smørgrav mkdir public.dir 1120bc421551SDag-Erling Smørgrav ln $(VERSION_DEPS) public.dir 1121*46c59934SDag-Erling Smørgrav cd public.dir \ 1122*46c59934SDag-Erling Smørgrav && $(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' TZDIR='$(TZDIR)' ALL 1123bc421551SDag-Erling Smørgrav for i in $(TDATA_TO_CHECK) public.dir/tzdata.zi \ 1124bc421551SDag-Erling Smørgrav public.dir/vanguard.zi public.dir/main.zi \ 1125bc421551SDag-Erling Smørgrav public.dir/rearguard.zi; \ 1126bc421551SDag-Erling Smørgrav do \ 1127bc421551SDag-Erling Smørgrav public.dir/zic -v -d public.dir/zoneinfo $$i 2>&1 || exit; \ 1128bc421551SDag-Erling Smørgrav done 1129bc421551SDag-Erling Smørgrav public.dir/zic -v -d public.dir/zoneinfo-all $(TDATA_TO_CHECK) 1130bc421551SDag-Erling Smørgrav : 1131bc421551SDag-Erling Smørgrav : Also check 'backzone' syntax. 1132bc421551SDag-Erling Smørgrav rm public.dir/main.zi 1133bc421551SDag-Erling Smørgrav cd public.dir && $(MAKE) PACKRATDATA=backzone main.zi 1134bc421551SDag-Erling Smørgrav public.dir/zic -d public.dir/zoneinfo main.zi 1135bc421551SDag-Erling Smørgrav rm public.dir/main.zi 1136bc421551SDag-Erling Smørgrav cd public.dir && \ 1137bc421551SDag-Erling Smørgrav $(MAKE) PACKRATDATA=backzone PACKRATLIST=zone.tab main.zi 1138bc421551SDag-Erling Smørgrav public.dir/zic -d public.dir/zoneinfo main.zi 1139bc421551SDag-Erling Smørgrav : 1140bc421551SDag-Erling Smørgrav rm -fr public.dir 1141bc421551SDag-Erling Smørgrav touch $@ 1142bc421551SDag-Erling Smørgrav 1143bc421551SDag-Erling Smørgrav# Check that the code works under various alternative 1144bc421551SDag-Erling Smørgrav# implementations of time_t. 1145bc421551SDag-Erling Smørgravcheck_time_t_alternatives: $(TIME_T_ALTERNATIVES) 1146bc421551SDag-Erling Smørgrav$(TIME_T_ALTERNATIVES_TAIL): $(TIME_T_ALTERNATIVES_HEAD) 1147bc421551SDag-Erling Smørgrav$(TIME_T_ALTERNATIVES): $(VERSION_DEPS) 1148bc421551SDag-Erling Smørgrav rm -fr $@.dir 1149bc421551SDag-Erling Smørgrav mkdir $@.dir 1150bc421551SDag-Erling Smørgrav ln $(VERSION_DEPS) $@.dir 1151bc421551SDag-Erling Smørgrav case $@ in \ 1152bc421551SDag-Erling Smørgrav int*32_t) range=-2147483648,2147483648;; \ 1153bc421551SDag-Erling Smørgrav u*) range=0,4294967296;; \ 1154bc421551SDag-Erling Smørgrav *) range=-4294967296,4294967296;; \ 1155bc421551SDag-Erling Smørgrav esac && \ 1156bc421551SDag-Erling Smørgrav wd=`pwd` && \ 1157bc421551SDag-Erling Smørgrav zones=`$(AWK) '/^[^#]/ { print $$3 }' <zone1970.tab` && \ 1158bc421551SDag-Erling Smørgrav if test $@ = $(TIME_T_ALTERNATIVES_HEAD); then \ 1159bc421551SDag-Erling Smørgrav range_target=; \ 1160bc421551SDag-Erling Smørgrav else \ 1161bc421551SDag-Erling Smørgrav range_target=to$$range.tzs; \ 1162bc421551SDag-Erling Smørgrav fi && \ 1163bc421551SDag-Erling Smørgrav (cd $@.dir && \ 1164bc421551SDag-Erling Smørgrav $(MAKE) TOPDIR="$$wd/$@.dir" \ 1165bc421551SDag-Erling Smørgrav CFLAGS='$(CFLAGS) -Dtime_tz='"'$@'" \ 1166bc421551SDag-Erling Smørgrav REDO='$(REDO)' \ 1167bc421551SDag-Erling Smørgrav D=$$wd/$@.dir \ 1168bc421551SDag-Erling Smørgrav TZS_YEAR="$$range" TZS_CUTOFF_FLAG="-t $$range" \ 1169bc421551SDag-Erling Smørgrav install $$range_target) && \ 1170bc421551SDag-Erling Smørgrav test $@ = $(TIME_T_ALTERNATIVES_HEAD) || { \ 1171bc421551SDag-Erling Smørgrav (cd $(TIME_T_ALTERNATIVES_HEAD).dir && \ 1172bc421551SDag-Erling Smørgrav $(MAKE) TOPDIR="$$wd/$@.dir" \ 1173bc421551SDag-Erling Smørgrav TZS_YEAR="$$range" TZS_CUTOFF_FLAG="-t $$range" \ 1174bc421551SDag-Erling Smørgrav D=$$wd/$@.dir \ 1175bc421551SDag-Erling Smørgrav to$$range.tzs) && \ 1176bc421551SDag-Erling Smørgrav $(DIFF_TZS) $(TIME_T_ALTERNATIVES_HEAD).dir/to$$range.tzs \ 1177bc421551SDag-Erling Smørgrav $@.dir/to$$range.tzs && \ 1178bc421551SDag-Erling Smørgrav if diff -q Makefile Makefile 2>/dev/null; then \ 1179bc421551SDag-Erling Smørgrav quiet_option='-q'; \ 1180bc421551SDag-Erling Smørgrav else \ 1181bc421551SDag-Erling Smørgrav quiet_option=''; \ 1182bc421551SDag-Erling Smørgrav fi && \ 1183bc421551SDag-Erling Smørgrav diff $$quiet_option -r $(TIME_T_ALTERNATIVES_HEAD).dir/etc \ 1184bc421551SDag-Erling Smørgrav $@.dir/etc && \ 1185bc421551SDag-Erling Smørgrav diff $$quiet_option -r \ 1186bc421551SDag-Erling Smørgrav $(TIME_T_ALTERNATIVES_HEAD).dir/usr/share \ 1187bc421551SDag-Erling Smørgrav $@.dir/usr/share; \ 1188bc421551SDag-Erling Smørgrav } 1189bc421551SDag-Erling Smørgrav touch $@ 1190bc421551SDag-Erling Smørgrav 1191bc421551SDag-Erling SmørgravTRADITIONAL_ASC = \ 1192bc421551SDag-Erling Smørgrav tzcode$(VERSION).tar.gz.asc \ 1193bc421551SDag-Erling Smørgrav tzdata$(VERSION).tar.gz.asc 1194bc421551SDag-Erling SmørgravREARGUARD_ASC = \ 1195bc421551SDag-Erling Smørgrav tzdata$(VERSION)-rearguard.tar.gz.asc 1196bc421551SDag-Erling SmørgravALL_ASC = $(TRADITIONAL_ASC) $(REARGUARD_ASC) \ 1197bc421551SDag-Erling Smørgrav tzdb-$(VERSION).tar.lz.asc 1198bc421551SDag-Erling Smørgrav 1199bc421551SDag-Erling Smørgravtarballs rearguard_tarballs tailored_tarballs traditional_tarballs \ 1200bc421551SDag-Erling Smørgravsignatures rearguard_signatures traditional_signatures: \ 1201bc421551SDag-Erling Smørgrav version set-timestamps.out rearguard.zi vanguard.zi 1202bc421551SDag-Erling Smørgrav VERSION=`cat version` && \ 1203bc421551SDag-Erling Smørgrav $(MAKE) AWK='$(AWK)' VERSION="$$VERSION" $@_version 1204bc421551SDag-Erling Smørgrav 1205bc421551SDag-Erling Smørgrav# These *_version rules are intended for use if VERSION is set by some 1206bc421551SDag-Erling Smørgrav# other means. Ordinarily these rules are used only by the above 1207bc421551SDag-Erling Smørgrav# non-_version rules, which set VERSION on the 'make' command line. 1208bc421551SDag-Erling Smørgravtarballs_version: traditional_tarballs_version rearguard_tarballs_version \ 1209bc421551SDag-Erling Smørgrav tzdb-$(VERSION).tar.lz 1210bc421551SDag-Erling Smørgravrearguard_tarballs_version: \ 1211bc421551SDag-Erling Smørgrav tzdata$(VERSION)-rearguard.tar.gz 1212bc421551SDag-Erling Smørgravtraditional_tarballs_version: \ 1213bc421551SDag-Erling Smørgrav tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz 1214bc421551SDag-Erling Smørgravtailored_tarballs_version: \ 1215bc421551SDag-Erling Smørgrav tzdata$(VERSION)-tailored.tar.gz 1216bc421551SDag-Erling Smørgravsignatures_version: $(ALL_ASC) 1217bc421551SDag-Erling Smørgravrearguard_signatures_version: $(REARGUARD_ASC) 1218bc421551SDag-Erling Smørgravtraditional_signatures_version: $(TRADITIONAL_ASC) 1219bc421551SDag-Erling Smørgrav 1220bc421551SDag-Erling Smørgravtzcode$(VERSION).tar.gz: set-timestamps.out 1221bc421551SDag-Erling Smørgrav LC_ALL=C && export LC_ALL && \ 1222bc421551SDag-Erling Smørgrav tar $(TARFLAGS) -cf - \ 1223bc421551SDag-Erling Smørgrav $(COMMON) $(DOCS) $(SOURCES) | \ 1224bc421551SDag-Erling Smørgrav gzip $(GZIPFLAGS) >$@.out 1225bc421551SDag-Erling Smørgrav mv $@.out $@ 1226bc421551SDag-Erling Smørgrav 1227bc421551SDag-Erling Smørgravtzdata$(VERSION).tar.gz: set-timestamps.out 1228bc421551SDag-Erling Smørgrav LC_ALL=C && export LC_ALL && \ 1229bc421551SDag-Erling Smørgrav tar $(TARFLAGS) -cf - $(TZDATA_DIST) | \ 1230bc421551SDag-Erling Smørgrav gzip $(GZIPFLAGS) >$@.out 1231bc421551SDag-Erling Smørgrav mv $@.out $@ 1232bc421551SDag-Erling Smørgrav 1233bc421551SDag-Erling Smørgrav# Create empty files with a reproducible timestamp. 1234bc421551SDag-Erling SmørgravCREATE_EMPTY = TZ=UTC0 touch -mt 202010122253.00 1235bc421551SDag-Erling Smørgrav 1236bc421551SDag-Erling Smørgrav# The obsolescent *rearguard* targets and related macros are present 1237bc421551SDag-Erling Smørgrav# for backwards compatibility with tz releases 2018e through 2022a. 1238bc421551SDag-Erling Smørgrav# They should go away eventually. To build rearguard tarballs you 1239bc421551SDag-Erling Smørgrav# can instead use 'make DATAFORM=rearguard tailored_tarballs'. 1240bc421551SDag-Erling Smørgravtzdata$(VERSION)-rearguard.tar.gz: rearguard.zi set-timestamps.out 1241bc421551SDag-Erling Smørgrav rm -fr $@.dir 1242bc421551SDag-Erling Smørgrav mkdir $@.dir 1243bc421551SDag-Erling Smørgrav ln $(TZDATA_DIST) $@.dir 1244bc421551SDag-Erling Smørgrav cd $@.dir && rm -f $(TDATA) $(PACKRATDATA) version 1245bc421551SDag-Erling Smørgrav for f in $(TDATA) $(PACKRATDATA); do \ 1246bc421551SDag-Erling Smørgrav rearf=$@.dir/$$f; \ 1247bc421551SDag-Erling Smørgrav $(AWK) -v DATAFORM=rearguard -f ziguard.awk $$f >$$rearf && \ 1248bc421551SDag-Erling Smørgrav $(SET_TIMESTAMP_DEP) $$rearf ziguard.awk $$f || exit; \ 1249bc421551SDag-Erling Smørgrav done 1250bc421551SDag-Erling Smørgrav sed '1s/$$/-rearguard/' <version >$@.dir/version 1251bc421551SDag-Erling Smørgrav : The dummy pacificnew pacifies TZUpdater 2.3.1 and earlier. 1252bc421551SDag-Erling Smørgrav $(CREATE_EMPTY) $@.dir/pacificnew 1253*46c59934SDag-Erling Smørgrav touch -mr version $@.dir/version 1254bc421551SDag-Erling Smørgrav LC_ALL=C && export LC_ALL && \ 1255bc421551SDag-Erling Smørgrav (cd $@.dir && \ 1256bc421551SDag-Erling Smørgrav tar $(TARFLAGS) -cf - \ 1257bc421551SDag-Erling Smørgrav $(TZDATA_DIST) pacificnew | \ 1258bc421551SDag-Erling Smørgrav gzip $(GZIPFLAGS)) >$@.out 1259bc421551SDag-Erling Smørgrav mv $@.out $@ 1260bc421551SDag-Erling Smørgrav 1261bc421551SDag-Erling Smørgrav# Create a tailored tarball suitable for TZUpdater and compatible tools. 1262bc421551SDag-Erling Smørgrav# For example, 'make DATAFORM=vanguard tailored_tarballs' makes a tarball 1263bc421551SDag-Erling Smørgrav# useful for testing whether TZUpdater supports vanguard form. 1264bc421551SDag-Erling Smørgrav# The generated tarball is not byte-for-byte equivalent to a hand-tailored 1265bc421551SDag-Erling Smørgrav# traditional tarball, as data entries are put into 'etcetera' even if they 1266bc421551SDag-Erling Smørgrav# came from some other source file. However, the effect should be the same 1267bc421551SDag-Erling Smørgrav# for ordinary use, which reads all the source files. 1268bc421551SDag-Erling Smørgravtzdata$(VERSION)-tailored.tar.gz: set-timestamps.out 1269bc421551SDag-Erling Smørgrav rm -fr $@.dir 1270bc421551SDag-Erling Smørgrav mkdir $@.dir 1271bc421551SDag-Erling Smørgrav : The dummy pacificnew pacifies TZUpdater 2.3.1 and earlier. 1272bc421551SDag-Erling Smørgrav cd $@.dir && \ 1273bc421551SDag-Erling Smørgrav $(CREATE_EMPTY) $(PRIMARY_YDATA) $(NDATA) backward \ 1274bc421551SDag-Erling Smørgrav `test $(DATAFORM) = vanguard || echo pacificnew` 1275bc421551SDag-Erling Smørgrav (grep '^#' tzdata.zi && echo && cat $(DATAFORM).zi) \ 1276bc421551SDag-Erling Smørgrav >$@.dir/etcetera 1277*46c59934SDag-Erling Smørgrav touch -mr tzdata.zi $@.dir/etcetera 1278bc421551SDag-Erling Smørgrav sed -n \ 1279bc421551SDag-Erling Smørgrav -e '/^# *version *\(.*\)/h' \ 1280bc421551SDag-Erling Smørgrav -e '/^# *ddeps */H' \ 1281bc421551SDag-Erling Smørgrav -e '$$!d' \ 1282bc421551SDag-Erling Smørgrav -e 'g' \ 1283bc421551SDag-Erling Smørgrav -e 's/^# *version *//' \ 1284bc421551SDag-Erling Smørgrav -e 's/\n# *ddeps */-/' \ 1285bc421551SDag-Erling Smørgrav -e 's/ /-/g' \ 1286bc421551SDag-Erling Smørgrav -e 'p' \ 1287bc421551SDag-Erling Smørgrav <tzdata.zi >$@.dir/version 1288*46c59934SDag-Erling Smørgrav touch -mr version $@.dir/version 1289bc421551SDag-Erling Smørgrav links= && \ 1290bc421551SDag-Erling Smørgrav for file in $(TZDATA_DIST); do \ 1291bc421551SDag-Erling Smørgrav test -f $@.dir/$$file || links="$$links $$file"; \ 1292bc421551SDag-Erling Smørgrav done && \ 1293bc421551SDag-Erling Smørgrav ln $$links $@.dir 1294bc421551SDag-Erling Smørgrav LC_ALL=C && export LC_ALL && \ 1295bc421551SDag-Erling Smørgrav (cd $@.dir && \ 1296bc421551SDag-Erling Smørgrav tar $(TARFLAGS) -cf - * | gzip $(GZIPFLAGS)) >$@.out 1297bc421551SDag-Erling Smørgrav mv $@.out $@ 1298bc421551SDag-Erling Smørgrav 1299bc421551SDag-Erling Smørgravtzdb-$(VERSION).tar.lz: set-timestamps.out set-tzs-timestamp.out 1300bc421551SDag-Erling Smørgrav rm -fr tzdb-$(VERSION) 1301bc421551SDag-Erling Smørgrav mkdir tzdb-$(VERSION) 1302bc421551SDag-Erling Smørgrav ln $(ENCHILADA) tzdb-$(VERSION) 1303bc421551SDag-Erling Smørgrav $(SET_TIMESTAMP) tzdb-$(VERSION) tzdb-$(VERSION)/* 1304bc421551SDag-Erling Smørgrav LC_ALL=C && export LC_ALL && \ 1305bc421551SDag-Erling Smørgrav tar $(TARFLAGS) -cf - tzdb-$(VERSION) | lzip -9 >$@.out 1306bc421551SDag-Erling Smørgrav mv $@.out $@ 1307bc421551SDag-Erling Smørgrav 1308bc421551SDag-Erling Smørgravtzcode$(VERSION).tar.gz.asc: tzcode$(VERSION).tar.gz 1309bc421551SDag-Erling Smørgravtzdata$(VERSION).tar.gz.asc: tzdata$(VERSION).tar.gz 1310bc421551SDag-Erling Smørgravtzdata$(VERSION)-rearguard.tar.gz.asc: tzdata$(VERSION)-rearguard.tar.gz 1311bc421551SDag-Erling Smørgravtzdb-$(VERSION).tar.lz.asc: tzdb-$(VERSION).tar.lz 1312bc421551SDag-Erling Smørgrav$(ALL_ASC): 1313bc421551SDag-Erling Smørgrav $(GPG) --armor --detach-sign $? 1314bc421551SDag-Erling Smørgrav 1315bc421551SDag-Erling SmørgravTYPECHECK_CFLAGS = $(CFLAGS) -DTYPECHECK -D__time_t_defined -D_TIME_T 1316bc421551SDag-Erling Smørgravtypecheck: typecheck_long_long typecheck_unsigned 1317bc421551SDag-Erling Smørgravtypecheck_long_long typecheck_unsigned: $(VERSION_DEPS) 1318bc421551SDag-Erling Smørgrav rm -fr $@.dir 1319bc421551SDag-Erling Smørgrav mkdir $@.dir 1320bc421551SDag-Erling Smørgrav ln $(VERSION_DEPS) $@.dir 1321bc421551SDag-Erling Smørgrav cd $@.dir && \ 1322bc421551SDag-Erling Smørgrav case $@ in \ 1323bc421551SDag-Erling Smørgrav *_long_long) i="long long";; \ 1324bc421551SDag-Erling Smørgrav *_unsigned ) i="unsigned" ;; \ 1325bc421551SDag-Erling Smørgrav esac && \ 1326bc421551SDag-Erling Smørgrav typecheck_cflags='' && \ 1327bc421551SDag-Erling Smørgrav $(MAKE) \ 1328bc421551SDag-Erling Smørgrav CFLAGS="$(TYPECHECK_CFLAGS) \"-Dtime_t=$$i\"" \ 1329bc421551SDag-Erling Smørgrav TOPDIR="`pwd`" \ 1330bc421551SDag-Erling Smørgrav install 1331bc421551SDag-Erling Smørgrav $@.dir/zdump -i -c 1970,1971 Europe/Rome 1332bc421551SDag-Erling Smørgrav touch $@ 1333bc421551SDag-Erling Smørgrav 1334bc421551SDag-Erling Smørgravzonenames: tzdata.zi 1335bc421551SDag-Erling Smørgrav @$(AWK) '/^Z/ { print $$2 } /^L/ { print $$3 }' tzdata.zi 1336bc421551SDag-Erling Smørgrav 1337bc421551SDag-Erling Smørgravasctime.o: private.h tzfile.h 1338bc421551SDag-Erling Smørgravdate.o: private.h 1339bc421551SDag-Erling Smørgravdifftime.o: private.h 1340*46c59934SDag-Erling Smørgravlocaltime.o: private.h tzfile.h tzdir.h 1341bc421551SDag-Erling Smørgravstrftime.o: private.h tzfile.h 1342bc421551SDag-Erling Smørgravzdump.o: version.h 1343*46c59934SDag-Erling Smørgravzic.o: private.h tzfile.h tzdir.h version.h 1344bc421551SDag-Erling Smørgrav 1345bc421551SDag-Erling Smørgrav.PHONY: ALL INSTALL all 1346bc421551SDag-Erling Smørgrav.PHONY: check check_mild check_time_t_alternatives 1347bc421551SDag-Erling Smørgrav.PHONY: check_web check_zishrink 1348*46c59934SDag-Erling Smørgrav.PHONY: clean clean_misc commit-leap-seconds.list dummy.zd 1349*46c59934SDag-Erling Smørgrav.PHONY: fetch-leap-seconds.list force_tzs 1350bc421551SDag-Erling Smørgrav.PHONY: install install_data maintainer-clean names 1351bc421551SDag-Erling Smørgrav.PHONY: posix_only posix_right public 1352bc421551SDag-Erling Smørgrav.PHONY: rearguard_signatures rearguard_signatures_version 1353bc421551SDag-Erling Smørgrav.PHONY: rearguard_tarballs rearguard_tarballs_version 1354bc421551SDag-Erling Smørgrav.PHONY: right_only right_posix signatures signatures_version 1355bc421551SDag-Erling Smørgrav.PHONY: tarballs tarballs_version 1356bc421551SDag-Erling Smørgrav.PHONY: traditional_signatures traditional_signatures_version 1357bc421551SDag-Erling Smørgrav.PHONY: traditional_tarballs traditional_tarballs_version 1358bc421551SDag-Erling Smørgrav.PHONY: tailored_tarballs tailored_tarballs_version 1359bc421551SDag-Erling Smørgrav.PHONY: typecheck 1360bc421551SDag-Erling Smørgrav.PHONY: zonenames zones 1361bc421551SDag-Erling Smørgrav.PHONY: $(ZDS) 1362