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