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