247
246
# The name of a Posix-compliant `awk' on your system.
250
# The full path name of a Posix-compliant shell that supports the Korn shell's
251
# 'select' statement, as an extension. These days, Bash is the most popular.
249
# The full path name of a Posix-compliant shell, preferably one that supports
250
# the Korn shell's 'select' statement as an extension.
251
# These days, Bash is the most popular.
252
# It should be OK to set this to /bin/sh, on platforms where /bin/sh
253
# lacks 'select' or doesn't completely conform to Posix, but /bin/bash
254
# is typically nicer if it works.
252
255
KSHELL= /bin/bash
254
257
# The path where SGML DTDs are kept.
299
302
CC= $(cc) -DTZDIR=\"$(TZDIR)\"
301
TZCSRCS= zic.c localtime.c asctime.c scheck.c ialloc.c
306
# ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib.
302
309
TZCOBJS= zic.o localtime.o asctime.o scheck.o ialloc.o
303
TZDSRCS= zdump.c localtime.c ialloc.c asctime.o
304
TZDOBJS= zdump.o localtime.o ialloc.o asctime.c
305
DATESRCS= date.c localtime.c strftime.c asctime.c
310
TZDOBJS= zdump.o localtime.o ialloc.o asctime.o
306
311
DATEOBJS= date.o localtime.o strftime.o asctime.o
307
312
LIBSRCS= localtime.c asctime.c difftime.c
308
313
LIBOBJS= localtime.o asctime.o difftime.o
324
329
NDATA= systemv factory
325
330
SDATA= solar87 solar88 solar89
326
331
TDATA= $(YDATA) $(NDATA) $(SDATA)
327
TABDATA= iso3166.tab zone.tab
332
TABDATA= iso3166.tab zone.tab leapseconds
328
333
LEAP_DEPS= leapseconds.awk leap-seconds.list
329
334
DATA= $(YDATA) $(NDATA) $(SDATA) $(TABDATA) \
330
leapseconds $(LEAP_DEPS) yearistype.sh
335
$(LEAP_DEPS) yearistype.sh
331
336
WEB_PAGES= tz-art.htm tz-link.htm
332
337
AWK_SCRIPTS= checktab.awk leapseconds.awk
333
338
MISC= usno1988 usno1989 usno1989a usno1995 usno1997 usno1998 \
343
all: tzselect zic zdump $(LIBOBJS) $(TABDATA)
348
all: tzselect zic zdump libtz.a $(TABDATA)
347
install: all $(DATA) $(REDO) $(DESTDIR)$(TZLIB) $(MANS)
352
install: all $(DATA) $(REDO) $(MANS)
353
mkdir -p $(DESTDIR)$(ETCDIR) $(DESTDIR)$(TZDIR) \
354
$(DESTDIR)$(LIBDIR) \
355
$(DESTDIR)$(MANDIR)/man3 $(DESTDIR)$(MANDIR)/man5 \
356
$(DESTDIR)$(MANDIR)/man8
348
357
$(ZIC) -y $(YEARISTYPE) \
349
358
-d $(DESTDIR)$(TZDIR) -l $(LOCALTIME) -p $(POSIXRULES)
350
-rm -f $(DESTDIR)$(TZDIR)/iso3166.tab \
351
$(DESTDIR)$(TZDIR)/zone.tab
352
cp iso3166.tab zone.tab $(DESTDIR)$(TZDIR)/.
353
-mkdir $(DESTDIR)$(TOPDIR) $(DESTDIR)$(ETCDIR)
359
cp -f iso3166.tab zone.tab $(DESTDIR)$(TZDIR)/.
354
360
cp tzselect zic zdump $(DESTDIR)$(ETCDIR)/.
355
-mkdir $(DESTDIR)$(TOPDIR) $(DESTDIR)$(MANDIR) \
356
$(DESTDIR)$(MANDIR)/man3 $(DESTDIR)$(MANDIR)/man5 \
357
$(DESTDIR)$(MANDIR)/man8
358
-rm -f $(DESTDIR)$(MANDIR)/man3/newctime.3 \
359
$(DESTDIR)$(MANDIR)/man3/newtzset.3 \
360
$(DESTDIR)$(MANDIR)/man5/tzfile.5 \
361
$(DESTDIR)$(MANDIR)/man8/tzselect.8 \
362
$(DESTDIR)$(MANDIR)/man8/zdump.8 \
363
$(DESTDIR)$(MANDIR)/man8/zic.8
364
cp newctime.3 newtzset.3 $(DESTDIR)$(MANDIR)/man3/.
365
cp tzfile.5 $(DESTDIR)$(MANDIR)/man5/.
366
cp tzselect.8 zdump.8 zic.8 $(DESTDIR)$(MANDIR)/man8/.
361
cp libtz.a $(DESTDIR)$(LIBDIR)/.
362
$(RANLIB) $(DESTDIR)$(LIBDIR)/libtz.a
363
cp -f newctime.3 newtzset.3 $(DESTDIR)$(MANDIR)/man3/.
364
cp -f tzfile.5 $(DESTDIR)$(MANDIR)/man5/.
365
cp -f tzselect.8 zdump.8 zic.8 $(DESTDIR)$(MANDIR)/man8/.
368
367
INSTALL: ALL install date.1
369
-mkdir $(DESTDIR)$(TOPDIR) $(DESTDIR)$(BINDIR)
368
mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man1
370
369
cp date $(DESTDIR)$(BINDIR)/.
371
-mkdir $(DESTDIR)$(TOPDIR) $(DESTDIR)$(MANDIR) \
372
$(DESTDIR)$(MANDIR)/man1
373
-rm -f $(DESTDIR)$(MANDIR)/man1/date.1
374
cp date.1 $(DESTDIR)$(MANDIR)/man1/.
370
cp -f date.1 $(DESTDIR)$(MANDIR)/man1/.
377
373
(echo 'static char const PKGVERSION[]="($(PACKAGE)) ";' && \
461
455
rm -f core *.o *.out \
462
date leapseconds tzselect version.h zdump zic yearistype
456
date tzselect version.h zdump zic yearistype
463
457
clean: clean_misc
466
460
maintainer-clean: clean
467
461
@echo 'This command is intended for maintainers to use; it'
468
462
@echo 'deletes files that may need special tools to rebuild.'
469
rm -f $(MANTXTS) *.asc *.tar.gz
463
rm -f leapseconds $(MANTXTS) *.asc *.tar.gz
472
466
@echo $(ENCHILADA)
491
485
# and if the files have not changed since then.
492
486
# This uses GNU 'touch' syntax 'touch -d@N FILE',
493
487
# where N is the number of seconds since 1970.
494
# If git or GNU 'touch' is absent, do nothing and fail.
488
# If git or GNU 'touch' is absent, don't bother to sync with git timestamps.
495
489
# Also, set the timestamp of each prebuilt file like 'leapseconds'
496
490
# to be the maximum of the files it depends on.
497
491
set-timestamps.out: $(ENCHILADA)
499
-files=`git ls-files $(ENCHILADA)` && \
500
touch -md @1 test.out && rm -f test.out && \
501
for file in $$files; do \
502
if git diff --quiet $$file; then \
503
time=`git log -1 --format='tformat:%ct' $$file` && \
504
touch -cmd @$$time $$file; \
506
echo >&2 "$$file: warning: does not match repository"; \
493
if files=`git ls-files $(ENCHILADA)` && \
494
touch -md @1 test.out; then \
496
for file in $$files; do \
497
if git diff --quiet $$file; then \
498
time=`git log -1 --format='tformat:%ct' $$file` && \
499
touch -cmd @$$time $$file; \
501
echo >&2 "$$file: warning: does not match repository"; \
509
505
touch -cmr `ls -t $(LEAP_DEPS) | sed 1q` leapseconds
510
506
for file in `ls $(MANTXTS) | sed 's/\.txt$$//'`; do \
511
507
touch -cmr `ls -t $$file workman.sh | sed 1q` $$file.txt || \
524
520
$(zic) -v -d tzpublic $$i 2>&1 || exit; \
526
522
$(zic) -v -d tzpublic $(TDATA)
529
525
# Check that the code works under various alternative
530
526
# implementations of time_t.
531
527
check_time_t_alternatives:
533
528
zones=`$(AWK) '/^[^#]/ { print $$3 }' <zone.tab` && \
534
529
for type in $(TIME_T_ALTERNATIVES); do \
535
mkdir tzpublic/$$type && \
530
mkdir -p tzpublic/$$type && \
536
531
make clean_misc && \
537
532
make TOPDIR=`pwd`/tzpublic/$$type \
538
533
CFLAGS='$(CFLAGS) -Dtime_tz='"'$$type'" \