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