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