1309568Sglebius# This file is in the public domain, so clarified as of
2309568Sglebius# 2009-05-17 by Arthur David Olson.
3309568Sglebius
4309568Sglebius# Package name for the code distribution.
5309568SglebiusPACKAGE=	tzcode
6309568Sglebius
7309568Sglebius# Version number for the distribution, overridden in the 'tarballs' rule below.
8309568SglebiusVERSION=	unknown
9309568Sglebius
10309568Sglebius# Email address for bug reports.
11309568SglebiusBUGEMAIL=	tz@iana.org
12309568Sglebius
13309568Sglebius# Change the line below for your time zone (after finding the zone you want in
14309568Sglebius# the time zone files, or adding it to a time zone file).
15309568Sglebius# Alternately, if you discover you've got the wrong time zone, you can just
16309568Sglebius#	zic -l rightzone
17309568Sglebius# to correct things.
18309568Sglebius# Use the command
19309568Sglebius#	make zonenames
20309568Sglebius# to get a list of the values you can use for LOCALTIME.
21309568Sglebius
22309568SglebiusLOCALTIME=	GMT
23309568Sglebius
24309568Sglebius# If you want something other than Eastern United States time as a template
25309568Sglebius# for handling POSIX-style time zone environment variables,
26309568Sglebius# change the line below (after finding the zone you want in the
27309568Sglebius# time zone files, or adding it to a time zone file).
28309568Sglebius# (When a POSIX-style environment variable is handled, the rules in the
29309568Sglebius# template file are used to determine "spring forward" and "fall back" days and
30309568Sglebius# times; the environment variable itself specifies UT offsets of standard and
31309568Sglebius# summer time.)
32309568Sglebius# Alternately, if you discover you've got the wrong time zone, you can just
33309568Sglebius#	zic -p rightzone
34309568Sglebius# to correct things.
35309568Sglebius# Use the command
36309568Sglebius#	make zonenames
37309568Sglebius# to get a list of the values you can use for POSIXRULES.
38309568Sglebius# If you want POSIX compatibility, use "America/New_York".
39309568Sglebius
40309568SglebiusPOSIXRULES=	America/New_York
41309568Sglebius
42309568Sglebius# Also see TZDEFRULESTRING below, which takes effect only
43309568Sglebius# if the time zone files cannot be accessed.
44309568Sglebius
45309568Sglebius# Everything gets put in subdirectories of. . .
46309568Sglebius
47309568SglebiusTOPDIR=		/usr/local
48309568Sglebius
49309568Sglebius# "Compiled" time zone information is placed in the "TZDIR" directory
50309568Sglebius# (and subdirectories).
51309568Sglebius# Use an absolute path name for TZDIR unless you're just testing the software.
52309568Sglebius
53309568SglebiusTZDIR_BASENAME=	zoneinfo
54309568SglebiusTZDIR=		$(TOPDIR)/etc/$(TZDIR_BASENAME)
55309568Sglebius
56309568Sglebius# Types to try, as an alternative to time_t.  int64_t should be first.
57309568SglebiusTIME_T_ALTERNATIVES= int64_t int32_t uint32_t uint64_t
58309568Sglebius
59309568Sglebius# The "tzselect", "zic", and "zdump" commands get installed in. . .
60309568Sglebius
61309568SglebiusETCDIR=		$(TOPDIR)/etc
62309568Sglebius
63309568Sglebius# If you "make INSTALL", the "date" command gets installed in. . .
64309568Sglebius
65309568SglebiusBINDIR=		$(TOPDIR)/bin
66309568Sglebius
67309568Sglebius# Manual pages go in subdirectories of. . .
68309568Sglebius
69309568SglebiusMANDIR=		$(TOPDIR)/man
70309568Sglebius
71309568Sglebius# Library functions are put in an archive in LIBDIR.
72309568Sglebius
73309568SglebiusLIBDIR=		$(TOPDIR)/lib
74309568Sglebius
75309568Sglebius# If you always want time values interpreted as "seconds since the epoch
76309568Sglebius# (not counting leap seconds)", use
77309568Sglebius#	REDO=		posix_only
78309568Sglebius# below.  If you always want right time values interpreted as "seconds since
79309568Sglebius# the epoch" (counting leap seconds)", use
80309568Sglebius#	REDO=		right_only
81309568Sglebius# below.  If you want both sets of data available, with leap seconds not
82309568Sglebius# counted normally, use
83309568Sglebius#	REDO=		posix_right
84309568Sglebius# below.  If you want both sets of data available, with leap seconds counted
85309568Sglebius# normally, use
86309568Sglebius#	REDO=		right_posix
87309568Sglebius# below.  POSIX mandates that leap seconds not be counted; for compatibility
88309568Sglebius# with it, use "posix_only" or "posix_right".
89309568Sglebius
90309568SglebiusREDO=		posix_right
91309568Sglebius
92309568Sglebius# If you want out-of-scope and often-wrong data from the file 'backzone', use
93309568Sglebius#	PACKRATDATA=	backzone
94309568Sglebius# To omit this data, use
95309568Sglebius#	PACKRATDATA=
96309568Sglebius
97309568SglebiusPACKRATDATA=
98309568Sglebius
99309568Sglebius# Since "." may not be in PATH...
100309568Sglebius
101309568SglebiusYEARISTYPE=	./yearistype
102309568Sglebius
103309568Sglebius# Non-default libraries needed to link.
104309568SglebiusLDLIBS=
105309568Sglebius
106309568Sglebius# Add the following to the end of the "CFLAGS=" line as needed.
107309568Sglebius#  -DBIG_BANG=-9999999LL if the Big Bang occurred at time -9999999 (see zic.c)
108309568Sglebius#  -DHAVE_DECL_ASCTIME_R=0 if <time.h> does not declare asctime_r
109309568Sglebius#  -DHAVE_DIRECT_H if mkdir needs <direct.h> (MS-Windows)
110309568Sglebius#  -DHAVE_DOS_FILE_NAMES if file names have drive specifiers etc. (MS-DOS)
111309568Sglebius#  -DHAVE_GETTEXT=1 if 'gettext' works (e.g., GNU/Linux, FreeBSD, Solaris)
112309568Sglebius#  -DHAVE_INCOMPATIBLE_CTIME_R=1 if your system's time.h declares
113309568Sglebius#	ctime_r and asctime_r incompatibly with the POSIX standard
114309568Sglebius#	(Solaris when _POSIX_PTHREAD_SEMANTICS is not defined).
115309568Sglebius#  -DHAVE_INTTYPES_H=1 if you have a pre-C99 compiler with "inttypes.h"
116309568Sglebius#  -DHAVE_LINK=0 if your system lacks a link function
117309568Sglebius#  -DHAVE_LOCALTIME_R=0 if your system lacks a localtime_r function
118309568Sglebius#  -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz
119309568Sglebius#	This defaults to 1 if a working localtime_rz seems to be available.
120309568Sglebius#	localtime_rz can make zdump significantly faster, but is nonstandard.
121309568Sglebius#  -DHAVE_POSIX_DECLS=0 if your system's include files do not declare
122309568Sglebius#	functions like 'link' or variables like 'tzname' required by POSIX
123309568Sglebius#  -DHAVE_STDINT_H=1 if you have a pre-C99 compiler with "stdint.h"
124309568Sglebius#  -DHAVE_STRFTIME_L=1 if <time.h> declares locale_t and strftime_l
125309568Sglebius#	This defaults to 0 if _POSIX_VERSION < 200809, 1 otherwise.
126309568Sglebius#  -DHAVE_STRDUP=0 if your system lacks the strdup function
127309568Sglebius#  -DHAVE_SYMLINK=0 if your system lacks the symlink function
128309568Sglebius#  -DHAVE_SYS_STAT_H=0 if your compiler lacks a "sys/stat.h"
129309568Sglebius#  -DHAVE_SYS_WAIT_H=0 if your compiler lacks a "sys/wait.h"
130309568Sglebius#  -DHAVE_TZSET=0 if your system lacks a tzset function
131309568Sglebius#  -DHAVE_UNISTD_H=0 if your compiler lacks a "unistd.h" (Microsoft C++ 7?)
132309568Sglebius#  -DEPOCH_LOCAL=1 if the 'time' function returns local time not UT
133309568Sglebius#  -DEPOCH_OFFSET=N if the 'time' function returns a value N greater
134309568Sglebius#	than what POSIX specifies, assuming local time is UT.
135309568Sglebius#	For example, N is 252460800 on AmigaOS.
136309568Sglebius#  -DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU=1
137309568Sglebius#	if you do not want run time warnings about formats that may cause
138309568Sglebius#	year 2000 grief
139309568Sglebius#  -Dssize_t=long on ancient hosts that lack ssize_t
140309568Sglebius#  -DTHREAD_SAFE=1 to make localtime.c thread-safe, as POSIX requires;
141309568Sglebius#	not needed by the main-program tz code, which is single-threaded.
142309568Sglebius#	Append other compiler flags as needed, e.g., -pthread on GNU/Linux.
143309568Sglebius#  -Dtime_tz=\"T\" to use T as the time_t type, rather than the system time_t
144309568Sglebius#  -DTZ_DOMAIN=\"foo\" to use "foo" for gettext domain name; default is "tz"
145309568Sglebius#  -DTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory;
146309568Sglebius#	the default is system-supplied, typically "/usr/lib/locale"
147309568Sglebius#  -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified
148309568Sglebius#	DST transitions if the time zone files cannot be accessed
149309568Sglebius#  -DUNINIT_TRAP=1 if reading uninitialized storage can cause problems
150309568Sglebius#	other than simply getting garbage data
151309568Sglebius#  -DUSE_LTZ=0 to build zdump with the system time zone library
152309568Sglebius#	Also set TZDOBJS=zdump.o and CHECK_TIME_T_ALTERNATIVES= below.
153309568Sglebius#  -DZIC_MAX_ABBR_LEN_WO_WARN=3
154309568Sglebius#	(or some other number) to set the maximum time zone abbreviation length
155309568Sglebius#	that zic will accept without a warning (the default is 6)
156309568Sglebius#  $(GCC_DEBUG_FLAGS) if you are using recent GCC and want lots of checking
157309568SglebiusGCC_DEBUG_FLAGS = -Dlint -g3 -O3 -fno-common -fstrict-aliasing \
158309568Sglebius	-Wall -Wextra \
159309568Sglebius	-Wbad-function-cast -Wcast-align -Wdate-time \
160309568Sglebius	-Wdeclaration-after-statement \
161309568Sglebius	-Wdouble-promotion \
162309568Sglebius	-Wformat=2 -Winit-self -Wjump-misses-init \
163309568Sglebius	-Wlogical-op -Wmissing-prototypes -Wnested-externs \
164309568Sglebius	-Wold-style-definition -Woverlength-strings -Wpointer-arith \
165309568Sglebius	-Wshadow -Wstrict-prototypes -Wsuggest-attribute=const \
166309568Sglebius	-Wsuggest-attribute=format -Wsuggest-attribute=noreturn \
167309568Sglebius	-Wsuggest-attribute=pure -Wtrampolines \
168309568Sglebius	-Wunused -Wwrite-strings \
169309568Sglebius	-Wno-address -Wno-format-nonliteral -Wno-sign-compare \
170309568Sglebius	-Wno-type-limits -Wno-unused-parameter
171309568Sglebius#
172309568Sglebius# If you want to use System V compatibility code, add
173309568Sglebius#	-DUSG_COMPAT
174309568Sglebius# to the end of the "CFLAGS=" line.  This arrange for "timezone" and "daylight"
175309568Sglebius# variables to be kept up-to-date by the time conversion functions.  Neither
176309568Sglebius# "timezone" nor "daylight" is described in X3J11's work.
177309568Sglebius#
178309568Sglebius# If your system has a "GMT offset" field in its "struct tm"s
179309568Sglebius# (or if you decide to add such a field in your system's "time.h" file),
180309568Sglebius# add the name to a define such as
181309568Sglebius#	-DTM_GMTOFF=tm_gmtoff
182309568Sglebius# to the end of the "CFLAGS=" line.  If not defined, the code attempts to
183309568Sglebius# guess TM_GMTOFF from other macros; define NO_TM_GMTOFF to suppress this.
184309568Sglebius# Similarly, if your system has a "zone abbreviation" field, define
185309568Sglebius#	-DTM_ZONE=tm_zone
186309568Sglebius# and define NO_TM_ZONE to suppress any guessing.  These two fields are not
187309568Sglebius# required by POSIX, but are widely available on GNU/Linux and BSD systems.
188309568Sglebius#
189309568Sglebius# If you want functions that were inspired by early versions of X3J11's work,
190309568Sglebius# add
191309568Sglebius#	-DSTD_INSPIRED
192309568Sglebius# to the end of the "CFLAGS=" line.  This arranges for the functions
193309568Sglebius# "tzsetwall", "offtime", "timelocal", "timegm", "timeoff",
194309568Sglebius# "posix2time", and "time2posix" to be added to the time conversion library.
195309568Sglebius# "tzsetwall" is like "tzset" except that it arranges for local wall clock
196309568Sglebius# time (rather than the time specified in the TZ environment variable)
197309568Sglebius# to be used.
198309568Sglebius# "offtime" is like "gmtime" except that it accepts a second (long) argument
199309568Sglebius# that gives an offset to add to the time_t when converting it.
200309568Sglebius# "timelocal" is equivalent to "mktime".
201309568Sglebius# "timegm" is like "timelocal" except that it turns a struct tm into
202309568Sglebius# a time_t using UT (rather than local time as "timelocal" does).
203309568Sglebius# "timeoff" is like "timegm" except that it accepts a second (long) argument
204309568Sglebius# that gives an offset to use when converting to a time_t.
205309568Sglebius# "posix2time" and "time2posix" are described in an included manual page.
206309568Sglebius# X3J11's work does not describe any of these functions.
207309568Sglebius# Sun has provided "tzsetwall", "timelocal", and "timegm" in SunOS 4.0.
208309568Sglebius# These functions may well disappear in future releases of the time
209309568Sglebius# conversion package.
210309568Sglebius#
211309568Sglebius# If you don't want functions that were inspired by NetBSD, add
212309568Sglebius#	-DNETBSD_INSPIRED=0
213309568Sglebius# to the end of the "CFLAGS=" line.  Otherwise, the functions
214309568Sglebius# "localtime_rz", "mktime_z", "tzalloc", and "tzfree" are added to the
215309568Sglebius# time library, and if STD_INSPIRED is also defined the functions
216309568Sglebius# "posix2time_z" and "time2posix_z" are added as well.
217309568Sglebius# The functions ending in "_z" (or "_rz") are like their unsuffixed
218309568Sglebius# (or suffixed-by-"_r") counterparts, except with an extra first
219309568Sglebius# argument of opaque type timezone_t that specifies the time zone.
220309568Sglebius# "tzalloc" allocates a timezone_t value, and "tzfree" frees it.
221309568Sglebius#
222309568Sglebius# If you want to allocate state structures in localtime, add
223309568Sglebius#	-DALL_STATE
224309568Sglebius# to the end of the "CFLAGS=" line.  Storage is obtained by calling malloc.
225309568Sglebius#
226309568Sglebius# If you want an "altzone" variable (a la System V Release 3.1), add
227309568Sglebius#	-DALTZONE
228309568Sglebius# to the end of the "CFLAGS=" line.
229309568Sglebius# This variable is not described in X3J11's work.
230309568Sglebius#
231309568Sglebius# NIST-PCTS:151-2, Version 1.4, (1993-12-03) is a test suite put
232309568Sglebius# out by the National Institute of Standards and Technology
233309568Sglebius# which claims to test C and Posix conformance.  If you want to pass PCTS, add
234309568Sglebius#	-DPCTS
235309568Sglebius# to the end of the "CFLAGS=" line.
236309568Sglebius#
237309568Sglebius# If you want strict compliance with XPG4 as of 1994-04-09, add
238309568Sglebius#	-DXPG4_1994_04_09
239309568Sglebius# to the end of the "CFLAGS=" line.  This causes "strftime" to always return
240309568Sglebius# 53 as a week number (rather than 52 or 53) for those days in January that
241309568Sglebius# before the first Monday in January when a "%V" format is used and January 1
242309568Sglebius# falls on a Friday, Saturday, or Sunday.
243309568Sglebius
244309568SglebiusCFLAGS=
245309568Sglebius
246309568Sglebius# Linker flags.  Default to $(LFLAGS) for backwards compatibility
247309568Sglebius# to release 2012h and earlier.
248309568Sglebius
249309568SglebiusLDFLAGS=	$(LFLAGS)
250309568Sglebius
251309568Sglebius# For leap seconds, this Makefile uses LEAPSECONDS='-L leapseconds' in
252309568Sglebius# submake command lines.  The default is no leap seconds.
253309568Sglebius
254309568SglebiusLEAPSECONDS=
255309568Sglebius
256309568Sglebius# The zic command and its arguments.
257309568Sglebius
258309568Sglebiuszic=		./zic
259309568SglebiusZIC=		$(zic) $(ZFLAGS)
260309568Sglebius
261309568SglebiusZFLAGS=
262309568Sglebius
263309568Sglebius# How to use zic to install tz binary files.
264309568Sglebius
265309568SglebiusZIC_INSTALL=	$(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR) $(LEAPSECONDS)
266309568Sglebius
267309568Sglebius# The name of a Posix-compliant 'awk' on your system.
268309568SglebiusAWK=		awk
269309568Sglebius
270309568Sglebius# The full path name of a Posix-compliant shell, preferably one that supports
271309568Sglebius# the Korn shell's 'select' statement as an extension.
272309568Sglebius# These days, Bash is the most popular.
273309568Sglebius# It should be OK to set this to /bin/sh, on platforms where /bin/sh
274309568Sglebius# lacks 'select' or doesn't completely conform to Posix, but /bin/bash
275309568Sglebius# is typically nicer if it works.
276309568SglebiusKSHELL=		/bin/bash
277309568Sglebius
278309568Sglebius# The path where SGML DTDs are kept and the catalog file(s) to use when
279309568Sglebius# validating.  The default should work on both Debian and Red Hat.
280309568SglebiusSGML_TOPDIR= /usr
281309568SglebiusSGML_DTDDIR= $(SGML_TOPDIR)/share/xml/w3c-sgml-lib/schema/dtd
282309568SglebiusSGML_SEARCH_PATH= $(SGML_DTDDIR)/REC-html401-19991224
283309568SglebiusSGML_CATALOG_FILES= \
284309568Sglebius  $(SGML_TOPDIR)/share/doc/w3-recs/html/www.w3.org/TR/1999/REC-html401-19991224/HTML4.cat:$(SGML_TOPDIR)/share/sgml/html/4.01/HTML4.cat
285309568Sglebius
286309568Sglebius# The name, arguments and environment of a program to validate your web pages.
287309568Sglebius# See <http://openjade.sourceforge.net/doc/> for a validator, and
288309568Sglebius# <https://validator.w3.org/source/> for a validation library.
289309568SglebiusVALIDATE = nsgmls
290309568SglebiusVALIDATE_FLAGS = -s -B -wall -wno-unused-param
291309568SglebiusVALIDATE_ENV = \
292309568Sglebius  SGML_CATALOG_FILES=$(SGML_CATALOG_FILES) \
293309568Sglebius  SGML_SEARCH_PATH=$(SGML_SEARCH_PATH) \
294309568Sglebius  SP_CHARSET_FIXED=YES \
295309568Sglebius  SP_ENCODING=UTF-8
296309568Sglebius
297309568Sglebius# This expensive test requires USE_LTZ.
298309568Sglebius# To suppress it, define this macro to be empty.
299309568SglebiusCHECK_TIME_T_ALTERNATIVES = check_time_t_alternatives
300309568Sglebius
301309568Sglebius# SAFE_CHAR is a regular expression that matches a safe character.
302309568Sglebius# Some parts of this distribution are limited to safe characters;
303309568Sglebius# others can use any UTF-8 character.
304309568Sglebius# For now, the safe characters are a safe subset of ASCII.
305309568Sglebius# The caller must set the shell variable 'sharp' to the character '#',
306309568Sglebius# since Makefile macros cannot contain '#'.
307309568Sglebius# TAB_CHAR is a single tab character, in single quotes.
308309568SglebiusTAB_CHAR=	'	'
309309568SglebiusSAFE_CHARSET1=	$(TAB_CHAR)' !\"'$$sharp'$$%&'\''()*+,./0123456789:;<=>?@'
310309568SglebiusSAFE_CHARSET2=	'ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\^_`'
311309568SglebiusSAFE_CHARSET3=	'abcdefghijklmnopqrstuvwxyz{|}~'
312309568SglebiusSAFE_CHARSET=	$(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3)
313309568SglebiusSAFE_CHAR=	'[]'$(SAFE_CHARSET)'-]'
314309568Sglebius
315309568Sglebius# OK_CHAR matches any character allowed in the distributed files.
316309568Sglebius# This is the same as SAFE_CHAR, except that multibyte letters are
317309568Sglebius# also allowed so that commentary can contain people's names and quote
318309568Sglebius# non-English sources.  For non-letters the sources are limited to
319309568Sglebius# ASCII renderings for the convenience of maintainers whose text editors
320309568Sglebius# mishandle UTF-8 by default (e.g., XEmacs 21.4.22).
321309568SglebiusOK_CHAR=	'[][:alpha:]'$(SAFE_CHARSET)'-]'
322309568Sglebius
323309568Sglebius# SAFE_LINE matches a line of safe characters.
324309568Sglebius# SAFE_SHARP_LINE is similar, except any OK character can follow '#';
325309568Sglebius# this is so that comments can contain non-ASCII characters.
326309568Sglebius# OK_LINE matches a line of OK characters.
327309568SglebiusSAFE_LINE=	'^'$(SAFE_CHAR)'*$$'
328309568SglebiusSAFE_SHARP_LINE='^'$(SAFE_CHAR)'*('$$sharp$(OK_CHAR)'*)?$$'
329309568SglebiusOK_LINE=	'^'$(OK_CHAR)'*$$'
330309568Sglebius
331309568Sglebius# Flags to give 'tar' when making a distribution.
332309568Sglebius# Try to use flags appropriate for GNU tar.
333309568SglebiusGNUTARFLAGS= --numeric-owner --owner=0 --group=0 --mode=go+u,go-w --sort=name
334309568SglebiusTARFLAGS=	`if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \
335309568Sglebius		 then echo $(GNUTARFLAGS); \
336309568Sglebius		 else :; \
337309568Sglebius		 fi`
338309568Sglebius
339309568Sglebius# Flags to give 'gzip' when making a distribution.
340309568SglebiusGZIPFLAGS=	-9n
341309568Sglebius
342309568Sglebius###############################################################################
343309568Sglebius
344309568Sglebius#MAKE=		make
345309568Sglebius
346309568Sglebiuscc=		cc
347309568SglebiusCC=		$(cc) -DTZDIR=\"$(TZDIR)\"
348309568Sglebius
349309568SglebiusAR=		ar
350309568Sglebius
351309568Sglebius# ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib.
352309568SglebiusRANLIB=		:
353309568Sglebius
354309568SglebiusTZCOBJS=	zic.o
355309568SglebiusTZDOBJS=	zdump.o localtime.o asctime.o
356309568SglebiusDATEOBJS=	date.o localtime.o strftime.o asctime.o
357309568SglebiusLIBSRCS=	localtime.c asctime.c difftime.c
358309568SglebiusLIBOBJS=	localtime.o asctime.o difftime.o
359309568SglebiusHEADERS=	tzfile.h private.h
360309568SglebiusNONLIBSRCS=	zic.c zdump.c
361309568SglebiusNEWUCBSRCS=	date.c strftime.c
362309568SglebiusSOURCES=	$(HEADERS) $(LIBSRCS) $(NONLIBSRCS) $(NEWUCBSRCS) \
363309568Sglebius			tzselect.ksh workman.sh
364309568SglebiusMANS=		newctime.3 newstrftime.3 newtzset.3 time2posix.3 \
365309568Sglebius			tzfile.5 tzselect.8 zic.8 zdump.8
366309568SglebiusMANTXTS=	newctime.3.txt newstrftime.3.txt newtzset.3.txt \
367309568Sglebius			time2posix.3.txt \
368309568Sglebius			tzfile.5.txt tzselect.8.txt zic.8.txt zdump.8.txt \
369309568Sglebius			date.1.txt
370309568SglebiusCOMMON=		CONTRIBUTING LICENSE Makefile NEWS README Theory version
371309568SglebiusWEB_PAGES=	tz-art.htm tz-how-to.html tz-link.htm
372309568SglebiusDOCS=		$(MANS) date.1 $(MANTXTS) $(WEB_PAGES)
373309568SglebiusPRIMARY_YDATA=	africa antarctica asia australasia \
374309568Sglebius		europe northamerica southamerica
375309568SglebiusYDATA=		$(PRIMARY_YDATA) pacificnew etcetera backward
376309568SglebiusNDATA=		systemv factory
377309568SglebiusTDATA=		$(YDATA) $(NDATA)
378309568SglebiusZONETABLES=	zone1970.tab zone.tab
379309568SglebiusTABDATA=	iso3166.tab leapseconds $(ZONETABLES)
380309568SglebiusLEAP_DEPS=	leapseconds.awk leap-seconds.list
381309568SglebiusDATA=		$(YDATA) $(NDATA) backzone $(TABDATA) \
382309568Sglebius			leap-seconds.list yearistype.sh
383309568SglebiusAWK_SCRIPTS=	checklinks.awk checktab.awk leapseconds.awk
384309568SglebiusMISC=		$(AWK_SCRIPTS) zoneinfo2tdf.pl
385309568SglebiusTZS_YEAR=	2050
386309568SglebiusTZS=		to$(TZS_YEAR).tzs
387309568SglebiusTZS_NEW=	to$(TZS_YEAR)new.tzs
388309568SglebiusTZS_DEPS=	$(PRIMARY_YDATA) asctime.c localtime.c \
389309568Sglebius			private.h tzfile.h zdump.c zic.c
390309568SglebiusENCHILADA=	$(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC) $(TZS)
391309568Sglebius
392309568Sglebius# Consult these files when deciding whether to rebuild the 'version' file.
393309568Sglebius# This list is not the same as the output of 'git ls-files', since
394309568Sglebius# .gitignore is not distributed.
395309568SglebiusVERSION_DEPS= \
396309568Sglebius		CONTRIBUTING LICENSE Makefile NEWS README Theory \
397309568Sglebius		africa antarctica asctime.c asia australasia \
398309568Sglebius		backward backzone \
399309568Sglebius		checklinks.awk checktab.awk \
400309568Sglebius		date.1 date.c difftime.c \
401309568Sglebius		etcetera europe factory iso3166.tab \
402309568Sglebius		leap-seconds.list leapseconds.awk localtime.c \
403309568Sglebius		newctime.3 newstrftime.3 newtzset.3 northamerica \
404309568Sglebius		pacificnew private.h \
405309568Sglebius		southamerica strftime.c systemv \
406309568Sglebius		time2posix.3 tz-art.htm tz-how-to.html tz-link.htm \
407309568Sglebius		tzfile.5 tzfile.h tzselect.8 tzselect.ksh \
408309568Sglebius		workman.sh yearistype.sh \
409309568Sglebius		zdump.8 zdump.c zic.8 zic.c \
410309568Sglebius		zone.tab zone1970.tab zoneinfo2tdf.pl
411309568Sglebius
412309568Sglebius# And for the benefit of csh users on systems that assume the user
413309568Sglebius# shell should be used to handle commands in Makefiles. . .
414309568Sglebius
415309568SglebiusSHELL=		/bin/sh
416309568Sglebius
417309568Sglebiusall:		tzselect yearistype zic zdump libtz.a $(TABDATA)
418309568Sglebius
419309568SglebiusALL:		all date $(ENCHILADA)
420309568Sglebius
421309568Sglebiusinstall:	all $(DATA) $(REDO) $(MANS)
422309568Sglebius		mkdir -p $(DESTDIR)$(ETCDIR) $(DESTDIR)$(TZDIR) \
423309568Sglebius			$(DESTDIR)$(LIBDIR) \
424309568Sglebius			$(DESTDIR)$(MANDIR)/man3 $(DESTDIR)$(MANDIR)/man5 \
425309568Sglebius			$(DESTDIR)$(MANDIR)/man8
426309568Sglebius		$(ZIC_INSTALL) -l $(LOCALTIME) -p $(POSIXRULES)
427309568Sglebius		cp -f iso3166.tab $(ZONETABLES) $(DESTDIR)$(TZDIR)/.
428309568Sglebius		cp tzselect zic zdump $(DESTDIR)$(ETCDIR)/.
429309568Sglebius		cp libtz.a $(DESTDIR)$(LIBDIR)/.
430309568Sglebius		$(RANLIB) $(DESTDIR)$(LIBDIR)/libtz.a
431309568Sglebius		cp -f newctime.3 newtzset.3 $(DESTDIR)$(MANDIR)/man3/.
432309568Sglebius		cp -f tzfile.5 $(DESTDIR)$(MANDIR)/man5/.
433309568Sglebius		cp -f tzselect.8 zdump.8 zic.8 $(DESTDIR)$(MANDIR)/man8/.
434309568Sglebius
435309568SglebiusINSTALL:	ALL install date.1
436309568Sglebius		mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man1
437309568Sglebius		cp date $(DESTDIR)$(BINDIR)/.
438309568Sglebius		cp -f date.1 $(DESTDIR)$(MANDIR)/man1/.
439309568Sglebius
440309568Sglebiusversion:	$(VERSION_DEPS)
441309568Sglebius		{ (type git) >/dev/null 2>&1 && \
442309568Sglebius		  V=`git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \
443309568Sglebius				--abbrev=7 --dirty` || \
444309568Sglebius		  V=$(VERSION); } && \
445309568Sglebius		printf '%s\n' "$$V" >$@.out
446309568Sglebius		mv $@.out $@
447309568Sglebius
448309568Sglebiusversion.h:	version
449309568Sglebius		VERSION=`cat version` && printf '%s\n' \
450309568Sglebius		  'static char const PKGVERSION[]="($(PACKAGE)) ";' \
451309568Sglebius		  "static char const TZVERSION[]=\"$$VERSION\";" \
452309568Sglebius		  'static char const REPORT_BUGS_TO[]="$(BUGEMAIL)";' \
453309568Sglebius		  >$@.out
454309568Sglebius		mv $@.out $@
455309568Sglebius
456309568Sglebiuszdump:		$(TZDOBJS)
457309568Sglebius		$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS)
458309568Sglebius
459309568Sglebiuszic:		$(TZCOBJS)
460309568Sglebius		$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS)
461309568Sglebius
462309568Sglebiusyearistype:	yearistype.sh
463309568Sglebius		cp yearistype.sh yearistype
464309568Sglebius		chmod +x yearistype
465309568Sglebius
466309568Sglebiusleapseconds:	$(LEAP_DEPS)
467309568Sglebius		$(AWK) -f leapseconds.awk leap-seconds.list >$@.out
468309568Sglebius		mv $@.out $@
469309568Sglebius
470309568Sglebius# Arguments to pass to submakes of install_data.
471309568Sglebius# They can be overridden by later submake arguments.
472309568SglebiusINSTALLARGS = \
473309568Sglebius DESTDIR=$(DESTDIR) \
474309568Sglebius LEAPSECONDS='$(LEAPSECONDS)' \
475309568Sglebius PACKRATDATA='$(PACKRATDATA)' \
476309568Sglebius TZDIR=$(TZDIR) \
477309568Sglebius YEARISTYPE=$(YEARISTYPE) \
478309568Sglebius ZIC='$(ZIC)'
479309568Sglebius
480309568Sglebius# 'make install_data' installs one set of tz binary files.
481309568Sglebius# It can be tailored by setting LEAPSECONDS, PACKRATDATA, etc.
482309568Sglebiusinstall_data:	zic leapseconds yearistype $(PACKRATDATA) $(TDATA)
483309568Sglebius		$(ZIC_INSTALL) $(TDATA)
484309568Sglebius		$(AWK) '/^Rule/' $(TDATA) | $(ZIC_INSTALL) - $(PACKRATDATA)
485309568Sglebius
486309568Sglebiusposix_only:
487309568Sglebius		$(MAKE) $(INSTALLARGS) LEAPSECONDS= install_data
488309568Sglebius
489309568Sglebiusright_only:
490309568Sglebius		$(MAKE) $(INSTALLARGS) LEAPSECONDS='-L leapseconds' \
491309568Sglebius			install_data
492309568Sglebius
493309568Sglebius# In earlier versions of this makefile, the other two directories were
494309568Sglebius# subdirectories of $(TZDIR).  However, this led to configuration errors.
495309568Sglebius# For example, with posix_right under the earlier scheme,
496309568Sglebius# TZ='right/Australia/Adelaide' got you localtime with leap seconds,
497309568Sglebius# but gmtime without leap seconds, which led to problems with applications
498309568Sglebius# like sendmail that subtract gmtime from localtime.
499309568Sglebius# Therefore, the other two directories are now siblings of $(TZDIR).
500309568Sglebius# You must replace all of $(TZDIR) to switch from not using leap seconds
501309568Sglebius# to using them, or vice versa.
502309568Sglebiusright_posix:	right_only
503309568Sglebius		rm -fr $(DESTDIR)$(TZDIR)-leaps
504309568Sglebius		ln -s $(TZDIR_BASENAME) $(DESTDIR)$(TZDIR)-leaps || \
505309568Sglebius		  $(MAKE) $(INSTALLARGS) TZDIR=$(TZDIR)-leaps right_only
506309568Sglebius		$(MAKE) $(INSTALLARGS) TZDIR=$(TZDIR)-posix posix_only
507309568Sglebius
508309568Sglebiusposix_right:	posix_only
509309568Sglebius		rm -fr $(DESTDIR)$(TZDIR)-posix
510309568Sglebius		ln -s $(TZDIR_BASENAME) $(DESTDIR)$(TZDIR)-posix || \
511309568Sglebius		  $(MAKE) $(INSTALLARGS) TZDIR=$(TZDIR)-posix posix_only
512309568Sglebius		$(MAKE) $(INSTALLARGS) TZDIR=$(TZDIR)-leaps right_only
513309568Sglebius
514309568Sglebius# This obsolescent rule is present for backwards compatibility with
515309568Sglebius# tz releases 2014g through 2015g.  It should go away eventually.
516309568Sglebiusposix_packrat:
517309568Sglebius		$(MAKE) $(INSTALLARGS) PACKRATDATA=backzone posix_only
518309568Sglebius
519309568Sglebiuszones:		$(REDO)
520309568Sglebius
521309568Sglebius$(TZS_NEW):	$(TDATA) zdump zic
522309568Sglebius		mkdir -p tzs.dir
523309568Sglebius		$(zic) -d tzs.dir $(TDATA)
524309568Sglebius		$(AWK) '/^Link/{print $$1 "\t" $$2 "\t" $$3}' \
525309568Sglebius		   $(TDATA) | LC_ALL=C sort >$@.out
526309568Sglebius		wd=`pwd` && \
527309568Sglebius		zones=`$(AWK) -v wd="$$wd" \
528309568Sglebius				'/^Zone/{print wd "/tzs.dir/" $$2}' $(TDATA) \
529309568Sglebius			 | LC_ALL=C sort` && \
530309568Sglebius		./zdump -i -c $(TZS_YEAR) $$zones >>$@.out
531309568Sglebius		sed 's,^TZ=".*tzs\.dir/,TZ=",' $@.out >$@.sed.out
532309568Sglebius		rm -fr tzs.dir $@.out
533309568Sglebius		mv $@.sed.out $@
534309568Sglebius
535309568Sglebius# If $(TZS) does not already exist (e.g., old-format tarballs), create it.
536309568Sglebius# If it exists but 'make check_tzs' fails, a maintainer should inspect the
537309568Sglebius# failed output and fix the inconsistency, perhaps by running 'make force_tzs'.
538309568Sglebius$(TZS):
539309568Sglebius		$(MAKE) force_tzs
540309568Sglebius
541309568Sglebiusforce_tzs:	$(TZS_NEW)
542309568Sglebius		cp $(TZS_NEW) $(TZS)
543309568Sglebius
544309568Sglebiuslibtz.a:	$(LIBOBJS)
545309568Sglebius		$(AR) ru $@ $(LIBOBJS)
546309568Sglebius		$(RANLIB) $@
547309568Sglebius
548309568Sglebiusdate:		$(DATEOBJS)
549309568Sglebius		$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS)
550309568Sglebius
551309568Sglebiustzselect:	tzselect.ksh version
552309568Sglebius		VERSION=`cat version` && sed \
553309568Sglebius			-e 's|#!/bin/bash|#!$(KSHELL)|g' \
554309568Sglebius			-e 's|AWK=[^}]*|AWK=$(AWK)|g' \
555309568Sglebius			-e 's|\(PKGVERSION\)=.*|\1='\''($(PACKAGE)) '\''|' \
556309568Sglebius			-e 's|\(REPORT_BUGS_TO\)=.*|\1=$(BUGEMAIL)|' \
557309568Sglebius			-e 's|TZDIR=[^}]*|TZDIR=$(TZDIR)|' \
558309568Sglebius			-e 's|\(TZVERSION\)=.*|\1='"$$VERSION"'|' \
559309568Sglebius			<$@.ksh >$@.out
560309568Sglebius		chmod +x $@.out
561309568Sglebius		mv $@.out $@
562309568Sglebius
563309568Sglebiuscheck:		check_character_set check_white_space check_links check_sorted \
564309568Sglebius		  check_tables check_tzs check_web
565309568Sglebius
566309568Sglebiuscheck_character_set: $(ENCHILADA)
567309568Sglebius		LC_ALL=en_US.utf8 && export LC_ALL && \
568309568Sglebius		sharp='#' && \
569309568Sglebius		! grep -Env $(SAFE_LINE) $(MANS) date.1 $(MANTXTS) \
570309568Sglebius			$(MISC) $(SOURCES) $(WEB_PAGES) \
571309568Sglebius			CONTRIBUTING LICENSE Makefile README version && \
572309568Sglebius		! grep -Env $(SAFE_SHARP_LINE) $(TDATA) backzone \
573309568Sglebius			leapseconds yearistype.sh zone.tab && \
574309568Sglebius		! grep -Env $(OK_LINE) $(ENCHILADA)
575309568Sglebius
576309568Sglebiuscheck_white_space: $(ENCHILADA)
577309568Sglebius		patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \
578309568Sglebius		! grep -En "$$pat" $(ENCHILADA)
579309568Sglebius		! grep -n '[[:space:]]$$' $(ENCHILADA)
580309568Sglebius
581309568SglebiusCHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; }
582309568Sglebius
583309568Sglebiuscheck_sorted: backward backzone iso3166.tab zone.tab zone1970.tab
584309568Sglebius		$(AWK) '/^Link/ {print $$3}' backward | LC_ALL=C sort -cu
585309568Sglebius		$(AWK) '/^Zone/ {print $$2}' backzone | LC_ALL=C sort -cu
586309568Sglebius		$(AWK) '/^[^#]/ {print $$1}' iso3166.tab | LC_ALL=C sort -cu
587309568Sglebius		$(AWK) '/^[^#]/ {print $$1}' zone.tab | LC_ALL=C sort -c
588309568Sglebius		$(AWK) '/^[^#]/ {print substr($$0, 1, 2)}' zone1970.tab | \
589309568Sglebius		  LC_ALL=C sort -c
590309568Sglebius		$(AWK) '/^[^#]/ $(CHECK_CC_LIST)' zone1970.tab | \
591309568Sglebius		  LC_ALL=C sort -cu
592309568Sglebius
593309568Sglebiuscheck_links:	checklinks.awk $(TDATA)
594309568Sglebius		$(AWK) -f checklinks.awk $(TDATA)
595309568Sglebius
596309568Sglebiuscheck_tables:	checktab.awk $(PRIMARY_YDATA) $(ZONETABLES)
597309568Sglebius		for tab in $(ZONETABLES); do \
598309568Sglebius		  $(AWK) -f checktab.awk -v zone_table=$$tab $(PRIMARY_YDATA) \
599309568Sglebius		    || exit; \
600309568Sglebius		done
601309568Sglebius
602309568Sglebiuscheck_tzs:	$(TZS) $(TZS_NEW)
603309568Sglebius		diff -u $(TZS) $(TZS_NEW)
604309568Sglebius
605309568Sglebiuscheck_web:	$(WEB_PAGES)
606309568Sglebius		$(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) $(WEB_PAGES)
607309568Sglebius
608309568Sglebiusclean_misc:
609309568Sglebius		rm -f core *.o *.out \
610309568Sglebius		  date tzselect version.h zdump zic yearistype libtz.a
611309568Sglebiusclean:		clean_misc
612309568Sglebius		rm -fr *.dir tzdb-*/ $(TZS_NEW)
613309568Sglebius
614309568Sglebiusmaintainer-clean: clean
615309568Sglebius		@echo 'This command is intended for maintainers to use; it'
616309568Sglebius		@echo 'deletes files that may need special tools to rebuild.'
617309568Sglebius		rm -f leapseconds version $(MANTXTS) $(TZS) *.asc *.tar.*
618309568Sglebius
619309568Sglebiusnames:
620309568Sglebius		@echo $(ENCHILADA)
621309568Sglebius
622309568Sglebiuspublic:		check check_public $(CHECK_TIME_T_ALTERNATIVES) \
623309568Sglebius		tarballs signatures
624309568Sglebius
625309568Sglebiusdate.1.txt:	date.1
626309568Sglebiusnewctime.3.txt:	newctime.3
627309568Sglebiusnewstrftime.3.txt: newstrftime.3
628309568Sglebiusnewtzset.3.txt:	newtzset.3
629309568Sglebiustime2posix.3.txt: time2posix.3
630309568Sglebiustzfile.5.txt:	tzfile.5
631309568Sglebiustzselect.8.txt:	tzselect.8
632309568Sglebiuszdump.8.txt:	zdump.8
633309568Sglebiuszic.8.txt:	zic.8
634309568Sglebius
635309568Sglebius$(MANTXTS):	workman.sh
636309568Sglebius		LC_ALL=C sh workman.sh `expr $@ : '\(.*\)\.txt$$'` >$@.out
637309568Sglebius		mv $@.out $@
638309568Sglebius
639309568Sglebius# Set the time stamps to those of the git repository, if available,
640309568Sglebius# and if the files have not changed since then.
641309568Sglebius# This uses GNU 'touch' syntax 'touch -d@N FILE',
642309568Sglebius# where N is the number of seconds since 1970.
643309568Sglebius# If git or GNU 'touch' is absent, don't bother to sync with git timestamps.
644309568Sglebius# Also, set the timestamp of each prebuilt file like 'leapseconds'
645309568Sglebius# to be the maximum of the files it depends on.
646309568Sglebiusset-timestamps.out: $(ENCHILADA)
647309568Sglebius		rm -f $@
648309568Sglebius		if (type git) >/dev/null 2>&1 && \
649309568Sglebius		   files=`git ls-files $(ENCHILADA)` && \
650309568Sglebius		   touch -md @1 test.out; then \
651309568Sglebius		  rm -f test.out && \
652309568Sglebius		  for file in $$files; do \
653309568Sglebius		    if git diff --quiet $$file; then \
654309568Sglebius		      time=`git log -1 --format='tformat:%ct' $$file` && \
655309568Sglebius		      touch -cmd @$$time $$file; \
656309568Sglebius		    else \
657309568Sglebius		      echo >&2 "$$file: warning: does not match repository"; \
658309568Sglebius		    fi || exit; \
659309568Sglebius		  done; \
660309568Sglebius		fi
661309568Sglebius		touch -cmr `ls -t $(LEAP_DEPS) | sed 1q` leapseconds
662309568Sglebius		for file in `ls $(MANTXTS) | sed 's/\.txt$$//'`; do \
663309568Sglebius		  touch -cmr `ls -t $$file workman.sh | sed 1q` $$file.txt || \
664309568Sglebius		    exit; \
665309568Sglebius		done
666309568Sglebius		touch -cmr `ls -t $(TZS_DEPS) | sed 1q` $(TZS)
667309568Sglebius		touch -cmr `ls -t $(VERSION_DEPS) | sed 1q` version
668309568Sglebius		touch $@
669309568Sglebius
670309568Sglebius# The zics below ensure that each data file can stand on its own.
671309568Sglebius# We also do an all-files run to catch links to links.
672309568Sglebius
673309568Sglebiuscheck_public:
674309568Sglebius		$(MAKE) maintainer-clean
675309568Sglebius		$(MAKE) "CFLAGS=$(GCC_DEBUG_FLAGS)" ALL
676309568Sglebius		mkdir -p public.dir
677309568Sglebius		for i in $(TDATA) ; do \
678309568Sglebius		  $(zic) -v -d public.dir $$i 2>&1 || exit; \
679309568Sglebius		done
680309568Sglebius		$(zic) -v -d public.dir $(TDATA)
681309568Sglebius		rm -fr public.dir
682309568Sglebius
683309568Sglebius# Check that the code works under various alternative
684309568Sglebius# implementations of time_t.
685309568Sglebiuscheck_time_t_alternatives:
686309568Sglebius		if diff -q Makefile Makefile 2>/dev/null; then \
687309568Sglebius		  quiet_option='-q'; \
688309568Sglebius		else \
689309568Sglebius		  quiet_option=''; \
690309568Sglebius		fi && \
691309568Sglebius		wd=`pwd` && \
692309568Sglebius		zones=`$(AWK) '/^[^#]/ { print $$3 }' <zone1970.tab` && \
693309568Sglebius		for type in $(TIME_T_ALTERNATIVES); do \
694309568Sglebius		  mkdir -p time_t.dir/$$type && \
695309568Sglebius		  $(MAKE) clean_misc && \
696309568Sglebius		  $(MAKE) TOPDIR="$$wd/time_t.dir/$$type" \
697309568Sglebius		    CFLAGS='$(CFLAGS) -Dtime_tz='"'$$type'" \
698309568Sglebius		    REDO='$(REDO)' \
699309568Sglebius		    install && \
700309568Sglebius		  diff $$quiet_option -r \
701309568Sglebius		    time_t.dir/int64_t/etc/zoneinfo \
702309568Sglebius		    time_t.dir/$$type/etc/zoneinfo && \
703309568Sglebius		  case $$type in \
704309568Sglebius		  int32_t) range=-2147483648,2147483647;; \
705309568Sglebius		  uint32_t) range=0,4294967296;; \
706309568Sglebius		  int64_t) continue;; \
707309568Sglebius		  *u*) range=0,10000000000;; \
708309568Sglebius		  *) range=-10000000000,10000000000;; \
709309568Sglebius		  esac && \
710309568Sglebius		  echo checking $$type zones ... && \
711309568Sglebius		  time_t.dir/int64_t/etc/zdump -V -t $$range $$zones \
712309568Sglebius		      >time_t.dir/int64_t.out && \
713309568Sglebius		  time_t.dir/$$type/etc/zdump -V -t $$range $$zones \
714309568Sglebius		      >time_t.dir/$$type.out && \
715309568Sglebius		  diff -u time_t.dir/int64_t.out time_t.dir/$$type.out \
716309568Sglebius		    || exit; \
717309568Sglebius		done
718309568Sglebius		rm -fr time_t.dir
719309568Sglebius
720309568Sglebiustarballs traditional_tarballs signatures traditional_signatures: version
721309568Sglebius		VERSION=`cat version` && \
722309568Sglebius		$(MAKE) VERSION="$$VERSION" $@_version
723309568Sglebius
724309568Sglebiustarballs_version: traditional_tarballs_version tzdb-$(VERSION).tar.lz
725309568Sglebiustraditional_tarballs_version: \
726309568Sglebius  tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz
727309568Sglebiussignatures_version: traditional_signatures_version tzdb-$(VERSION).tar.lz.asc
728309568Sglebiustraditional_signatures_version: \
729309568Sglebius  tzcode$(VERSION).tar.gz.asc tzdata$(VERSION).tar.gz.asc \
730309568Sglebius
731309568Sglebiustzcode$(VERSION).tar.gz: set-timestamps.out
732309568Sglebius		LC_ALL=C && export LC_ALL && \
733309568Sglebius		tar $(TARFLAGS) -cf - \
734309568Sglebius		    $(COMMON) $(DOCS) $(SOURCES) | \
735309568Sglebius		  gzip $(GZIPFLAGS) >$@.out
736309568Sglebius		mv $@.out $@
737309568Sglebius
738309568Sglebiustzdata$(VERSION).tar.gz: set-timestamps.out
739309568Sglebius		LC_ALL=C && export LC_ALL && \
740309568Sglebius		tar $(TARFLAGS) -cf - $(COMMON) $(DATA) $(MISC) | \
741309568Sglebius		  gzip $(GZIPFLAGS) >$@.out
742309568Sglebius		mv $@.out $@
743309568Sglebius
744309568Sglebiustzdb-$(VERSION).tar.lz: set-timestamps.out
745309568Sglebius		rm -fr tzdb-$(VERSION)
746309568Sglebius		mkdir tzdb-$(VERSION)
747309568Sglebius		ln $(ENCHILADA) tzdb-$(VERSION)
748309568Sglebius		touch -cmr `ls -t tzdb-$(VERSION)/* | sed 1q` tzdb-$(VERSION)
749309568Sglebius		LC_ALL=C && export LC_ALL && \
750309568Sglebius		tar $(TARFLAGS) -cf - tzdb-$(VERSION) | lzip -9 >$@.out
751309568Sglebius		mv $@.out $@
752309568Sglebius
753309568Sglebiustzcode$(VERSION).tar.gz.asc: tzcode$(VERSION).tar.gz
754309568Sglebius		gpg --armor --detach-sign $?
755309568Sglebius
756309568Sglebiustzdata$(VERSION).tar.gz.asc: tzdata$(VERSION).tar.gz
757309568Sglebius		gpg --armor --detach-sign $?
758309568Sglebius
759309568Sglebiustzdb-$(VERSION).tar.lz.asc: tzdb-$(VERSION).tar.lz
760309568Sglebius		gpg --armor --detach-sign $?
761309568Sglebius
762309568Sglebiustypecheck:
763309568Sglebius		$(MAKE) clean
764309568Sglebius		for i in "long long" unsigned; \
765309568Sglebius		do \
766309568Sglebius			$(MAKE) CFLAGS="-DTYPECHECK -D__time_t_defined -D_TIME_T \"-Dtime_t=$$i\"" ; \
767309568Sglebius			./zdump -v Europe/Rome ; \
768309568Sglebius			$(MAKE) clean ; \
769309568Sglebius		done
770309568Sglebius
771309568Sglebiuszonenames:	$(TDATA)
772309568Sglebius		@$(AWK) '/^Zone/ { print $$2 } /^Link/ { print $$3 }' $(TDATA)
773309568Sglebius
774309568Sglebiusasctime.o:	private.h tzfile.h
775309568Sglebiusdate.o:		private.h
776309568Sglebiusdifftime.o:	private.h
777309568Sglebiuslocaltime.o:	private.h tzfile.h
778309568Sglebiusstrftime.o:	private.h tzfile.h
779309568Sglebiuszdump.o:	version.h
780309568Sglebiuszic.o:		private.h tzfile.h version.h
781309568Sglebius
782309568Sglebius.KEEP_STATE:
783309568Sglebius
784309568Sglebius.PHONY: ALL INSTALL all
785309568Sglebius.PHONY: check check_character_set check_links
786309568Sglebius.PHONY: check_public check_sorted check_tables
787309568Sglebius.PHONY: check_time_t_alternatives check_tzs check_web check_white_space
788309568Sglebius.PHONY: clean clean_misc force_tzs
789309568Sglebius.PHONY: install install_data maintainer-clean names
790309568Sglebius.PHONY: posix_only posix_packrat posix_right
791309568Sglebius.PHONY: public right_only right_posix signatures signatures_version
792309568Sglebius.PHONY: tarballs tarballs_version typecheck
793309568Sglebius.PHONY: zonenames zones
794