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