66PACKAGE = tzcode
77
88# Version numbers of the code and data distributions.
9- VERSION = 2013g
9+ VERSION = 2013h
1010
1111# Email address for bug reports.
1212@@ -72,7 +72,6 @@ MANDIR= $(TOPDIR)/man
7272# Library functions are put in an archive in LIBDIR.
7373
7474LIBDIR = $(TOPDIR ) /lib
75- TZLIB = $(LIBDIR ) /libtz.a
7675
7776# If you always want time values interpreted as "seconds since the epoch
7877# (not counting leap seconds)", use
@@ -247,8 +246,12 @@ ZFLAGS=
247246# The name of a Posix-compliant `awk' on your system.
248247AWK = awk
249248
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.
252255KSHELL = /bin/bash
253256
254257# The path where SGML DTDs are kept.
@@ -298,11 +301,13 @@ GZIPFLAGS= -9n
298301cc= cc
299302CC= $(cc) -DTZDIR=\"$(TZDIR)\"
300303
301- TZCSRCS= zic.c localtime.c asctime.c scheck.c ialloc.c
304+ AR= ar
305+
306+ # ' :' on typical hosts; ' ranlib' on the ancient hosts that still need ranlib.
307+ RANLIB= :
308+
302309TZCOBJS= 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
306311DATEOBJS= date.o localtime.o strftime.o asctime.o
307312LIBSRCS= localtime.c asctime.c difftime.c
308313LIBOBJS= localtime.o asctime.o difftime.o
@@ -324,10 +329,10 @@ YDATA= $(PRIMARY_YDATA) pacificnew etcetera backward
324329NDATA= systemv factory
325330SDATA= solar87 solar88 solar89
326331TDATA= $(YDATA) $(NDATA) $(SDATA)
327- TABDATA= iso3166.tab zone.tab
332+ TABDATA= iso3166.tab zone.tab leapseconds
328333LEAP_DEPS= leapseconds.awk leap-seconds.list
329334DATA= $(YDATA) $(NDATA) $(SDATA) $(TABDATA) \
330- leapseconds $(LEAP_DEPS) yearistype.sh
335+ $(LEAP_DEPS) yearistype.sh
331336WEB_PAGES= tz-art.htm tz-link.htm
332337AWK_SCRIPTS= checktab.awk leapseconds.awk
333338MISC= usno1988 usno1989 usno1989a usno1995 usno1997 usno1998 \
@@ -340,38 +345,29 @@ ENCHILADA= $(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC)
340345
341346SHELL= /bin/sh
342347
343- all: tzselect zic zdump $(LIBOBJS) $(TABDATA)
348+ all: tzselect zic zdump libtz.a $(TABDATA)
344349
345350ALL: all date
346351
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
348357 $(ZIC) -y $(YEARISTYPE) \
349358 -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)/.
354360 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/.
367366
368367INSTALL: ALL install date.1
369- - mkdir $(DESTDIR)$(TOPDIR ) $(DESTDIR)$(BINDIR)
368+ mkdir -p $(DESTDIR)$(BINDIR ) $(DESTDIR)$(MANDIR)/man1
370369 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/.
375371
376372version.h:
377373 (echo ' static char const PKGVERSION[]=" ($( PACKAGE) ) " ; ' && \
@@ -426,11 +422,9 @@ posix_right: posix_only leapseconds
426422
427423zones: $(REDO)
428424
429- $(DESTDIR)$(TZLIB): $(LIBOBJS)
430- -mkdir -p $(DESTDIR)$(TOPDIR) $(DESTDIR)$(LIBDIR)
431- ar ru $@ $(LIBOBJS)
432- if [ -x /usr/ucb/ranlib ] || [ -x /usr/bin/ranlib ]; \
433- then ranlib $@ ; fi
425+ libtz.a: $(LIBOBJS)
426+ $(AR) ru $@ $(LIBOBJS)
427+ $(RANLIB) $@
434428
435429date: $(DATEOBJS)
436430 $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS)
@@ -459,14 +453,14 @@ check_web: $(WEB_PAGES)
459453
460454clean_misc:
461455 rm -f core * .o * .out \
462- date leapseconds tzselect version.h zdump zic yearistype
456+ date tzselect version.h zdump zic yearistype
463457clean: clean_misc
464- rm -f -r tzpublic
458+ rm -fr tzpublic
465459
466460maintainer-clean: clean
467461 @echo ' This command is intended for maintainers to use; it'
468462 @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
470464
471465names:
472466 @echo $( ENCHILADA)
@@ -491,21 +485,23 @@ $(MANTXTS): workman.sh
491485# and if the files have not changed since then.
492486# This uses GNU 'touch' syntax 'touch -d@N FILE',
493487# 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 .
495489# Also, set the timestamp of each prebuilt file like 'leapseconds'
496490# to be the maximum of the files it depends on.
497491set-timestamps.out: $( ENCHILADA)
498492 rm -f $@
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; \
505- else \
506- echo >&2 " $$ file: warning: does not match repository" ; \
507- fi || exit ; \
508- done
493+ if files=` git ls-files $( ENCHILADA) ` && \
494+ touch -md @1 test.out; then \
495+ rm -f test.out && \
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; \
500+ else \
501+ echo >&2 " $$ file: warning: does not match repository" ; \
502+ fi || exit ; \
503+ done ; \
504+ fi
509505 touch -cmr ` ls -t $(LEAP_DEPS ) | sed 1q` leapseconds
510506 for file in ` ls $( MANTXTS) | sed ' s/\.txt$$//' ` ; do \
511507 touch -cmr ` ls -t $$ file workman.sh | sed 1q` $$ file.txt || \
@@ -524,15 +520,14 @@ check_public: $(ENCHILADA)
524520 $( zic) -v -d tzpublic $$ i 2>&1 || exit ; \
525521 done
526522 $( zic) -v -d tzpublic $( TDATA)
527- rm -f -r tzpublic
523+ rm -fr tzpublic
528524
529525# Check that the code works under various alternative
530526# implementations of time_t.
531527check_time_t_alternatives:
532- mkdir tzpublic
533528 zones= ` $(AWK ) '/^[^# ]/ { print $$3 }' <zone.tab` && \
534529 for type in $(TIME_T_ALTERNATIVES); do \
535- mkdir tzpublic/$$type && \
530+ mkdir -p tzpublic/$$type && \
536531 make clean_misc && \
537532 make TOPDIR=`pwd`/tzpublic/$$type \
538533 CFLAGS='$(CFLAGS) -Dtime_tz='"'$$type'" \
@@ -553,7 +548,7 @@ check_time_t_alternatives:
553548 diff -u tzpublic/int64_t.out tzpublic/$$type.out \
554549 || exit; \
555550 done
556- rm -f -r tzpublic
551+ rm -fr tzpublic
557552
558553tarballs : tzcode$(VERSION ) .tar.gz tzdata$(VERSION ) .tar.gz
559554
0 commit comments