Home | History | Annotate | Line # | Download | only in time
Makefile revision 1.21
      1 # <pre>
      2 # This file is in the public domain, so clarified as of
      3 # 2009-05-17 by Arthur David Olson.
      4 
      5 # Package name for the code distribution.
      6 PACKAGE=	tzcode
      7 
      8 # Version numbers of the code and data distributions.
      9 VERSION=	2014e
     10 
     11 # Email address for bug reports.
     12 BUGEMAIL=	tz@iana.org
     13 
     14 # Change the line below for your time zone (after finding the zone you want in
     15 # the time zone files, or adding it to a time zone file).
     16 # Alternately, if you discover you've got the wrong time zone, you can just
     17 #	zic -l rightzone
     18 # to correct things.
     19 # Use the command
     20 #	make zonenames
     21 # to get a list of the values you can use for LOCALTIME.
     22 
     23 LOCALTIME=	GMT
     24 
     25 # If you want something other than Eastern United States time as a template
     26 # for handling POSIX-style time zone environment variables,
     27 # change the line below (after finding the zone you want in the
     28 # time zone files, or adding it to a time zone file).
     29 # (When a POSIX-style environment variable is handled, the rules in the
     30 # template file are used to determine "spring forward" and "fall back" days and
     31 # times; the environment variable itself specifies UT offsets of standard and
     32 # summer time.)
     33 # Alternately, if you discover you've got the wrong time zone, you can just
     34 #	zic -p rightzone
     35 # to correct things.
     36 # Use the command
     37 #	make zonenames
     38 # to get a list of the values you can use for POSIXRULES.
     39 # If you want POSIX compatibility, use "America/New_York".
     40 
     41 POSIXRULES=	America/New_York
     42 
     43 # Also see TZDEFRULESTRING below, which takes effect only
     44 # if the time zone files cannot be accessed.
     45 
     46 # Everything gets put in subdirectories of. . .
     47 
     48 TOPDIR=		/usr/local
     49 
     50 # "Compiled" time zone information is placed in the "TZDIR" directory
     51 # (and subdirectories).
     52 # Use an absolute path name for TZDIR unless you're just testing the software.
     53 
     54 TZDIR_BASENAME=	zoneinfo
     55 TZDIR=		$(TOPDIR)/etc/$(TZDIR_BASENAME)
     56 
     57 # Types to try, as an alternative to time_t.  int64_t should be first.
     58 TIME_T_ALTERNATIVES= int64_t int32_t uint32_t uint64_t
     59 
     60 # The "tzselect", "zic", and "zdump" commands get installed in. . .
     61 
     62 ETCDIR=		$(TOPDIR)/etc
     63 
     64 # If you "make INSTALL", the "date" command gets installed in. . .
     65 
     66 BINDIR=		$(TOPDIR)/bin
     67 
     68 # Manual pages go in subdirectories of. . .
     69 
     70 MANDIR=		$(TOPDIR)/man
     71 
     72 # Library functions are put in an archive in LIBDIR.
     73 
     74 LIBDIR=		$(TOPDIR)/lib
     75 
     76 # If you always want time values interpreted as "seconds since the epoch
     77 # (not counting leap seconds)", use
     78 #	REDO=		posix_only
     79 # below.  If you always want right time values interpreted as "seconds since
     80 # the epoch" (counting leap seconds)", use
     81 #	REDO=		right_only
     82 # below.  If you want both sets of data available, with leap seconds not
     83 # counted normally, use
     84 #	REDO=		posix_right
     85 # below.  If you want both sets of data available, with leap seconds counted
     86 # normally, use
     87 #	REDO=		right_posix
     88 # below.
     89 # POSIX mandates that leap seconds not be counted; for compatibility with it,
     90 # use either "posix_only" or "posix_right".
     91 
     92 REDO=		posix_right
     93 
     94 # Since "." may not be in PATH...
     95 
     96 YEARISTYPE=	./yearistype
     97 
     98 # Non-default libraries needed to link.
     99 # Add -lintl if you want to use `gettext' on Solaris.
    100 LDLIBS=
    101 
    102 # Add the following to the end of the "CFLAGS=" line as needed.
    103 #  -DBIG_BANG=-9999999LL if the Big Bang occurred at time -9999999 (see zic.c)
    104 #  -DHAVE_ADJTIME=0 if `adjtime' does not exist (SVR0?)
    105 #  -DHAVE_DOS_FILE_NAMES if file names have drive specifiers etc. (MS-DOS)
    106 #  -DHAVE_GETTEXT=1 if `gettext' works (GNU, Linux, Solaris); also see LDLIBS
    107 #  -DHAVE_INCOMPATIBLE_CTIME_R=1 if your system's time.h declares
    108 #	ctime_r and asctime_r incompatibly with the POSIX standard (Solaris 8).
    109 #  -DHAVE_INTTYPES_H=1 if you have a pre-C99 compiler with "inttypes.h"
    110 #  -DHAVE_LINK=0 if your system lacks a link function
    111 #  -DHAVE_SETTIMEOFDAY=0 if settimeofday does not exist (SVR0?)
    112 #  -DHAVE_SETTIMEOFDAY=1 if settimeofday has just 1 arg (SVR4)
    113 #  -DHAVE_SETTIMEOFDAY=2 if settimeofday uses 2nd arg (4.3BSD)
    114 #  -DHAVE_SETTIMEOFDAY=3 if settimeofday ignores 2nd arg (4.4BSD)
    115 #  -DHAVE_STDINT_H=1 if you have a pre-C99 compiler with "stdint.h"
    116 #  -DHAVE_SYMLINK=0 if your system lacks the symlink function
    117 #  -DHAVE_SYS_STAT_H=0 if your compiler lacks a "sys/stat.h"
    118 #  -DHAVE_SYS_WAIT_H=0 if your compiler lacks a "sys/wait.h"
    119 #  -DHAVE_UNISTD_H=0 if your compiler lacks a "unistd.h" (Microsoft C++ 7?)
    120 #  -DHAVE_UTMPX_H=1 if your compiler has a "utmpx.h"
    121 #  -DLOCALE_HOME=\"path\" if locales are in "path", not "/usr/lib/locale"
    122 #  -DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU=1
    123 #	if you do not want run time warnings about formats that may cause
    124 #	year 2000 grief
    125 #  -Dtime_tz=\"T\" to use T as the time_t type, rather than the system time_t
    126 #  -DTZ_DOMAIN=\"foo\" to use "foo" for gettext domain name; default is "tz"
    127 #  -TTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory;
    128 #	the default is system-supplied, typically "/usr/lib/locale"
    129 #  -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified
    130 #  -DNO_ERROR_IN_DST_GAP=1
    131 #	if you want mktime() not to return an error in the DST gap.
    132 #  -DZIC_MAX_ABBR_LEN_WO_WARN=3
    133 #	(or some other number) to set the maximum time zone abbreviation length
    134 #	that zic will accept without a warning (the default is 6)
    135 #  $(GCC_DEBUG_FLAGS) if you are using GCC and want lots of checking
    136 GCC_DEBUG_FLAGS = -Dlint -g3 -O3 -fno-common -fstrict-aliasing \
    137 	-Wall -Wextra \
    138 	-Wbad-function-cast -Wcast-align -Wcast-qual \
    139 	-Wformat=2 -Winit-self \
    140 	-Wmissing-declarations -Wmissing-noreturn -Wmissing-prototypes \
    141 	-Wnested-externs -Wno-address -Wno-cast-qual \
    142 	-Wno-format-nonliteral -Wno-sign-compare -Wno-sign-conversion \
    143 	-Wno-type-limits \
    144 	-Wno-unused-parameter -Woverlength-strings -Wpointer-arith \
    145 	-Wshadow -Wstrict-prototypes -Wsuggest-attribute=const \
    146 	-Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wtrampolines \
    147 	-Wwrite-strings
    148 #
    149 # If you want to use System V compatibility code, add
    150 #	-DUSG_COMPAT
    151 # to the end of the "CFLAGS=" line.  This arrange for "timezone" and "daylight"
    152 # variables to be kept up-to-date by the time conversion functions.  Neither
    153 # "timezone" nor "daylight" is described in X3J11's work.
    154 #
    155 # If your system has a "GMT offset" field in its "struct tm"s
    156 # (or if you decide to add such a field in your system's "time.h" file),
    157 # add the name to a define such as
    158 #	-DTM_GMTOFF=tm_gmtoff
    159 # or
    160 #	-DTM_GMTOFF=_tm_gmtoff
    161 # to the end of the "CFLAGS=" line.
    162 # Neither tm_gmtoff nor _tm_gmtoff is described in X3J11's work;
    163 # in its work, use of "tm_gmtoff" is described as non-conforming.
    164 # Both Linux and BSD have done the equivalent of defining TM_GMTOFF in
    165 # their recent releases.
    166 #
    167 # If your system has a "zone abbreviation" field in its "struct tm"s
    168 # (or if you decide to add such a field in your system's "time.h" file),
    169 # add the name to a define such as
    170 #	-DTM_ZONE=tm_zone
    171 # or
    172 #	-DTM_ZONE=_tm_zone
    173 # to the end of the "CFLAGS=" line.
    174 # Neither tm_zone nor _tm_zone is described in X3J11's work;
    175 # in its work, use of "tm_zone" is described as non-conforming.
    176 # Both UCB and Sun have done the equivalent of defining TM_ZONE in
    177 # their recent releases.
    178 #
    179 # If you want functions that were inspired by early versions of X3J11's work,
    180 # add
    181 #	-DSTD_INSPIRED
    182 # to the end of the "CFLAGS=" line.  This arranges for the functions
    183 # "tzsetwall", "offtime", "timelocal", "timegm", "timeoff",
    184 # "posix2time", and "time2posix" to be added to the time conversion library.
    185 # "tzsetwall" is like "tzset" except that it arranges for local wall clock
    186 # time (rather than the time specified in the TZ environment variable)
    187 # to be used.
    188 # "offtime" is like "gmtime" except that it accepts a second (long) argument
    189 # that gives an offset to add to the time_t when converting it.
    190 # "timelocal" is equivalent to "mktime".
    191 # "timegm" is like "timelocal" except that it turns a struct tm into
    192 # a time_t using UT (rather than local time as "timelocal" does).
    193 # "timeoff" is like "timegm" except that it accepts a second (long) argument
    194 # that gives an offset to use when converting to a time_t.
    195 # "posix2time" and "time2posix" are described in an included manual page.
    196 # X3J11's work does not describe any of these functions.
    197 # Sun has provided "tzsetwall", "timelocal", and "timegm" in SunOS 4.0.
    198 # These functions may well disappear in future releases of the time
    199 # conversion package.
    200 #
    201 # If you want to allocate state structures in localtime, add
    202 #	-DALL_STATE
    203 # to the end of the "CFLAGS=" line.  Storage is obtained by calling malloc.
    204 #
    205 # If you want an "altzone" variable (a la System V Release 3.1), add
    206 #	-DALTZONE
    207 # to the end of the "CFLAGS=" line.
    208 # This variable is not described in X3J11's work.
    209 #
    210 # If you want a "gtime" function (a la MACH), add
    211 #	-DCMUCS
    212 # to the end of the "CFLAGS=" line
    213 # This function is not described in X3J11's work.
    214 #
    215 # NIST-PCTS:151-2, Version 1.4, (1993-12-03) is a test suite put
    216 # out by the National Institute of Standards and Technology
    217 # which claims to test C and Posix conformance.  If you want to pass PCTS, add
    218 #	-DPCTS
    219 # to the end of the "CFLAGS=" line.
    220 #
    221 # If you want strict compliance with XPG4 as of 1994-04-09, add
    222 #	-DXPG4_1994_04_09
    223 # to the end of the "CFLAGS=" line.  This causes "strftime" to always return
    224 # 53 as a week number (rather than 52 or 53) for those days in January that
    225 # before the first Monday in January when a "%V" format is used and January 1
    226 # falls on a Friday, Saturday, or Sunday.
    227 
    228 CFLAGS=
    229 
    230 # Linker flags.  Default to $(LFLAGS) for backwards compatibility
    231 # to tzcode2012h and earlier.
    232 
    233 LDFLAGS=	$(LFLAGS)
    234 
    235 zic=		./zic
    236 ZIC=		$(zic) $(ZFLAGS)
    237 
    238 ZFLAGS=
    239 
    240 # The name of a Posix-compliant `awk' on your system.
    241 AWK=		awk
    242 
    243 # The full path name of a Posix-compliant shell, preferably one that supports
    244 # the Korn shell's 'select' statement as an extension.
    245 # These days, Bash is the most popular.
    246 # It should be OK to set this to /bin/sh, on platforms where /bin/sh
    247 # lacks 'select' or doesn't completely conform to Posix, but /bin/bash
    248 # is typically nicer if it works.
    249 KSHELL=		/bin/bash
    250 
    251 # The path where SGML DTDs are kept and the catalog file(s) to use when
    252 # validating.  The default is appropriate for Ubuntu 13.10.
    253 SGML_TOPDIR= /usr
    254 SGML_DTDDIR= $(SGML_TOPDIR)/share/xml/w3c-sgml-lib/schema/dtd
    255 SGML_SEARCH_PATH= $(SGML_DTDDIR)/REC-html401-19991224
    256 SGML_CATALOG_FILES= \
    257   $(SGML_TOPDIR)/share/doc/w3-recs/html/www.w3.org/TR/1999/REC-html401-19991224/HTML4.cat
    258 
    259 # The name, arguments and environment of a program to validate your web pages.
    260 # See <http://www.jclark.com/sp/> for a validator, and
    261 # <http://validator.w3.org/source/> for a validation library.
    262 VALIDATE = nsgmls
    263 VALIDATE_FLAGS = -s -B -wall -wno-unused-param
    264 VALIDATE_ENV = \
    265   SGML_CATALOG_FILES=$(SGML_CATALOG_FILES) \
    266   SGML_SEARCH_PATH=$(SGML_SEARCH_PATH) \
    267   SP_CHARSET_FIXED=YES \
    268   SP_ENCODING=UTF-8
    269 
    270 # INVALID_CHAR is a regular expression that matches invalid characters in
    271 # distributed files.  For now, stick to a safe subset of ASCII.
    272 # The caller must set the shell variable 'sharp' to the character '#',
    273 # since Makefile macros cannot contain '#'.
    274 # TAB_CHAR is a single tab character, in single quotes.
    275 TAB_CHAR=	'	'
    276 INVALID_CHAR1=	$(TAB_CHAR)' !\"'$$sharp'$$%&'\''()*+,./0123456789:;<=>?@'
    277 INVALID_CHAR2=	'ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\^_`'
    278 INVALID_CHAR3=	'abcdefghijklmnopqrstuvwxyz{|}~'
    279 INVALID_CHAR=	'[^]'$(INVALID_CHAR1)$(INVALID_CHAR2)$(INVALID_CHAR3)'-]'
    280 
    281 # Flags to give 'tar' when making a distribution.
    282 # Try to use flags appropriate for GNU tar.
    283 GNUTARFLAGS=	--numeric-owner --owner=0 --group=0 --mode=go+u,go-w
    284 TARFLAGS=	`if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \
    285 		 then echo $(GNUTARFLAGS); \
    286 		 else :; \
    287 		 fi`
    288 
    289 # Flags to give 'gzip' when making a distribution.
    290 GZIPFLAGS=	-9 ${GZIP_N_FLAG}
    291 
    292 ###############################################################################
    293 
    294 cc=		cc
    295 CC=		$(cc) -DTZDIR=\"$(TZDIR)\"
    296 
    297 AR=		ar
    298 
    299 # ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib.
    300 RANLIB=		:
    301 
    302 TZCOBJS=	zic.o localtime.o asctime.o scheck.o ialloc.o
    303 TZDOBJS=	zdump.o localtime.o ialloc.o asctime.o
    304 DATEOBJS=	date.o localtime.o strftime.o asctime.o
    305 LIBSRCS=	localtime.c asctime.c difftime.c
    306 LIBOBJS=	localtime.o asctime.o difftime.o
    307 HEADERS=	tzfile.h private.h
    308 NONLIBSRCS=	zic.c zdump.c scheck.c ialloc.c
    309 NEWUCBSRCS=	date.c strftime.c
    310 SOURCES=	$(HEADERS) $(LIBSRCS) $(NONLIBSRCS) $(NEWUCBSRCS) tzselect.ksh
    311 MANS=		newctime.3 newstrftime.3 newtzset.3 time2posix.3 \
    312 			tzfile.5 tzselect.8 zic.8 zdump.8
    313 MANTXTS=	newctime.3.txt newstrftime.3.txt newtzset.3.txt \
    314 			time2posix.3.txt \
    315 			tzfile.5.txt tzselect.8.txt zic.8.txt zdump.8.txt \
    316 			date.1.txt
    317 COMMON=		Makefile README
    318 DOCS=		NEWS Theory $(MANS) date.1 $(MANTXTS)
    319 PRIMARY_YDATA=	africa antarctica asia australasia \
    320 		europe northamerica southamerica
    321 YDATA=		$(PRIMARY_YDATA) pacificnew etcetera backward
    322 NDATA=		systemv factory
    323 TDATA=		$(YDATA) $(NDATA)
    324 TABDATA=	iso3166.tab zone.tab leapseconds
    325 LEAP_DEPS=	leapseconds.awk leap-seconds.list
    326 DATA=		$(YDATA) $(NDATA) $(TABDATA) \
    327 			$(LEAP_DEPS) yearistype.sh
    328 WEB_PAGES=	tz-art.htm tz-link.htm
    329 AWK_SCRIPTS=	checktab.awk leapseconds.awk
    330 MISC=		usno1988 usno1989 usno1989a usno1995 usno1997 usno1998 \
    331 			$(WEB_PAGES) $(AWK_SCRIPTS) workman.sh \
    332 			zoneinfo2tdf.pl
    333 ENCHILADA=	$(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC)
    334 
    335 # And for the benefit of csh users on systems that assume the user
    336 # shell should be used to handle commands in Makefiles. . .
    337 
    338 SHELL=		/bin/sh
    339 
    340 all:		tzselect zic zdump libtz.a $(TABDATA)
    341 
    342 ALL:		all date
    343 
    344 install:	all $(DATA) $(REDO) $(MANS)
    345 		mkdir -p $(DESTDIR)$(ETCDIR) $(DESTDIR)$(TZDIR) \
    346 			$(DESTDIR)$(LIBDIR) \
    347 			$(DESTDIR)$(MANDIR)/man3 $(DESTDIR)$(MANDIR)/man5 \
    348 			$(DESTDIR)$(MANDIR)/man8
    349 		$(ZIC) -y $(YEARISTYPE) \
    350 			-d $(DESTDIR)$(TZDIR) -l $(LOCALTIME) -p $(POSIXRULES)
    351 		cp -f iso3166.tab zone.tab $(DESTDIR)$(TZDIR)/.
    352 		cp tzselect zic zdump $(DESTDIR)$(ETCDIR)/.
    353 		cp libtz.a $(DESTDIR)$(LIBDIR)/.
    354 		$(RANLIB) $(DESTDIR)$(LIBDIR)/libtz.a
    355 		cp -f newctime.3 newtzset.3 $(DESTDIR)$(MANDIR)/man3/.
    356 		cp -f tzfile.5 $(DESTDIR)$(MANDIR)/man5/.
    357 		cp -f tzselect.8 zdump.8 zic.8 $(DESTDIR)$(MANDIR)/man8/.
    358 
    359 INSTALL:	ALL install date.1
    360 		mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man1
    361 		cp date $(DESTDIR)$(BINDIR)/.
    362 		cp -f date.1 $(DESTDIR)$(MANDIR)/man1/.
    363 
    364 version.h:
    365 		(echo 'static char const PKGVERSION[]="($(PACKAGE)) ";' && \
    366 		 echo 'static char const TZVERSION[]="$(VERSION)";' && \
    367 		 echo 'static char const REPORT_BUGS_TO[]="$(BUGEMAIL)";') >$@
    368 
    369 zdump:		$(TZDOBJS)
    370 		$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS)
    371 
    372 zic:		$(TZCOBJS) yearistype
    373 		$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS)
    374 
    375 yearistype:	yearistype.sh
    376 		cp yearistype.sh yearistype
    377 		chmod +x yearistype
    378 
    379 leapseconds:	$(LEAP_DEPS)
    380 		$(AWK) -f leapseconds.awk leap-seconds.list >$@
    381 
    382 posix_only:	zic $(TDATA)
    383 		$(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR) \
    384 			-L /dev/null $(TDATA)
    385 
    386 right_only:	zic leapseconds $(TDATA)
    387 		$(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR) \
    388 			-L leapseconds $(TDATA)
    389 
    390 # In earlier versions of this makefile, the other two directories were
    391 # subdirectories of $(TZDIR).  However, this led to configuration errors.
    392 # For example, with posix_right under the earlier scheme,
    393 # TZ='right/Australia/Adelaide' got you localtime with leap seconds,
    394 # but gmtime without leap seconds, which led to problems with applications
    395 # like sendmail that subtract gmtime from localtime.
    396 # Therefore, the other two directories are now siblings of $(TZDIR).
    397 # You must replace all of $(TZDIR) to switch from not using leap seconds
    398 # to using them, or vice versa.
    399 right_posix:	right_only leapseconds
    400 		rm -fr $(DESTDIR)$(TZDIR)-leaps
    401 		ln -s $(TZDIR_BASENAME) $(DESTDIR)$(TZDIR)-leaps || \
    402 		  $(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR)-leaps \
    403 			-L leapseconds $(TDATA)
    404 		$(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR)-posix \
    405 			-L /dev/null $(TDATA)
    406 
    407 posix_right:	posix_only leapseconds
    408 		rm -fr $(DESTDIR)$(TZDIR)-posix
    409 		ln -s $(TZDIR_BASENAME) $(DESTDIR)$(TZDIR)-posix || \
    410 		  $(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR)-posix \
    411 			-L /dev/null $(TDATA)
    412 		$(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR)-leaps \
    413 			-L leapseconds $(TDATA)
    414 
    415 zones:		$(REDO)
    416 
    417 libtz.a:	$(LIBOBJS)
    418 		$(AR) ru $@ $(LIBOBJS)
    419 		$(RANLIB) $@
    420 
    421 date:		$(DATEOBJS)
    422 		$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS)
    423 
    424 tzselect:	tzselect.ksh
    425 		sed \
    426 			-e 's|#!/bin/bash|#!$(KSHELL)|g' \
    427 			-e 's|AWK=[^}]*|AWK=$(AWK)|g' \
    428 			-e 's|\(PKGVERSION\)=.*|\1='\''($(PACKAGE)) '\''|' \
    429 			-e 's|\(REPORT_BUGS_TO\)=.*|\1=$(BUGEMAIL)|' \
    430 			-e 's|TZDIR=[^}]*|TZDIR=$(TZDIR)|' \
    431 			-e 's|\(TZVERSION\)=.*|\1=$(VERSION)|' \
    432 			<$? >$@
    433 		chmod +x $@
    434 
    435 check:		check_character_set check_tables check_web
    436 
    437 check_character_set: $(ENCHILADA)
    438 		sharp='#'; ! grep -n $(INVALID_CHAR) $(ENCHILADA)
    439 
    440 check_tables:	checktab.awk $(PRIMARY_YDATA)
    441 		$(AWK) -f checktab.awk $(PRIMARY_YDATA)
    442 
    443 check_web:	$(WEB_PAGES)
    444 		$(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) $(WEB_PAGES)
    445 
    446 clean_misc:
    447 		rm -f core *.o *.out \
    448 		  date tzselect version.h zdump zic yearistype libtz.a
    449 clean:		clean_misc
    450 		rm -fr tzpublic
    451 
    452 maintainer-clean: clean
    453 		@echo 'This command is intended for maintainers to use; it'
    454 		@echo 'deletes files that may need special tools to rebuild.'
    455 		rm -f leapseconds $(MANTXTS) *.asc *.tar.gz
    456 
    457 names:
    458 		@echo $(ENCHILADA)
    459 
    460 public:		check check_public check_time_t_alternatives \
    461 		tarballs signatures
    462 
    463 date.1.txt:	date.1
    464 newctime.3.txt:	newctime.3
    465 newstrftime.3.txt: newstrftime.3
    466 newtzset.3.txt:	newtzset.3
    467 time2posix.3.txt: time2posix.3
    468 tzfile.5.txt:	tzfile.5
    469 tzselect.8.txt:	tzselect.8
    470 zdump.8.txt:	zdump.8
    471 zic.8.txt:	zic.8
    472 
    473 $(MANTXTS):	workman.sh
    474 		LC_ALL=C sh workman.sh `expr $@ : '\(.*\)\.txt$$'` >$@
    475 
    476 # Set the time stamps to those of the git repository, if available,
    477 # and if the files have not changed since then.
    478 # This uses GNU 'touch' syntax 'touch -d@N FILE',
    479 # where N is the number of seconds since 1970.
    480 # If git or GNU 'touch' is absent, don't bother to sync with git timestamps.
    481 # Also, set the timestamp of each prebuilt file like 'leapseconds'
    482 # to be the maximum of the files it depends on.
    483 set-timestamps.out: $(ENCHILADA)
    484 		rm -f $@
    485 		if files=`git ls-files $(ENCHILADA)` && \
    486 		   touch -md @1 test.out; then \
    487 		  rm -f test.out && \
    488 		  for file in $$files; do \
    489 		    if git diff --quiet $$file; then \
    490 		      time=`git log -1 --format='tformat:%ct' $$file` && \
    491 		      touch -cmd @$$time $$file; \
    492 		    else \
    493 		      echo >&2 "$$file: warning: does not match repository"; \
    494 		    fi || exit; \
    495 		  done; \
    496 		fi
    497 		touch -cmr `ls -t $(LEAP_DEPS) | sed 1q` leapseconds
    498 		for file in `ls $(MANTXTS) | sed 's/\.txt$$//'`; do \
    499 		  touch -cmr `ls -t $$file workman.sh | sed 1q` $$file.txt || \
    500 		    exit; \
    501 		done
    502 		touch $@
    503 
    504 # The zics below ensure that each data file can stand on its own.
    505 # We also do an all-files run to catch links to links.
    506 
    507 check_public:	$(ENCHILADA)
    508 		make maintainer-clean
    509 		make "CFLAGS=$(GCC_DEBUG_FLAGS)" $(ENCHILADA) all
    510 		mkdir tzpublic
    511 		for i in $(TDATA) ; do \
    512 		  $(zic) -v -d tzpublic $$i 2>&1 || exit; \
    513 		done
    514 		$(zic) -v -d tzpublic $(TDATA)
    515 		rm -fr tzpublic
    516 
    517 # Check that the code works under various alternative
    518 # implementations of time_t.
    519 check_time_t_alternatives:
    520 		zones=`$(AWK) '/^[^#]/ { print $$3 }' <zone.tab` && \
    521 		for type in $(TIME_T_ALTERNATIVES); do \
    522 		  mkdir -p tzpublic/$$type && \
    523 		  make clean_misc && \
    524 		  make TOPDIR=`pwd`/tzpublic/$$type \
    525 		    CFLAGS='$(CFLAGS) -Dtime_tz='"'$$type'" \
    526 		    install && \
    527 		  diff -qr tzpublic/int64_t/etc/zoneinfo tzpublic/$$type/etc/zoneinfo && \
    528 		  case $$type in \
    529 		  int32_t) range=-2147483648,2147483647;; \
    530 		  uint32_t) range=0,4294967296;; \
    531 		  int64_t) continue;; \
    532 		  *u*) range=0,10000000000;; \
    533 		  *) range=-10000000000,10000000000;; \
    534 		  esac && \
    535 		  echo checking $$type zones ... && \
    536 		  tzpublic/int64_t/etc/zdump -V -t $$range $$zones \
    537 		      >tzpublic/int64_t.out && \
    538 		  tzpublic/$$type/etc/zdump -V -t $$range $$zones \
    539 		      >tzpublic/$$type.out && \
    540 		  diff -u tzpublic/int64_t.out tzpublic/$$type.out \
    541 		    || exit; \
    542 		done
    543 		rm -fr tzpublic
    544 
    545 tarballs:	tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz
    546 
    547 tzcode$(VERSION).tar.gz: set-timestamps.out
    548 		LC_ALL=C && export LC_ALL && \
    549 		tar $(TARFLAGS) -cf - \
    550 		    $(COMMON) $(DOCS) $(SOURCES) $(MISC) | \
    551 		  ${TOOL_GZIP} $(GZIPFLAGS) > $@
    552 
    553 tzdata$(VERSION).tar.gz: set-timestamps.out
    554 		LC_ALL=C && export LC_ALL && \
    555 		tar $(TARFLAGS) -cf - $(COMMON) $(DATA) | \
    556 		  ${TOOL_GZIP} $(GZIPFLAGS) > $@
    557 
    558 signatures:	tzcode$(VERSION).tar.gz.asc tzdata$(VERSION).tar.gz.asc
    559 
    560 tzcode$(VERSION).tar.gz.asc: tzcode$(VERSION).tar.gz
    561 		gpg --armor --detach-sign $?
    562 
    563 tzdata$(VERSION).tar.gz.asc: tzdata$(VERSION).tar.gz
    564 		gpg --armor --detach-sign $?
    565 
    566 typecheck:
    567 		make clean
    568 		for i in "long long" unsigned; \
    569 		do \
    570 			make CFLAGS="-DTYPECHECK -D__time_t_defined -D_TIME_T \"-Dtime_t=$$i\"" ; \
    571 			./zdump -v Europe/Rome ; \
    572 			make clean ; \
    573 		done
    574 
    575 zonenames:	$(TDATA)
    576 		@$(AWK) '/^Zone/ { print $$2 } /^Link/ { print $$3 }' $(TDATA)
    577 
    578 asctime.o:	private.h tzfile.h
    579 date.o:		private.h
    580 difftime.o:	private.h
    581 ialloc.o:	private.h
    582 localtime.o:	private.h tzfile.h
    583 scheck.o:	private.h
    584 strftime.o:	tzfile.h
    585 zdump.o:	version.h
    586 zic.o:		private.h tzfile.h version.h
    587 
    588 .KEEP_STATE:
    589