Makefile revision 1.9
11.1Smlelstv# <pre>
21.1Smlelstv# This file is in the public domain, so clarified as of
31.1Smlelstv# 2009-05-17 by Arthur David Olson.
41.1Smlelstv
51.6Schristos# Version numbers of the code and data distributions.
61.9SchristosVERSION =	2013a
71.9Schristos
81.9Schristos# Email address for bug reports.
91.9SchristosBUGEMAIL=	tz@iana.org
101.6Schristos
111.1Smlelstv# Change the line below for your time zone (after finding the zone you want in
121.1Smlelstv# the time zone files, or adding it to a time zone file).
131.1Smlelstv# Alternately, if you discover you've got the wrong time zone, you can just
141.1Smlelstv#	zic -l rightzone
151.1Smlelstv# to correct things.
161.1Smlelstv# Use the command
171.1Smlelstv#	make zonenames
181.1Smlelstv# to get a list of the values you can use for LOCALTIME.
191.1Smlelstv
201.4SchristosLOCALTIME=	GMT
211.1Smlelstv
221.1Smlelstv# If you want something other than Eastern United States time as a template
231.1Smlelstv# for handling POSIX-style time zone environment variables,
241.1Smlelstv# change the line below (after finding the zone you want in the
251.1Smlelstv# time zone files, or adding it to a time zone file).
261.1Smlelstv# (When a POSIX-style environment variable is handled, the rules in the
271.1Smlelstv# template file are used to determine "spring forward" and "fall back" days and
281.1Smlelstv# times; the environment variable itself specifies UTC offsets of standard and
291.1Smlelstv# summer time.)
301.1Smlelstv# Alternately, if you discover you've got the wrong time zone, you can just
311.1Smlelstv#	zic -p rightzone
321.1Smlelstv# to correct things.
331.1Smlelstv# Use the command
341.1Smlelstv#	make zonenames
351.1Smlelstv# to get a list of the values you can use for POSIXRULES.
361.1Smlelstv# If you want POSIX compatibility, use "America/New_York".
371.1Smlelstv
381.1SmlelstvPOSIXRULES=	America/New_York
391.1Smlelstv
401.1Smlelstv# Also see TZDEFRULESTRING below, which takes effect only
411.1Smlelstv# if the time zone files cannot be accessed.
421.1Smlelstv
431.1Smlelstv# Everything gets put in subdirectories of. . .
441.1Smlelstv
451.1SmlelstvTOPDIR=		/usr/local
461.1Smlelstv
471.1Smlelstv# "Compiled" time zone information is placed in the "TZDIR" directory
481.1Smlelstv# (and subdirectories).
491.1Smlelstv# Use an absolute path name for TZDIR unless you're just testing the software.
501.1Smlelstv
511.1SmlelstvTZDIR=		$(TOPDIR)/etc/zoneinfo
521.1Smlelstv
531.1Smlelstv# The "tzselect", "zic", and "zdump" commands get installed in. . .
541.1Smlelstv
551.1SmlelstvETCDIR=		$(TOPDIR)/etc
561.1Smlelstv
571.1Smlelstv# If you "make INSTALL", the "date" command gets installed in. . .
581.1Smlelstv
591.1SmlelstvBINDIR=		$(TOPDIR)/bin
601.1Smlelstv
611.1Smlelstv# Manual pages go in subdirectories of. . .
621.1Smlelstv
631.1SmlelstvMANDIR=		$(TOPDIR)/man
641.1Smlelstv
651.1Smlelstv# Library functions are put in an archive in LIBDIR.
661.1Smlelstv
671.1SmlelstvLIBDIR=		$(TOPDIR)/lib
681.1SmlelstvTZLIB=		$(LIBDIR)/libtz.a
691.1Smlelstv
701.1Smlelstv# If you always want time values interpreted as "seconds since the epoch
711.1Smlelstv# (not counting leap seconds)", use
721.1Smlelstv#	REDO=		posix_only
731.1Smlelstv# below.  If you always want right time values interpreted as "seconds since
741.1Smlelstv# the epoch" (counting leap seconds)", use
751.1Smlelstv#	REDO=		right_only
761.1Smlelstv# below.  If you want both sets of data available, with leap seconds not
771.1Smlelstv# counted normally, use
781.1Smlelstv#	REDO=		posix_right
791.1Smlelstv# below.  If you want both sets of data available, with leap seconds counted
801.1Smlelstv# normally, use
811.1Smlelstv#	REDO=		right_posix
821.1Smlelstv# below.
831.1Smlelstv# POSIX mandates that leap seconds not be counted; for compatibility with it,
841.1Smlelstv# use either "posix_only" or "posix_right".
851.1Smlelstv
861.1SmlelstvREDO=		posix_right
871.1Smlelstv
881.1Smlelstv# Since "." may not be in PATH...
891.1Smlelstv
901.1SmlelstvYEARISTYPE=	./yearistype
911.1Smlelstv
921.1Smlelstv# Non-default libraries needed to link.
931.1Smlelstv# Add -lintl if you want to use `gettext' on Solaris.
941.1SmlelstvLDLIBS=
951.1Smlelstv
961.1Smlelstv# Add the following to the end of the "CFLAGS=" line as needed.
971.1Smlelstv#  -DHAVE_ADJTIME=0 if `adjtime' does not exist (SVR0?)
981.1Smlelstv#  -DHAVE_GETTEXT=1 if `gettext' works (GNU, Linux, Solaris); also see LDLIBS
991.1Smlelstv#  -DHAVE_INCOMPATIBLE_CTIME_R=1 if your system's time.h declares
1001.1Smlelstv#	ctime_r and asctime_r incompatibly with the POSIX standard (Solaris 8).
1011.1Smlelstv#  -DHAVE_SETTIMEOFDAY=0 if settimeofday does not exist (SVR0?)
1021.1Smlelstv#  -DHAVE_SETTIMEOFDAY=1 if settimeofday has just 1 arg (SVR4)
1031.1Smlelstv#  -DHAVE_SETTIMEOFDAY=2 if settimeofday uses 2nd arg (4.3BSD)
1041.1Smlelstv#  -DHAVE_SETTIMEOFDAY=3 if settimeofday ignores 2nd arg (4.4BSD)
1051.1Smlelstv#  -DHAVE_STDINT_H=1 if you have a pre-C99 compiler with "stdint.h"
1061.1Smlelstv#  -DHAVE_SYMLINK=0 if your system lacks the symlink function
1071.1Smlelstv#  -DHAVE_SYS_STAT_H=0 if your compiler lacks a "sys/stat.h"
1081.1Smlelstv#  -DHAVE_SYS_WAIT_H=0 if your compiler lacks a "sys/wait.h"
1091.1Smlelstv#  -DLOCALE_HOME=\"path\" if locales are in "path", not "/usr/lib/locale"
1101.1Smlelstv#  -DHAVE_UNISTD_H=0 if your compiler lacks a "unistd.h" (Microsoft C++ 7?)
1111.1Smlelstv#  -DHAVE_UTMPX_H=1 if your compiler has a "utmpx.h"
1121.1Smlelstv#  -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified
1131.1Smlelstv#	DST transitions if the time zone files cannot be accessed
1141.1Smlelstv#  -DTZ_DOMAIN=\"foo\" to use "foo" for gettext domain name; default is "tz"
1151.1Smlelstv#  -TTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory;
1161.1Smlelstv#	the default is system-supplied, typically "/usr/lib/locale"
1171.1Smlelstv#  $(GCC_DEBUG_FLAGS) if you are using GCC and want lots of checking
1181.1Smlelstv#  -DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU=1
1191.1Smlelstv#	if you do not want run time warnings about formats that may cause
1201.1Smlelstv#	year 2000 grief
1211.5Schristos#  -DNO_ERROR_IN_DST_GAP=1
1221.5Schristos#	if you want mktime() not to return an error in the DST gap.
1231.1Smlelstv#  -DZIC_MAX_ABBR_LEN_WO_WARN=3
1241.1Smlelstv#	(or some other number) to set the maximum time zone abbreviation length
1251.1Smlelstv#	that zic will accept without a warning (the default is 6)
1261.7SchristosGCC_DEBUG_FLAGS = -Dlint -g3 -O3 -fno-common -fstrict-aliasing \
1271.7Schristos	-Wall -Wextra \
1281.7Schristos	-Wbad-function-cast -Wcast-align -Wcast-qual \
1291.7Schristos	-Wformat=2 -Winit-self \
1301.7Schristos	-Wmissing-declarations -Wmissing-noreturn -Wmissing-prototypes \
1311.7Schristos	-Wnested-externs \
1321.7Schristos	-Wno-format-nonliteral -Wno-sign-compare -Wno-sign-conversion \
1331.7Schristos	-Wno-type-limits \
1341.7Schristos	-Wno-unused-parameter -Woverlength-strings -Wpointer-arith \
1351.7Schristos	-Wshadow -Wstrict-prototypes -Wsuggest-attribute=const \
1361.7Schristos	-Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wtrampolines \
1371.7Schristos	-Wwrite-strings
1381.1Smlelstv#
1391.1Smlelstv# If you want to use System V compatibility code, add
1401.1Smlelstv#	-DUSG_COMPAT
1411.1Smlelstv# to the end of the "CFLAGS=" line.  This arrange for "timezone" and "daylight"
1421.1Smlelstv# variables to be kept up-to-date by the time conversion functions.  Neither
1431.1Smlelstv# "timezone" nor "daylight" is described in X3J11's work.
1441.1Smlelstv#
1451.1Smlelstv# If your system has a "GMT offset" field in its "struct tm"s
1461.1Smlelstv# (or if you decide to add such a field in your system's "time.h" file),
1471.1Smlelstv# add the name to a define such as
1481.1Smlelstv#	-DTM_GMTOFF=tm_gmtoff
1491.1Smlelstv# or
1501.1Smlelstv#	-DTM_GMTOFF=_tm_gmtoff
1511.1Smlelstv# to the end of the "CFLAGS=" line.
1521.1Smlelstv# Neither tm_gmtoff nor _tm_gmtoff is described in X3J11's work;
1531.1Smlelstv# in its work, use of "tm_gmtoff" is described as non-conforming.
1541.1Smlelstv# Both Linux and BSD have done the equivalent of defining TM_GMTOFF in
1551.1Smlelstv# their recent releases.
1561.1Smlelstv#
1571.1Smlelstv# If your system has a "zone abbreviation" field in its "struct tm"s
1581.1Smlelstv# (or if you decide to add such a field in your system's "time.h" file),
1591.1Smlelstv# add the name to a define such as
1601.1Smlelstv#	-DTM_ZONE=tm_zone
1611.1Smlelstv# or
1621.1Smlelstv#	-DTM_ZONE=_tm_zone
1631.1Smlelstv# to the end of the "CFLAGS=" line.
1641.1Smlelstv# Neither tm_zone nor _tm_zone is described in X3J11's work;
1651.1Smlelstv# in its work, use of "tm_zone" is described as non-conforming.
1661.1Smlelstv# Both UCB and Sun have done the equivalent of defining TM_ZONE in
1671.1Smlelstv# their recent releases.
1681.1Smlelstv#
1691.1Smlelstv# If you want functions that were inspired by early versions of X3J11's work,
1701.1Smlelstv# add
1711.1Smlelstv#	-DSTD_INSPIRED
1721.1Smlelstv# to the end of the "CFLAGS=" line.  This arranges for the functions
1731.1Smlelstv# "tzsetwall", "offtime", "timelocal", "timegm", "timeoff",
1741.1Smlelstv# "posix2time", and "time2posix" to be added to the time conversion library.
1751.1Smlelstv# "tzsetwall" is like "tzset" except that it arranges for local wall clock
1761.1Smlelstv# time (rather than the time specified in the TZ environment variable)
1771.1Smlelstv# to be used.
1781.1Smlelstv# "offtime" is like "gmtime" except that it accepts a second (long) argument
1791.1Smlelstv# that gives an offset to add to the time_t when converting it.
1801.1Smlelstv# "timelocal" is equivalent to "mktime".
1811.1Smlelstv# "timegm" is like "timelocal" except that it turns a struct tm into
1821.1Smlelstv# a time_t using UTC (rather than local time as "timelocal" does).
1831.1Smlelstv# "timeoff" is like "timegm" except that it accepts a second (long) argument
1841.1Smlelstv# that gives an offset to use when converting to a time_t.
1851.1Smlelstv# "posix2time" and "time2posix" are described in an included manual page.
1861.1Smlelstv# X3J11's work does not describe any of these functions.
1871.1Smlelstv# Sun has provided "tzsetwall", "timelocal", and "timegm" in SunOS 4.0.
1881.1Smlelstv# These functions may well disappear in future releases of the time
1891.1Smlelstv# conversion package.
1901.1Smlelstv#
1911.1Smlelstv# If you want Source Code Control System ID's left out of object modules, add
1921.1Smlelstv#	-DNOID
1931.1Smlelstv# to the end of the "CFLAGS=" line.
1941.1Smlelstv#
1951.1Smlelstv# If you'll never want to handle solar-time-based time zones, add
1961.1Smlelstv#	-DNOSOLAR
1971.1Smlelstv# to the end of the "CFLAGS=" line
1981.1Smlelstv# (and comment out the "SDATA=" line below).
1991.1Smlelstv# This reduces (slightly) the run-time data-space requirements of
2001.1Smlelstv# the time conversion functions; it may reduce the acceptability of your system
2011.1Smlelstv# to folks in oil- and cash-rich places.
2021.1Smlelstv#
2031.1Smlelstv# If you want to allocate state structures in localtime, add
2041.1Smlelstv#	-DALL_STATE
2051.1Smlelstv# to the end of the "CFLAGS=" line.  Storage is obtained by calling malloc.
2061.1Smlelstv#
2071.1Smlelstv# If you want an "altzone" variable (a la System V Release 3.1), add
2081.1Smlelstv#	-DALTZONE
2091.1Smlelstv# to the end of the "CFLAGS=" line.
2101.1Smlelstv# This variable is not described in X3J11's work.
2111.1Smlelstv#
2121.1Smlelstv# If you want a "gtime" function (a la MACH), add
2131.1Smlelstv#	-DCMUCS
2141.1Smlelstv# to the end of the "CFLAGS=" line
2151.1Smlelstv# This function is not described in X3J11's work.
2161.1Smlelstv#
2171.1Smlelstv# NIST-PCTS:151-2, Version 1.4, (1993-12-03) is a test suite put
2181.1Smlelstv# out by the National Institute of Standards and Technology
2191.1Smlelstv# which claims to test C and Posix conformance.  If you want to pass PCTS, add
2201.1Smlelstv#	-DPCTS
2211.1Smlelstv# to the end of the "CFLAGS=" line.
2221.1Smlelstv#
2231.1Smlelstv# If you want strict compliance with XPG4 as of 1994-04-09, add
2241.1Smlelstv#	-DXPG4_1994_04_09
2251.1Smlelstv# to the end of the "CFLAGS=" line.  This causes "strftime" to always return
2261.1Smlelstv# 53 as a week number (rather than 52 or 53) for those days in January that
2271.1Smlelstv# before the first Monday in January when a "%V" format is used and January 1
2281.1Smlelstv# falls on a Friday, Saturday, or Sunday.
2291.1Smlelstv
2301.1SmlelstvCFLAGS=
2311.1Smlelstv
2321.9Schristos# Linker flags.  Default to $(LFLAGS) for backwards compatibility
2331.9Schristos# to tzcode2012h and earlier.
2341.9Schristos
2351.9SchristosLDFLAGS=	$(LFLAGS)
2361.1Smlelstv
2371.1Smlelstvzic=		./zic
2381.1SmlelstvZIC=		$(zic) $(ZFLAGS)
2391.1Smlelstv
2401.1Smlelstv# The name of a Posix-compliant `awk' on your system.
2411.9SchristosAWK=		awk
2421.9Schristos
2431.9Schristos# The full path name of a Posix-compliant shell that supports the Korn shell's
2441.9Schristos# 'select' statement, as an extension.  These days, Bash is the most popular.
2451.9SchristosKSHELL=		/bin/bash
2461.1Smlelstv
2471.1Smlelstv# The path where SGML DTDs are kept.
2481.9Schristos# The default is appropriate for Ubuntu 12.10.
2491.9SchristosSGML_DTDDIR= $(SGML_TOPDIR)/share/xml/w3c-sgml-lib/schema/dtd
2501.9SchristosSGML_SEARCH_PATH= $(SGML_DTDDIR)/REC-html401-19991224
2511.1Smlelstv
2521.1Smlelstv# The catalog file(s) to use when validating.
2531.1SmlelstvSGML_CATALOG_FILES= HTML4.cat
2541.1Smlelstv
2551.1Smlelstv# The name, arguments and environment of a program to validate your web pages.
2561.1Smlelstv# See <http://www.jclark.com/sp/> for a validator, and
2571.1Smlelstv# <http://validator.w3.org/source/> for a validation library.
2581.1SmlelstvVALIDATE = nsgmls
2591.1SmlelstvVALIDATE_FLAGS = -s -B -wall -wno-unused-param
2601.1SmlelstvVALIDATE_ENV = \
2611.1Smlelstv  SGML_CATALOG_FILES=$(SGML_CATALOG_FILES) \
2621.1Smlelstv  SGML_SEARCH_PATH=$(SGML_SEARCH_PATH) \
2631.1Smlelstv  SP_CHARSET_FIXED=YES \
2641.1Smlelstv  SP_ENCODING=UTF-8
2651.1Smlelstv
2661.9Schristos# INVALID_CHAR is a regular expression that matches invalid characters in
2671.9Schristos# distributed files.  For now, stick to a safe subset of ASCII.
2681.9Schristos# The caller must set the shell variable 'sharp' to the character '#',
2691.9Schristos# since Makefile macros cannot contain '#'.
2701.9Schristos# TAB_CHAR is a single tab character, in single quotes.
2711.9SchristosTAB_CHAR=	'	'
2721.9SchristosINVALID_CHAR1=	$(TAB_CHAR)' !\"'$$sharp'$$%&'\''()*+,./0123456789:;<=>?@'
2731.9SchristosINVALID_CHAR2=	'ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\^_`'
2741.9SchristosINVALID_CHAR3=	'abcdefghijklmnopqrstuvwxyz{|}~'
2751.9SchristosINVALID_CHAR=	'[^]'$(INVALID_CHAR1)$(INVALID_CHAR2)$(INVALID_CHAR3)'-]'
2761.9Schristos
2771.6Schristos# Flags to give 'tar' when making a distribution.
2781.6Schristos# Try to use flags appropriate for GNU tar.
2791.6SchristosGNUTARFLAGS=	--numeric-owner --owner=0 --group=0 --mode=go+u,go-w
2801.6SchristosTARFLAGS=	`if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \
2811.6Schristos		 then echo $(GNUTARFLAGS); \
2821.6Schristos		 else :; \
2831.6Schristos		 fi`
2841.6Schristos
2851.6Schristos# Flags to give 'gzip' when making a distribution.
2861.6SchristosGZIPFLAGS=	-9n
2871.6Schristos
2881.1Smlelstv###############################################################################
2891.1Smlelstv
2901.1Smlelstvcc=		cc
2911.1SmlelstvCC=		$(cc) -DTZDIR=\"$(TZDIR)\"
2921.1Smlelstv
2931.1SmlelstvTZCSRCS=	zic.c localtime.c asctime.c scheck.c ialloc.c
2941.1SmlelstvTZCOBJS=	zic.o localtime.o asctime.o scheck.o ialloc.o
2951.1SmlelstvTZDSRCS=	zdump.c localtime.c ialloc.c
2961.1SmlelstvTZDOBJS=	zdump.o localtime.o ialloc.o
2971.1SmlelstvDATESRCS=	date.c localtime.c strftime.c asctime.c
2981.1SmlelstvDATEOBJS=	date.o localtime.o strftime.o asctime.o
2991.1SmlelstvLIBSRCS=	localtime.c asctime.c difftime.c
3001.1SmlelstvLIBOBJS=	localtime.o asctime.o difftime.o
3011.1SmlelstvHEADERS=	tzfile.h private.h
3021.1SmlelstvNONLIBSRCS=	zic.c zdump.c scheck.c ialloc.c
3031.1SmlelstvNEWUCBSRCS=	date.c strftime.c
3041.1SmlelstvSOURCES=	$(HEADERS) $(LIBSRCS) $(NONLIBSRCS) $(NEWUCBSRCS) tzselect.ksh
3051.1SmlelstvMANS=		newctime.3 newstrftime.3 newtzset.3 time2posix.3 \
3061.1Smlelstv			tzfile.5 tzselect.8 zic.8 zdump.8
3071.7SchristosCOMMON=		Makefile
3081.7SchristosDOCS=		README Theory $(MANS) date.1
3091.1SmlelstvPRIMARY_YDATA=	africa antarctica asia australasia \
3101.1Smlelstv		europe northamerica southamerica
3111.4SchristosYDATA=		$(PRIMARY_YDATA) pacificnew etcetera backward
3121.4SchristosNDATA=		systemv factory
3131.1SmlelstvSDATA=		solar87 solar88 solar89
3141.1SmlelstvTDATA=		$(YDATA) $(NDATA) $(SDATA)
3151.1SmlelstvTABDATA=	iso3166.tab zone.tab
3161.1SmlelstvDATA=		$(YDATA) $(NDATA) $(SDATA) $(TABDATA) leapseconds yearistype.sh
3171.1SmlelstvWEB_PAGES=	tz-art.htm tz-link.htm
3181.1SmlelstvMISC=		usno1988 usno1989 usno1989a usno1995 usno1997 usno1998 \
3191.4Schristos			$(WEB_PAGES) checktab.awk workman.sh \
3201.1Smlelstv			zoneinfo2tdf.pl
3211.7SchristosENCHILADA=	$(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC)
3221.1Smlelstv
3231.1Smlelstv# And for the benefit of csh users on systems that assume the user
3241.1Smlelstv# shell should be used to handle commands in Makefiles. . .
3251.1Smlelstv
3261.1SmlelstvSHELL=		/bin/sh
3271.1Smlelstv
3281.1Smlelstvall:		tzselect zic zdump $(LIBOBJS)
3291.1Smlelstv
3301.1SmlelstvALL:		all date
3311.1Smlelstv
3321.1Smlelstvinstall:	all $(DATA) $(REDO) $(TZLIB) $(MANS) $(TABDATA)
3331.1Smlelstv		$(ZIC) -y $(YEARISTYPE) \
3341.1Smlelstv			-d $(TZDIR) -l $(LOCALTIME) -p $(POSIXRULES)
3351.1Smlelstv		-rm -f $(TZDIR)/iso3166.tab $(TZDIR)/zone.tab
3361.1Smlelstv		cp iso3166.tab zone.tab $(TZDIR)/.
3371.1Smlelstv		-mkdir $(TOPDIR) $(ETCDIR)
3381.1Smlelstv		cp tzselect zic zdump $(ETCDIR)/.
3391.1Smlelstv		-mkdir $(TOPDIR) $(MANDIR) \
3401.1Smlelstv			$(MANDIR)/man3 $(MANDIR)/man5 $(MANDIR)/man8
3411.1Smlelstv		-rm -f $(MANDIR)/man3/newctime.3 \
3421.1Smlelstv			$(MANDIR)/man3/newtzset.3 \
3431.1Smlelstv			$(MANDIR)/man5/tzfile.5 \
3441.1Smlelstv			$(MANDIR)/man8/tzselect.8 \
3451.1Smlelstv			$(MANDIR)/man8/zdump.8 \
3461.1Smlelstv			$(MANDIR)/man8/zic.8
3471.1Smlelstv		cp newctime.3 newtzset.3 $(MANDIR)/man3/.
3481.1Smlelstv		cp tzfile.5 $(MANDIR)/man5/.
3491.1Smlelstv		cp tzselect.8 zdump.8 zic.8 $(MANDIR)/man8/.
3501.1Smlelstv
3511.1SmlelstvINSTALL:	ALL install date.1
3521.1Smlelstv		-mkdir $(TOPDIR) $(BINDIR)
3531.1Smlelstv		cp date $(BINDIR)/.
3541.1Smlelstv		-mkdir $(TOPDIR) $(MANDIR) $(MANDIR)/man1
3551.1Smlelstv		-rm -f $(MANDIR)/man1/date.1
3561.1Smlelstv		cp date.1 $(MANDIR)/man1/.
3571.1Smlelstv
3581.6Schristosversion.h:
3591.9Schristos		(echo 'static char const PKGVERSION[]="($(PACKAGE)) ";' && \
3601.9Schristos		 echo 'static char const TZVERSION[]="$(VERSION)";' && \
3611.9Schristos		 echo 'static char const REPORT_BUGS_TO[]="$(BUGEMAIL)";') >$@
3621.6Schristos
3631.1Smlelstvzdump:		$(TZDOBJS)
3641.9Schristos		$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS)
3651.1Smlelstv
3661.1Smlelstvzic:		$(TZCOBJS) yearistype
3671.9Schristos		$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS)
3681.1Smlelstv
3691.1Smlelstvyearistype:	yearistype.sh
3701.1Smlelstv		cp yearistype.sh yearistype
3711.1Smlelstv		chmod +x yearistype
3721.1Smlelstv
3731.1Smlelstvposix_only:	zic $(TDATA)
3741.1Smlelstv		$(ZIC) -y $(YEARISTYPE) -d $(TZDIR) -L /dev/null $(TDATA)
3751.1Smlelstv
3761.1Smlelstvright_only:	zic leapseconds $(TDATA)
3771.1Smlelstv		$(ZIC) -y $(YEARISTYPE) -d $(TZDIR) -L leapseconds $(TDATA)
3781.1Smlelstv
3791.1Smlelstv# In earlier versions of this makefile, the other two directories were
3801.1Smlelstv# subdirectories of $(TZDIR).  However, this led to configuration errors.
3811.1Smlelstv# For example, with posix_right under the earlier scheme,
3821.1Smlelstv# TZ='right/Australia/Adelaide' got you localtime with leap seconds,
3831.1Smlelstv# but gmtime without leap seconds, which led to problems with applications
3841.1Smlelstv# like sendmail that subtract gmtime from localtime.
3851.1Smlelstv# Therefore, the other two directories are now siblings of $(TZDIR).
3861.1Smlelstv# You must replace all of $(TZDIR) to switch from not using leap seconds
3871.1Smlelstv# to using them, or vice versa.
3881.1Smlelstvother_two:	zic leapseconds $(TDATA)
3891.1Smlelstv		$(ZIC) -y $(YEARISTYPE) -d $(TZDIR)-posix -L /dev/null $(TDATA)
3901.1Smlelstv		$(ZIC) -y $(YEARISTYPE) \
3911.1Smlelstv			-d $(TZDIR)-leaps -L leapseconds $(TDATA)
3921.1Smlelstv
3931.1Smlelstvposix_right:	posix_only other_two
3941.1Smlelstv
3951.1Smlelstvright_posix:	right_only other_two
3961.1Smlelstv
3971.1Smlelstvzones:		$(REDO)
3981.1Smlelstv
3991.1Smlelstv$(TZLIB):	$(LIBOBJS)
4001.1Smlelstv		-mkdir $(TOPDIR) $(LIBDIR)
4011.1Smlelstv		ar ru $@ $(LIBOBJS)
4021.9Schristos		if [ -x /usr/ucb/ranlib ] || [ -x /usr/bin/ranlib ]; \
4031.1Smlelstv			then ranlib $@ ; fi
4041.1Smlelstv
4051.1Smlelstvdate:		$(DATEOBJS)
4061.9Schristos		$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS)
4071.1Smlelstv
4081.1Smlelstvtzselect:	tzselect.ksh
4091.1Smlelstv		sed \
4101.9Schristos			-e 's|#!/bin/bash|#!$(KSHELL)|g' \
4111.1Smlelstv			-e 's|AWK=[^}]*|AWK=$(AWK)|g' \
4121.9Schristos			-e 's|\(PKGVERSION\)=.*|\1='\''($(PACKAGE)) '\''|' \
4131.9Schristos			-e 's|\(REPORT_BUGS_TO\)=.*|\1=$(BUGEMAIL)|' \
4141.1Smlelstv			-e 's|TZDIR=[^}]*|TZDIR=$(TZDIR)|' \
4151.9Schristos			-e 's|\(TZVERSION\)=.*|\1=$(VERSION)|' \
4161.1Smlelstv			<$? >$@
4171.1Smlelstv		chmod +x $@
4181.1Smlelstv
4191.9Schristoscheck:		check_character_set check_tables check_web
4201.9Schristos
4211.9Schristoscheck_character_set: $(ENCHILADA)
4221.9Schristos		sharp='#'; ! grep -n $(INVALID_CHAR) $(ENCHILADA)
4231.1Smlelstv
4241.1Smlelstvcheck_tables:	checktab.awk $(PRIMARY_YDATA)
4251.1Smlelstv		$(AWK) -f checktab.awk $(PRIMARY_YDATA)
4261.1Smlelstv
4271.1Smlelstvcheck_web:	$(WEB_PAGES)
4281.1Smlelstv		$(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) $(WEB_PAGES)
4291.1Smlelstv
4301.1Smlelstvclean:
4311.6Schristos		rm -f core *.o *.out \
4321.6Schristos		  date tzselect version.h zdump zic yearistype
4331.9Schristos		rm -f -r tzpublic
4341.1Smlelstv
4351.1Smlelstvmaintainer-clean: clean
4361.1Smlelstv		@echo 'This command is intended for maintainers to use; it'
4371.1Smlelstv		@echo 'deletes files that may need special tools to rebuild.'
4381.9Schristos		rm -f *.[1-8].txt *.asc *.tar.gz
4391.1Smlelstv
4401.1Smlelstvnames:
4411.1Smlelstv		@echo $(ENCHILADA)
4421.1Smlelstv
4431.9Schristospublic:		check check_public set-timestamps tarballs signatures
4441.9Schristos
4451.6Schristos# Set the time stamps to those of the git repository, if available,
4461.6Schristos# and if the files have not changed since then.
4471.6Schristos# This uses GNU 'touch' syntax 'touch -d@N FILE',
4481.6Schristos# where N is the number of seconds since 1970.
4491.6Schristos# If git or GNU 'touch' is absent, do nothing.
4501.6Schristosset-timestamps:
4511.6Schristos		-TZ=UTC0 && export TZ && files=`git ls-files` && \
4521.6Schristos		touch -d @1 test.out && rm -f test.out && \
4531.6Schristos		for file in $$files; do \
4541.6Schristos		  test -z "`git diff --name-only $$file`" || continue; \
4551.6Schristos		  cmd="touch -d @`git log -1 --format='format:%ct' $$file \
4561.6Schristos			` $$file" && \
4571.6Schristos		  echo "$$cmd" && \
4581.6Schristos		  $$cmd || exit; \
4591.6Schristos		done
4601.6Schristos
4611.1Smlelstv# The zics below ensure that each data file can stand on its own.
4621.1Smlelstv# We also do an all-files run to catch links to links.
4631.1Smlelstv
4641.9Schristoscheck_public:	$(ENCHILADA)
4651.1Smlelstv		make maintainer-clean
4661.3Smartin		make "CFLAGS=$(GCC_DEBUG_FLAGS)"
4671.9Schristos		mkdir tzpublic
4681.9Schristos		for i in $(TDATA) ; do \
4691.9Schristos		  $(zic) -v -d tzpublic $$i 2>&1 || exit; \
4701.9Schristos		done
4711.9Schristos		$(zic) -v -d tzpublic $(TDATA)
4721.9Schristos		rm -f -r tzpublic
4731.9Schristos
4741.9Schristostarballs:	tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz
4751.9Schristos
4761.9Schristostzcode$(VERSION).tar.gz: $(COMMON) $(DOCS) $(SOURCES) $(MISC)
4771.6Schristos		for i in *.[1-8] ; do \
4781.6Schristos		  LC_ALL=C sh workman.sh $$i > $$i.txt && \
4791.6Schristos		  touch -r $$i $$i.txt || exit; \
4801.6Schristos		done
4811.1Smlelstv		$(AWK) -f checktab.awk $(PRIMARY_YDATA)
4821.6Schristos		LC_ALL=C && export LC_ALL && \
4831.7Schristos		tar $(TARFLAGS) -cf - \
4841.7Schristos		    $(COMMON) $(DOCS) $(SOURCES) $(MISC) *.[1-8].txt | \
4851.6Schristos		  gzip $(GZIPFLAGS) > tzcode$(VERSION).tar.gz
4861.6Schristos		LC_ALL=C && export LC_ALL && \
4871.7Schristos		tar $(TARFLAGS) -cf - $(COMMON) $(DATA) | \
4881.9Schristos		  gzip $(GZIPFLAGS) > $@
4891.9Schristos
4901.9Schristossignatures:	tzcode$(VERSION).tar.gz.asc tzdata$(VERSION).tar.gz.asc
4911.9Schristos
4921.9Schristostzcode$(VERSION).tar.gz.asc: tzcode$(VERSION).tar.gz
4931.9Schristos		gpg --armor --detach-sign $?
4941.9Schristos
4951.9Schristostzdata$(VERSION).tar.gz.asc: tzdata$(VERSION).tar.gz
4961.9Schristos		gpg --armor --detach-sign $?
4971.1Smlelstv
4981.1Smlelstvtypecheck:
4991.1Smlelstv		make clean
5001.1Smlelstv		for i in "long long" unsigned double; \
5011.1Smlelstv		do \
5021.8Schristos			make CFLAGS="-DTYPECHECK -D__time_t_defined -D_TIME_T \"-Dtime_t=$$i\"" ; \
5031.1Smlelstv			./zdump -v Europe/Rome ; \
5041.1Smlelstv			make clean ; \
5051.1Smlelstv		done
5061.1Smlelstv
5071.1Smlelstvzonenames:	$(TDATA)
5081.1Smlelstv		@$(AWK) '/^Zone/ { print $$2 } /^Link/ { print $$3 }' $(TDATA)
5091.1Smlelstv
5101.1Smlelstvasctime.o:	private.h tzfile.h
5111.1Smlelstvdate.o:		private.h
5121.1Smlelstvdifftime.o:	private.h
5131.1Smlelstvialloc.o:	private.h
5141.1Smlelstvlocaltime.o:	private.h tzfile.h
5151.1Smlelstvscheck.o:	private.h
5161.1Smlelstvstrftime.o:	tzfile.h
5171.6Schristoszdump.o:	version.h
5181.6Schristoszic.o:		private.h tzfile.h version.h
5191.1Smlelstv
5201.1Smlelstv.KEEP_STATE:
521