Home | History | Annotate | Line # | Download | only in time
Makefile revision 1.39.2.3
      1  1.39.2.2  pgoyette # Make and install tzdb code and data.
      2  1.39.2.2  pgoyette 
      3       1.1   mlelstv # This file is in the public domain, so clarified as of
      4       1.1   mlelstv # 2009-05-17 by Arthur David Olson.
      5       1.1   mlelstv 
      6      1.10  christos # Package name for the code distribution.
      7      1.10  christos PACKAGE=	tzcode
      8      1.10  christos 
      9      1.34  christos # Version number for the distribution, overridden in the 'tarballs' rule below.
     10      1.35  christos VERSION=	unknown
     11       1.9  christos 
     12       1.9  christos # Email address for bug reports.
     13       1.9  christos BUGEMAIL=	tz@iana.org
     14       1.6  christos 
     15  1.39.2.1  pgoyette # Choose source data features.  To get new features right away, use:
     16  1.39.2.1  pgoyette #	DATAFORM=	vanguard
     17  1.39.2.1  pgoyette # To wait a while before using new features, to give downstream users
     18  1.39.2.1  pgoyette # time to upgrade zic (the default), use:
     19  1.39.2.1  pgoyette #	DATAFORM=	main
     20  1.39.2.1  pgoyette # To wait even longer for new features, use:
     21  1.39.2.1  pgoyette #	DATAFORM=	rearguard
     22  1.39.2.1  pgoyette DATAFORM=		main
     23  1.39.2.1  pgoyette 
     24  1.39.2.2  pgoyette # Change the line below for your timezone (after finding the one you want in
     25  1.39.2.2  pgoyette # one of the $(TDATA) source files, or adding it to a source file).
     26  1.39.2.2  pgoyette # Alternatively, if you discover you've got the wrong timezone, you can just
     27       1.1   mlelstv #	zic -l rightzone
     28       1.1   mlelstv # to correct things.
     29       1.1   mlelstv # Use the command
     30       1.1   mlelstv #	make zonenames
     31       1.1   mlelstv # to get a list of the values you can use for LOCALTIME.
     32       1.1   mlelstv 
     33       1.4  christos LOCALTIME=	GMT
     34       1.1   mlelstv 
     35       1.1   mlelstv # If you want something other than Eastern United States time as a template
     36  1.39.2.2  pgoyette # for handling POSIX-style timezone environment variables,
     37  1.39.2.2  pgoyette # change the line below (after finding the timezone you want in the
     38  1.39.2.2  pgoyette # one of the $(TDATA) source files, or adding it to a source file).
     39  1.39.2.1  pgoyette # When a POSIX-style environment variable is handled, the rules in the
     40       1.1   mlelstv # template file are used to determine "spring forward" and "fall back" days and
     41      1.15  christos # times; the environment variable itself specifies UT offsets of standard and
     42  1.39.2.1  pgoyette # daylight saving time.
     43  1.39.2.2  pgoyette # Alternatively, if you discover you've got the wrong timezone, you can just
     44       1.1   mlelstv #	zic -p rightzone
     45       1.1   mlelstv # to correct things.
     46       1.1   mlelstv # Use the command
     47       1.1   mlelstv #	make zonenames
     48       1.1   mlelstv # to get a list of the values you can use for POSIXRULES.
     49       1.1   mlelstv # If you want POSIX compatibility, use "America/New_York".
     50       1.1   mlelstv 
     51       1.1   mlelstv POSIXRULES=	America/New_York
     52       1.1   mlelstv 
     53       1.1   mlelstv # Also see TZDEFRULESTRING below, which takes effect only
     54       1.1   mlelstv # if the time zone files cannot be accessed.
     55       1.1   mlelstv 
     56       1.1   mlelstv 
     57      1.39  christos # Installation locations.
     58      1.39  christos #
     59      1.39  christos # The defaults are suitable for Debian, except that if REDO is
     60      1.39  christos # posix_right or right_posix then files that Debian puts under
     61      1.39  christos # /usr/share/zoneinfo/posix and /usr/share/zoneinfo/right are instead
     62      1.39  christos # put under /usr/share/zoneinfo-posix and /usr/share/zoneinfo-leaps,
     63      1.39  christos # respectively.  Problems with the Debian approach are discussed in
     64      1.39  christos # the commentary for the right_posix rule (below).
     65      1.39  christos 
     66      1.39  christos # Destination directory, which can be used for staging.
     67      1.39  christos # 'make DESTDIR=/stage install' installs under /stage (e.g., to
     68      1.39  christos # /stage/etc/localtime instead of to /etc/localtime).  Files under
     69      1.39  christos # /stage are not intended to work as-is, but can be copied by hand to
     70      1.39  christos # the root directory later.  If DESTDIR is empty, 'make install' does
     71      1.39  christos # not stage, but installs directly into production locations.
     72      1.39  christos DESTDIR =
     73      1.39  christos 
     74      1.39  christos # Everything is installed into subdirectories of TOPDIR, and used there.
     75      1.39  christos # TOPDIR should be empty (meaning the root directory),
     76      1.39  christos # or a directory name that does not end in "/".
     77      1.39  christos # TOPDIR should be empty or an absolute name unless you're just testing.
     78      1.39  christos TOPDIR =
     79      1.39  christos 
     80  1.39.2.2  pgoyette # The default local timezone is taken from the file TZDEFAULT.
     81      1.39  christos TZDEFAULT = $(TOPDIR)/etc/localtime
     82      1.39  christos 
     83      1.39  christos # The subdirectory containing installed program and data files, and
     84      1.39  christos # likewise for installed files that can be shared among architectures.
     85      1.39  christos # These should be relative file names.
     86      1.39  christos USRDIR = usr
     87      1.39  christos USRSHAREDIR = $(USRDIR)/share
     88       1.1   mlelstv 
     89  1.39.2.2  pgoyette # "Compiled" timezone information is placed in the "TZDIR" directory
     90       1.1   mlelstv # (and subdirectories).
     91      1.38  christos # TZDIR_BASENAME should not contain "/" and should not be ".", ".." or empty.
     92      1.15  christos TZDIR_BASENAME=	zoneinfo
     93      1.39  christos TZDIR = $(TOPDIR)/$(USRSHAREDIR)/$(TZDIR_BASENAME)
     94       1.1   mlelstv 
     95      1.39  christos # The "tzselect" and (if you do "make INSTALL") "date" commands go in:
     96      1.39  christos BINDIR = $(TOPDIR)/$(USRDIR)/bin
     97       1.1   mlelstv 
     98      1.39  christos # The "zdump" command goes in:
     99      1.39  christos ZDUMPDIR = $(BINDIR)
    100       1.1   mlelstv 
    101      1.39  christos # The "zic" command goes in:
    102      1.39  christos ZICDIR = $(TOPDIR)/$(USRDIR)/sbin
    103       1.1   mlelstv 
    104       1.1   mlelstv # Manual pages go in subdirectories of. . .
    105      1.39  christos MANDIR = $(TOPDIR)/$(USRSHAREDIR)/man
    106       1.1   mlelstv 
    107      1.39  christos # Library functions are put in an archive in LIBDIR.
    108      1.39  christos LIBDIR = $(TOPDIR)/$(USRDIR)/lib
    109       1.1   mlelstv 
    110       1.1   mlelstv 
    111  1.39.2.2  pgoyette # Types to try, as an alternative to time_t.
    112  1.39.2.2  pgoyette TIME_T_ALTERNATIVES = $(TIME_T_ALTERNATIVES_HEAD) $(TIME_T_ALTERNATIVES_TAIL)
    113  1.39.2.2  pgoyette TIME_T_ALTERNATIVES_HEAD = int64_t
    114  1.39.2.2  pgoyette TIME_T_ALTERNATIVES_TAIL = int32_t uint32_t uint64_t
    115       1.1   mlelstv 
    116  1.39.2.2  pgoyette # What kind of TZif data files to generate.
    117  1.39.2.2  pgoyette # (TZif is the binary time zone data format that zic generates.)
    118      1.37  christos # If you want only POSIX time, with time values interpreted as
    119      1.37  christos # seconds since the epoch (not counting leap seconds), use
    120       1.1   mlelstv #	REDO=		posix_only
    121      1.38  christos # below.  If you want only "right" time, with values interpreted
    122      1.37  christos # as seconds since the epoch (counting leap seconds), use
    123       1.1   mlelstv #	REDO=		right_only
    124       1.1   mlelstv # below.  If you want both sets of data available, with leap seconds not
    125       1.1   mlelstv # counted normally, use
    126       1.1   mlelstv #	REDO=		posix_right
    127       1.1   mlelstv # below.  If you want both sets of data available, with leap seconds counted
    128       1.1   mlelstv # normally, use
    129       1.1   mlelstv #	REDO=		right_posix
    130      1.32  christos # below.  POSIX mandates that leap seconds not be counted; for compatibility
    131      1.37  christos # with it, use "posix_only" or "posix_right".  Use POSIX time on systems with
    132      1.37  christos # leap smearing; this can work better than unsmeared "right" time with
    133      1.37  christos # applications that are not leap second aware, and is closer to unsmeared
    134      1.37  christos # "right" time than unsmeared POSIX time is (e.g., 0.5 vs 1.0 s max error).
    135       1.1   mlelstv 
    136       1.1   mlelstv REDO=		posix_right
    137       1.1   mlelstv 
    138  1.39.2.2  pgoyette # To install data in text form that has all the information of the TZif data,
    139      1.38  christos # (optionally incorporating leap second information), use
    140      1.38  christos #	TZDATA_TEXT=	tzdata.zi leapseconds
    141      1.38  christos # To install text data without leap second information (e.g., because
    142      1.38  christos # REDO='posix_only'), use
    143      1.38  christos #	TZDATA_TEXT=	tzdata.zi
    144      1.38  christos # To avoid installing text data, use
    145      1.38  christos #	TZDATA_TEXT=
    146      1.38  christos 
    147      1.38  christos TZDATA_TEXT=	leapseconds tzdata.zi
    148      1.38  christos 
    149      1.38  christos # For backward-compatibility links for old zone names, use
    150      1.39  christos #	BACKWARD=	backward
    151      1.39  christos # If you also want the link US/Pacific-New, even though it is confusing
    152      1.39  christos # and is planned to be removed from the database eventually, use
    153      1.38  christos #	BACKWARD=	backward pacificnew
    154      1.38  christos # To omit these links, use
    155      1.38  christos #	BACKWARD=
    156      1.38  christos 
    157      1.39  christos BACKWARD=	backward
    158      1.38  christos 
    159      1.32  christos # If you want out-of-scope and often-wrong data from the file 'backzone', use
    160      1.32  christos #	PACKRATDATA=	backzone
    161      1.32  christos # To omit this data, use
    162      1.32  christos #	PACKRATDATA=
    163      1.32  christos 
    164      1.32  christos PACKRATDATA=
    165      1.32  christos 
    166      1.38  christos # The name of a locale using the UTF-8 encoding, used during self-tests.
    167      1.38  christos # The tests are skipped if the name does not appear to work on this system.
    168      1.38  christos 
    169      1.38  christos UTF8_LOCALE=	en_US.utf8
    170      1.38  christos 
    171       1.1   mlelstv # Since "." may not be in PATH...
    172       1.1   mlelstv 
    173       1.1   mlelstv YEARISTYPE=	./yearistype
    174       1.1   mlelstv 
    175       1.1   mlelstv # Non-default libraries needed to link.
    176       1.1   mlelstv LDLIBS=
    177       1.1   mlelstv 
    178      1.38  christos # Add the following to the end of the "CFLAGS=" line as needed to override
    179      1.38  christos # defaults specified in the source code.  "-DFOO" is equivalent to "-DFOO=1".
    180      1.38  christos #  -DDEPRECATE_TWO_DIGIT_YEARS for optional runtime warnings about strftime
    181      1.38  christos #	formats that generate only the last two digits of year numbers
    182      1.38  christos #  -DEPOCH_LOCAL if the 'time' function returns local time not UT
    183      1.38  christos #  -DEPOCH_OFFSET=N if the 'time' function returns a value N greater
    184      1.38  christos #	than what POSIX specifies, assuming local time is UT.
    185      1.38  christos #	For example, N is 252460800 on AmigaOS.
    186      1.32  christos #  -DHAVE_DECL_ASCTIME_R=0 if <time.h> does not declare asctime_r
    187      1.38  christos #  -DHAVE_DECL_ENVIRON if <unistd.h> declares 'environ'
    188      1.32  christos #  -DHAVE_DIRECT_H if mkdir needs <direct.h> (MS-Windows)
    189      1.38  christos #  -DHAVE_GENERIC=0 if _Generic does not work
    190      1.38  christos #  -DHAVE_GETTEXT if 'gettext' works (e.g., GNU/Linux, FreeBSD, Solaris)
    191      1.38  christos #  -DHAVE_INCOMPATIBLE_CTIME_R if your system's time.h declares
    192      1.35  christos #	ctime_r and asctime_r incompatibly with the POSIX standard
    193      1.35  christos #	(Solaris when _POSIX_PTHREAD_SEMANTICS is not defined).
    194      1.38  christos #  -DHAVE_INTTYPES_H if you have a non-C99 compiler with <inttypes.h>
    195      1.16  christos #  -DHAVE_LINK=0 if your system lacks a link function
    196      1.23  christos #  -DHAVE_LOCALTIME_R=0 if your system lacks a localtime_r function
    197      1.23  christos #  -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz
    198      1.23  christos #	localtime_rz can make zdump significantly faster, but is nonstandard.
    199      1.32  christos #  -DHAVE_POSIX_DECLS=0 if your system's include files do not declare
    200      1.32  christos #	functions like 'link' or variables like 'tzname' required by POSIX
    201      1.38  christos #  -DHAVE_SNPRINTF=0 if your system lacks the snprintf function
    202      1.38  christos #  -DHAVE_STDBOOL_H if you have a non-C99 compiler with <stdbool.h>
    203      1.38  christos #  -DHAVE_STDINT_H if you have a non-C99 compiler with <stdint.h>
    204      1.38  christos #  -DHAVE_STRFTIME_L if <time.h> declares locale_t and strftime_l
    205      1.28  christos #  -DHAVE_STRDUP=0 if your system lacks the strdup function
    206  1.39.2.1  pgoyette #  -DHAVE_STRTOLL=0 if your system lacks the strtoll function
    207       1.1   mlelstv #  -DHAVE_SYMLINK=0 if your system lacks the symlink function
    208      1.38  christos #  -DHAVE_SYS_STAT_H=0 if your compiler lacks a <sys/stat.h>
    209      1.38  christos #  -DHAVE_SYS_WAIT_H=0 if your compiler lacks a <sys/wait.h>
    210      1.23  christos #  -DHAVE_TZSET=0 if your system lacks a tzset function
    211      1.38  christos #  -DHAVE_UNISTD_H=0 if your compiler lacks a <unistd.h>
    212      1.38  christos #  -Dlocale_t=XXX if your system uses XXX instead of locale_t
    213  1.39.2.1  pgoyette #  -DRESERVE_STD_EXT_IDS if your platform reserves standard identifiers
    214  1.39.2.1  pgoyette #	with external linkage, e.g., applications cannot define 'localtime'.
    215      1.38  christos #  -Dssize_t=long on hosts like MS-Windows that lack ssize_t
    216  1.39.2.1  pgoyette #  -DSUPPRESS_TZDIR to not prepend TZDIR to file names; this has
    217  1.39.2.1  pgoyette #	security implications and is not recommended for general use
    218      1.38  christos #  -DTHREAD_SAFE to make localtime.c thread-safe, as POSIX requires;
    219      1.23  christos #	not needed by the main-program tz code, which is single-threaded.
    220      1.23  christos #	Append other compiler flags as needed, e.g., -pthread on GNU/Linux.
    221      1.14  christos #  -Dtime_tz=\"T\" to use T as the time_t type, rather than the system time_t
    222      1.38  christos #	This is intended for internal use only; it mangles external names.
    223       1.1   mlelstv #  -DTZ_DOMAIN=\"foo\" to use "foo" for gettext domain name; default is "tz"
    224      1.22  christos #  -DTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory;
    225       1.1   mlelstv #	the default is system-supplied, typically "/usr/lib/locale"
    226      1.14  christos #  -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified
    227      1.38  christos #	DST transitions if the time zone files cannot be accessed
    228      1.38  christos #  -DUNINIT_TRAP if reading uninitialized storage can cause problems
    229      1.23  christos #	other than simply getting garbage data
    230      1.23  christos #  -DUSE_LTZ=0 to build zdump with the system time zone library
    231      1.23  christos #	Also set TZDOBJS=zdump.o and CHECK_TIME_T_ALTERNATIVES= below.
    232       1.1   mlelstv #  -DZIC_MAX_ABBR_LEN_WO_WARN=3
    233       1.1   mlelstv #	(or some other number) to set the maximum time zone abbreviation length
    234       1.1   mlelstv #	that zic will accept without a warning (the default is 6)
    235      1.30  christos #  $(GCC_DEBUG_FLAGS) if you are using recent GCC and want lots of checking
    236      1.38  christos # Select instrumentation via "make GCC_INSTRUMENT='whatever'".
    237      1.38  christos GCC_INSTRUMENT = \
    238      1.38  christos   -fsanitize=undefined -fsanitize-address-use-after-scope \
    239      1.38  christos   -fsanitize-undefined-trap-on-error -fstack-protector
    240      1.38  christos GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \
    241      1.38  christos   $(GCC_INSTRUMENT) \
    242      1.38  christos   -Wall -Wextra \
    243      1.38  christos   -Walloc-size-larger-than=100000 -Warray-bounds=2 \
    244  1.39.2.1  pgoyette   -Wbad-function-cast -Wcast-align=strict -Wdate-time \
    245      1.38  christos   -Wdeclaration-after-statement -Wdouble-promotion \
    246      1.38  christos   -Wformat=2 -Wformat-overflow=2 -Wformat-signedness -Wformat-truncation \
    247      1.38  christos   -Winit-self -Wjump-misses-init -Wlogical-op \
    248      1.38  christos   -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
    249      1.38  christos   -Wold-style-definition -Woverlength-strings -Wpointer-arith \
    250  1.39.2.1  pgoyette   -Wshadow -Wshift-overflow=2 -Wstrict-prototypes -Wstringop-overflow=4 \
    251  1.39.2.1  pgoyette   -Wstringop-truncation -Wsuggest-attribute=cold \
    252      1.38  christos   -Wsuggest-attribute=const -Wsuggest-attribute=format \
    253  1.39.2.1  pgoyette   -Wsuggest-attribute=malloc \
    254      1.38  christos   -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure \
    255      1.38  christos   -Wtrampolines -Wundef -Wuninitialized -Wunused \
    256      1.38  christos   -Wvariadic-macros -Wvla -Wwrite-strings \
    257      1.38  christos   -Wno-address -Wno-format-nonliteral -Wno-sign-compare \
    258      1.38  christos   -Wno-type-limits -Wno-unused-parameter
    259       1.1   mlelstv #
    260       1.1   mlelstv # If your system has a "GMT offset" field in its "struct tm"s
    261       1.1   mlelstv # (or if you decide to add such a field in your system's "time.h" file),
    262       1.1   mlelstv # add the name to a define such as
    263       1.1   mlelstv #	-DTM_GMTOFF=tm_gmtoff
    264      1.23  christos # to the end of the "CFLAGS=" line.  If not defined, the code attempts to
    265      1.23  christos # guess TM_GMTOFF from other macros; define NO_TM_GMTOFF to suppress this.
    266      1.23  christos # Similarly, if your system has a "zone abbreviation" field, define
    267       1.1   mlelstv #	-DTM_ZONE=tm_zone
    268      1.23  christos # and define NO_TM_ZONE to suppress any guessing.  These two fields are not
    269      1.23  christos # required by POSIX, but are widely available on GNU/Linux and BSD systems.
    270       1.1   mlelstv #
    271      1.38  christos # The next batch of options control support for external variables
    272      1.38  christos # exported by tzcode.  In practice these variables are less useful
    273      1.38  christos # than TM_GMTOFF and TM_ZONE.  However, most of them are standardized.
    274      1.38  christos # #
    275      1.38  christos # # To omit or support the external variable "tzname", add one of:
    276      1.38  christos # #	-DHAVE_TZNAME=0
    277      1.38  christos # #	-DHAVE_TZNAME=1
    278      1.38  christos # # to the "CFLAGS=" line.  "tzname" is required by POSIX 1988 and later.
    279      1.38  christos # # If not defined, the code attempts to guess HAVE_TZNAME from other macros.
    280      1.38  christos # # Warning: unless time_tz is also defined, HAVE_TZNAME=1 can cause
    281      1.38  christos # # crashes when combined with some platforms' standard libraries,
    282      1.38  christos # # presumably due to memory allocation issues.
    283      1.38  christos # #
    284      1.38  christos # # To omit or support the external variables "timezone" and "daylight", add
    285      1.38  christos # #	-DUSG_COMPAT=0
    286      1.38  christos # #	-DUSG_COMPAT=1
    287      1.38  christos # # to the "CFLAGS=" line; "timezone" and "daylight" are inspired by
    288      1.38  christos # # Unix Systems Group code and are required by POSIX 2008 (with XSI) and later.
    289      1.38  christos # # If not defined, the code attempts to guess USG_COMPAT from other macros.
    290      1.38  christos # #
    291      1.38  christos # # To support the external variable "altzone", add
    292      1.38  christos # #	-DALTZONE
    293      1.38  christos # # to the end of the "CFLAGS=" line; although "altzone" appeared in
    294      1.38  christos # # System V Release 3.1 it has not been standardized.
    295      1.38  christos #
    296       1.1   mlelstv # If you want functions that were inspired by early versions of X3J11's work,
    297       1.1   mlelstv # add
    298       1.1   mlelstv #	-DSTD_INSPIRED
    299       1.1   mlelstv # to the end of the "CFLAGS=" line.  This arranges for the functions
    300       1.1   mlelstv # "tzsetwall", "offtime", "timelocal", "timegm", "timeoff",
    301       1.1   mlelstv # "posix2time", and "time2posix" to be added to the time conversion library.
    302       1.1   mlelstv # "tzsetwall" is like "tzset" except that it arranges for local wall clock
    303  1.39.2.2  pgoyette # time (rather than the timezone specified in the TZ environment variable)
    304       1.1   mlelstv # to be used.
    305       1.1   mlelstv # "offtime" is like "gmtime" except that it accepts a second (long) argument
    306       1.1   mlelstv # that gives an offset to add to the time_t when converting it.
    307       1.1   mlelstv # "timelocal" is equivalent to "mktime".
    308       1.1   mlelstv # "timegm" is like "timelocal" except that it turns a struct tm into
    309      1.15  christos # a time_t using UT (rather than local time as "timelocal" does).
    310       1.1   mlelstv # "timeoff" is like "timegm" except that it accepts a second (long) argument
    311       1.1   mlelstv # that gives an offset to use when converting to a time_t.
    312       1.1   mlelstv # "posix2time" and "time2posix" are described in an included manual page.
    313       1.1   mlelstv # X3J11's work does not describe any of these functions.
    314       1.1   mlelstv # Sun has provided "tzsetwall", "timelocal", and "timegm" in SunOS 4.0.
    315       1.1   mlelstv # These functions may well disappear in future releases of the time
    316       1.1   mlelstv # conversion package.
    317       1.1   mlelstv #
    318      1.23  christos # If you don't want functions that were inspired by NetBSD, add
    319      1.23  christos #	-DNETBSD_INSPIRED=0
    320      1.23  christos # to the end of the "CFLAGS=" line.  Otherwise, the functions
    321      1.23  christos # "localtime_rz", "mktime_z", "tzalloc", and "tzfree" are added to the
    322      1.23  christos # time library, and if STD_INSPIRED is also defined the functions
    323      1.23  christos # "posix2time_z" and "time2posix_z" are added as well.
    324      1.23  christos # The functions ending in "_z" (or "_rz") are like their unsuffixed
    325      1.23  christos # (or suffixed-by-"_r") counterparts, except with an extra first
    326  1.39.2.2  pgoyette # argument of opaque type timezone_t that specifies the timezone.
    327      1.23  christos # "tzalloc" allocates a timezone_t value, and "tzfree" frees it.
    328      1.23  christos #
    329       1.1   mlelstv # If you want to allocate state structures in localtime, add
    330       1.1   mlelstv #	-DALL_STATE
    331       1.1   mlelstv # to the end of the "CFLAGS=" line.  Storage is obtained by calling malloc.
    332       1.1   mlelstv #
    333       1.1   mlelstv # NIST-PCTS:151-2, Version 1.4, (1993-12-03) is a test suite put
    334       1.1   mlelstv # out by the National Institute of Standards and Technology
    335       1.1   mlelstv # which claims to test C and Posix conformance.  If you want to pass PCTS, add
    336       1.1   mlelstv #	-DPCTS
    337       1.1   mlelstv # to the end of the "CFLAGS=" line.
    338       1.1   mlelstv #
    339       1.1   mlelstv # If you want strict compliance with XPG4 as of 1994-04-09, add
    340       1.1   mlelstv #	-DXPG4_1994_04_09
    341       1.1   mlelstv # to the end of the "CFLAGS=" line.  This causes "strftime" to always return
    342      1.38  christos # 53 as a week number (rather than 52 or 53) for January days before
    343      1.38  christos # January's first Monday when a "%V" format is used and January 1
    344       1.1   mlelstv # falls on a Friday, Saturday, or Sunday.
    345       1.1   mlelstv 
    346       1.1   mlelstv CFLAGS=
    347       1.1   mlelstv 
    348       1.9  christos # Linker flags.  Default to $(LFLAGS) for backwards compatibility
    349      1.34  christos # to release 2012h and earlier.
    350       1.9  christos 
    351       1.9  christos LDFLAGS=	$(LFLAGS)
    352       1.1   mlelstv 
    353      1.32  christos # For leap seconds, this Makefile uses LEAPSECONDS='-L leapseconds' in
    354      1.32  christos # submake command lines.  The default is no leap seconds.
    355      1.32  christos 
    356      1.32  christos LEAPSECONDS=
    357      1.32  christos 
    358      1.32  christos # The zic command and its arguments.
    359      1.32  christos 
    360       1.1   mlelstv zic=		./zic
    361       1.1   mlelstv ZIC=		$(zic) $(ZFLAGS)
    362       1.1   mlelstv 
    363      1.15  christos ZFLAGS=
    364      1.15  christos 
    365  1.39.2.2  pgoyette # How to use zic to install TZif files.
    366      1.32  christos 
    367      1.39  christos ZIC_INSTALL=	$(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS)
    368      1.32  christos 
    369      1.22  christos # The name of a Posix-compliant 'awk' on your system.
    370  1.39.2.2  pgoyette # Older 'mawk' versions, such as the 'mawk' in Ubuntu 16.04, might dump core;
    371  1.39.2.2  pgoyette # on Ubuntu you can work around this with
    372  1.39.2.2  pgoyette #	AWK=		gawk
    373       1.9  christos AWK=		awk
    374       1.9  christos 
    375      1.16  christos # The full path name of a Posix-compliant shell, preferably one that supports
    376      1.16  christos # the Korn shell's 'select' statement as an extension.
    377      1.16  christos # These days, Bash is the most popular.
    378      1.16  christos # It should be OK to set this to /bin/sh, on platforms where /bin/sh
    379      1.16  christos # lacks 'select' or doesn't completely conform to Posix, but /bin/bash
    380      1.16  christos # is typically nicer if it works.
    381       1.9  christos KSHELL=		/bin/bash
    382       1.1   mlelstv 
    383  1.39.2.3  pgoyette # Name of curl <https://curl.haxx.se/>, used for HTML validation.
    384  1.39.2.3  pgoyette CURL=		curl
    385  1.39.2.3  pgoyette 
    386      1.18  christos # The path where SGML DTDs are kept and the catalog file(s) to use when
    387  1.39.2.3  pgoyette # validating HTML 4.01.  The default should work on both Debian and Red Hat.
    388      1.10  christos SGML_TOPDIR= /usr
    389       1.9  christos SGML_DTDDIR= $(SGML_TOPDIR)/share/xml/w3c-sgml-lib/schema/dtd
    390       1.9  christos SGML_SEARCH_PATH= $(SGML_DTDDIR)/REC-html401-19991224
    391      1.18  christos SGML_CATALOG_FILES= \
    392      1.34  christos   $(SGML_TOPDIR)/share/doc/w3-recs/html/www.w3.org/TR/1999/REC-html401-19991224/HTML4.cat:$(SGML_TOPDIR)/share/sgml/html/4.01/HTML4.cat
    393       1.1   mlelstv 
    394  1.39.2.3  pgoyette # The name, arguments and environment of a program to validate HTML 4.01.
    395      1.34  christos # See <http://openjade.sourceforge.net/doc/> for a validator, and
    396      1.34  christos # <https://validator.w3.org/source/> for a validation library.
    397      1.38  christos # Set VALIDATE=':' if you do not have such a program.
    398       1.1   mlelstv VALIDATE = nsgmls
    399       1.1   mlelstv VALIDATE_FLAGS = -s -B -wall -wno-unused-param
    400       1.1   mlelstv VALIDATE_ENV = \
    401      1.39  christos   SGML_CATALOG_FILES='$(SGML_CATALOG_FILES)' \
    402      1.39  christos   SGML_SEARCH_PATH='$(SGML_SEARCH_PATH)' \
    403       1.1   mlelstv   SP_CHARSET_FIXED=YES \
    404       1.1   mlelstv   SP_ENCODING=UTF-8
    405       1.1   mlelstv 
    406      1.23  christos # This expensive test requires USE_LTZ.
    407      1.23  christos # To suppress it, define this macro to be empty.
    408      1.23  christos CHECK_TIME_T_ALTERNATIVES = check_time_t_alternatives
    409      1.23  christos 
    410      1.22  christos # SAFE_CHAR is a regular expression that matches a safe character.
    411      1.22  christos # Some parts of this distribution are limited to safe characters;
    412      1.22  christos # others can use any UTF-8 character.
    413      1.22  christos # For now, the safe characters are a safe subset of ASCII.
    414       1.9  christos # The caller must set the shell variable 'sharp' to the character '#',
    415       1.9  christos # since Makefile macros cannot contain '#'.
    416       1.9  christos # TAB_CHAR is a single tab character, in single quotes.
    417       1.9  christos TAB_CHAR=	'	'
    418      1.22  christos SAFE_CHARSET1=	$(TAB_CHAR)' !\"'$$sharp'$$%&'\''()*+,./0123456789:;<=>?@'
    419      1.22  christos SAFE_CHARSET2=	'ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\^_`'
    420      1.22  christos SAFE_CHARSET3=	'abcdefghijklmnopqrstuvwxyz{|}~'
    421      1.29  christos SAFE_CHARSET=	$(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3)
    422      1.29  christos SAFE_CHAR=	'[]'$(SAFE_CHARSET)'-]'
    423      1.29  christos 
    424  1.39.2.2  pgoyette # These characters are Latin-1, and so are likely to be displayable
    425  1.39.2.2  pgoyette # even in editors with limited character sets.
    426  1.39.2.2  pgoyette UNUSUAL_OK_LATIN_1 = 
    427  1.39.2.2  pgoyette # This IPA symbol is represented in Unicode as the composition of
    428  1.39.2.2  pgoyette # U+0075 and U+032F, and U+032F is not considered alphabetic by some
    429  1.39.2.2  pgoyette # grep implementations that do not grok composition.
    430  1.39.2.2  pgoyette UNUSUAL_OK_IPA = u
    431  1.39.2.1  pgoyette # Non-ASCII non-letters that OK_CHAR allows, as these characters are
    432  1.39.2.2  pgoyette # useful in commentary.
    433  1.39.2.2  pgoyette UNUSUAL_OK_CHARSET= $(UNUSUAL_OK_LATIN_1)$(UNUSUAL_OK_IPA)
    434  1.39.2.1  pgoyette 
    435      1.29  christos # OK_CHAR matches any character allowed in the distributed files.
    436  1.39.2.1  pgoyette # This is the same as SAFE_CHAR, except that UNUSUAL_OK_CHARSET and
    437  1.39.2.1  pgoyette # multibyte letters are also allowed so that commentary can contain a
    438  1.39.2.1  pgoyette # few safe symbols and people's names and can quote non-English sources.
    439  1.39.2.1  pgoyette # Other non-letters are limited to ASCII renderings for the
    440  1.39.2.1  pgoyette # convenience of maintainers using XEmacs 21.5.34, which by default
    441  1.39.2.1  pgoyette # mishandles Unicode characters U+0100 and greater.
    442  1.39.2.1  pgoyette OK_CHAR=	'[][:alpha:]$(UNUSUAL_OK_CHARSET)'$(SAFE_CHARSET)'-]'
    443      1.22  christos 
    444      1.22  christos # SAFE_LINE matches a line of safe characters.
    445      1.29  christos # SAFE_SHARP_LINE is similar, except any OK character can follow '#';
    446      1.22  christos # this is so that comments can contain non-ASCII characters.
    447      1.29  christos # OK_LINE matches a line of OK characters.
    448      1.22  christos SAFE_LINE=	'^'$(SAFE_CHAR)'*$$'
    449      1.29  christos SAFE_SHARP_LINE='^'$(SAFE_CHAR)'*('$$sharp$(OK_CHAR)'*)?$$'
    450      1.29  christos OK_LINE=	'^'$(OK_CHAR)'*$$'
    451       1.9  christos 
    452       1.6  christos # Flags to give 'tar' when making a distribution.
    453       1.6  christos # Try to use flags appropriate for GNU tar.
    454      1.34  christos GNUTARFLAGS= --numeric-owner --owner=0 --group=0 --mode=go+u,go-w --sort=name
    455       1.6  christos TARFLAGS=	`if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \
    456       1.6  christos 		 then echo $(GNUTARFLAGS); \
    457       1.6  christos 		 else :; \
    458       1.6  christos 		 fi`
    459       1.6  christos 
    460       1.6  christos # Flags to give 'gzip' when making a distribution.
    461      1.38  christos GZIPFLAGS=	-9n
    462       1.6  christos 
    463       1.1   mlelstv ###############################################################################
    464       1.1   mlelstv 
    465      1.29  christos #MAKE=		make
    466      1.29  christos 
    467       1.1   mlelstv cc=		cc
    468      1.39  christos CC=		$(cc) -DTZDIR='"$(TZDIR)"'
    469       1.1   mlelstv 
    470      1.16  christos AR=		ar
    471      1.16  christos 
    472      1.16  christos # ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib.
    473      1.16  christos RANLIB=		:
    474      1.16  christos 
    475      1.28  christos TZCOBJS=	zic.o
    476      1.38  christos TZDOBJS=	zdump.o localtime.o asctime.o strftime.o
    477       1.1   mlelstv DATEOBJS=	date.o localtime.o strftime.o asctime.o
    478       1.1   mlelstv LIBSRCS=	localtime.c asctime.c difftime.c
    479       1.1   mlelstv LIBOBJS=	localtime.o asctime.o difftime.o
    480       1.1   mlelstv HEADERS=	tzfile.h private.h
    481      1.28  christos NONLIBSRCS=	zic.c zdump.c
    482       1.1   mlelstv NEWUCBSRCS=	date.c strftime.c
    483      1.23  christos SOURCES=	$(HEADERS) $(LIBSRCS) $(NONLIBSRCS) $(NEWUCBSRCS) \
    484      1.35  christos 			tzselect.ksh workman.sh
    485       1.1   mlelstv MANS=		newctime.3 newstrftime.3 newtzset.3 time2posix.3 \
    486       1.1   mlelstv 			tzfile.5 tzselect.8 zic.8 zdump.8
    487      1.16  christos MANTXTS=	newctime.3.txt newstrftime.3.txt newtzset.3.txt \
    488      1.16  christos 			time2posix.3.txt \
    489      1.16  christos 			tzfile.5.txt tzselect.8.txt zic.8.txt zdump.8.txt \
    490      1.16  christos 			date.1.txt
    491      1.38  christos COMMON=		calendars CONTRIBUTING LICENSE Makefile \
    492      1.38  christos 			NEWS README theory.html version
    493      1.39  christos WEB_PAGES=	tz-art.html tz-how-to.html tz-link.html
    494  1.39.2.3  pgoyette CHECK_WEB_PAGES=check_tz-art.html check_tz-how-to.html check_tz-link.html
    495      1.23  christos DOCS=		$(MANS) date.1 $(MANTXTS) $(WEB_PAGES)
    496       1.1   mlelstv PRIMARY_YDATA=	africa antarctica asia australasia \
    497       1.1   mlelstv 		europe northamerica southamerica
    498      1.39  christos YDATA=		$(PRIMARY_YDATA) etcetera
    499       1.4  christos NDATA=		systemv factory
    500      1.39  christos TDATA_TO_CHECK=	$(YDATA) $(NDATA) backward pacificnew
    501      1.39  christos TDATA=		$(YDATA) $(NDATA) $(BACKWARD)
    502      1.22  christos ZONETABLES=	zone1970.tab zone.tab
    503      1.38  christos TABDATA=	iso3166.tab $(TZDATA_TEXT) $(ZONETABLES)
    504      1.16  christos LEAP_DEPS=	leapseconds.awk leap-seconds.list
    505  1.39.2.1  pgoyette TZDATA_ZI_DEPS=	ziguard.awk zishrink.awk version $(TDATA) $(PACKRATDATA)
    506  1.39.2.1  pgoyette DSTDATA_ZI_DEPS= ziguard.awk $(TDATA) $(PACKRATDATA)
    507      1.39  christos DATA=		$(TDATA_TO_CHECK) backzone iso3166.tab leap-seconds.list \
    508      1.38  christos 			leapseconds yearistype.sh $(ZONETABLES)
    509  1.39.2.1  pgoyette AWK_SCRIPTS=	checklinks.awk checktab.awk leapseconds.awk \
    510  1.39.2.1  pgoyette 			ziguard.awk zishrink.awk
    511      1.23  christos MISC=		$(AWK_SCRIPTS) zoneinfo2tdf.pl
    512      1.34  christos TZS_YEAR=	2050
    513  1.39.2.2  pgoyette TZS_CUTOFF_FLAG=	-c $(TZS_YEAR)
    514      1.34  christos TZS=		to$(TZS_YEAR).tzs
    515      1.34  christos TZS_NEW=	to$(TZS_YEAR)new.tzs
    516      1.34  christos TZS_DEPS=	$(PRIMARY_YDATA) asctime.c localtime.c \
    517      1.34  christos 			private.h tzfile.h zdump.c zic.c
    518  1.39.2.2  pgoyette # EIGHT_YARDS is just a yard short of the whole ENCHILADA.
    519  1.39.2.2  pgoyette EIGHT_YARDS = $(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC) tzdata.zi
    520  1.39.2.2  pgoyette ENCHILADA = $(EIGHT_YARDS) $(TZS)
    521      1.34  christos 
    522      1.34  christos # Consult these files when deciding whether to rebuild the 'version' file.
    523      1.34  christos # This list is not the same as the output of 'git ls-files', since
    524      1.34  christos # .gitignore is not distributed.
    525      1.34  christos VERSION_DEPS= \
    526      1.38  christos 		calendars CONTRIBUTING LICENSE Makefile NEWS README \
    527      1.34  christos 		africa antarctica asctime.c asia australasia \
    528      1.34  christos 		backward backzone \
    529      1.34  christos 		checklinks.awk checktab.awk \
    530      1.34  christos 		date.1 date.c difftime.c \
    531      1.34  christos 		etcetera europe factory iso3166.tab \
    532      1.34  christos 		leap-seconds.list leapseconds.awk localtime.c \
    533      1.34  christos 		newctime.3 newstrftime.3 newtzset.3 northamerica \
    534      1.34  christos 		pacificnew private.h \
    535      1.38  christos 		southamerica strftime.c systemv theory.html \
    536      1.39  christos 		time2posix.3 tz-art.html tz-how-to.html tz-link.html \
    537      1.34  christos 		tzfile.5 tzfile.h tzselect.8 tzselect.ksh \
    538      1.34  christos 		workman.sh yearistype.sh \
    539      1.34  christos 		zdump.8 zdump.c zic.8 zic.c \
    540  1.39.2.1  pgoyette 		ziguard.awk zishrink.awk \
    541      1.34  christos 		zone.tab zone1970.tab zoneinfo2tdf.pl
    542       1.1   mlelstv 
    543       1.1   mlelstv # And for the benefit of csh users on systems that assume the user
    544       1.1   mlelstv # shell should be used to handle commands in Makefiles. . .
    545       1.1   mlelstv 
    546       1.1   mlelstv SHELL=		/bin/sh
    547       1.1   mlelstv 
    548  1.39.2.1  pgoyette all:		tzselect yearistype zic zdump libtz.a $(TABDATA) \
    549  1.39.2.1  pgoyette 		  vanguard.zi main.zi rearguard.zi
    550       1.1   mlelstv 
    551      1.29  christos ALL:		all date $(ENCHILADA)
    552       1.1   mlelstv 
    553      1.16  christos install:	all $(DATA) $(REDO) $(MANS)
    554      1.39  christos 		mkdir -p '$(DESTDIR)$(BINDIR)' \
    555      1.39  christos 			'$(DESTDIR)$(ZDUMPDIR)' '$(DESTDIR)$(ZICDIR)' \
    556      1.39  christos 			'$(DESTDIR)$(LIBDIR)' \
    557      1.39  christos 			'$(DESTDIR)$(MANDIR)/man3' '$(DESTDIR)$(MANDIR)/man5' \
    558      1.39  christos 			'$(DESTDIR)$(MANDIR)/man8'
    559      1.39  christos 		$(ZIC_INSTALL) -l $(LOCALTIME) -p $(POSIXRULES) \
    560      1.39  christos 			-t '$(DESTDIR)$(TZDEFAULT)'
    561      1.39  christos 		cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.'
    562      1.39  christos 		cp tzselect '$(DESTDIR)$(BINDIR)/.'
    563      1.39  christos 		cp zdump '$(DESTDIR)$(ZDUMPDIR)/.'
    564      1.39  christos 		cp zic '$(DESTDIR)$(ZICDIR)/.'
    565      1.39  christos 		cp libtz.a '$(DESTDIR)$(LIBDIR)/.'
    566      1.39  christos 		$(RANLIB) '$(DESTDIR)$(LIBDIR)/libtz.a'
    567      1.39  christos 		cp -f newctime.3 newtzset.3 '$(DESTDIR)$(MANDIR)/man3/.'
    568      1.39  christos 		cp -f tzfile.5 '$(DESTDIR)$(MANDIR)/man5/.'
    569      1.39  christos 		cp -f tzselect.8 zdump.8 zic.8 '$(DESTDIR)$(MANDIR)/man8/.'
    570       1.1   mlelstv 
    571       1.1   mlelstv INSTALL:	ALL install date.1
    572      1.39  christos 		mkdir -p '$(DESTDIR)$(BINDIR)' '$(DESTDIR)$(MANDIR)/man1'
    573      1.39  christos 		cp date '$(DESTDIR)$(BINDIR)/.'
    574      1.39  christos 		cp -f date.1 '$(DESTDIR)$(MANDIR)/man1/.'
    575       1.1   mlelstv 
    576      1.34  christos version:	$(VERSION_DEPS)
    577      1.35  christos 		{ (type git) >/dev/null 2>&1 && \
    578      1.35  christos 		  V=`git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \
    579      1.35  christos 				--abbrev=7 --dirty` || \
    580      1.39  christos 		  V='$(VERSION)'; } && \
    581      1.35  christos 		printf '%s\n' "$$V" >$@.out
    582      1.35  christos 		mv $@.out $@
    583      1.34  christos 
    584  1.39.2.2  pgoyette # These files can be tailored by setting BACKWARD and PACKRATDATA.
    585  1.39.2.1  pgoyette vanguard.zi main.zi rearguard.zi: $(DSTDATA_ZI_DEPS)
    586  1.39.2.1  pgoyette 		$(AWK) -v DATAFORM=`expr $@ : '\(.*\).zi'` -f ziguard.awk \
    587  1.39.2.1  pgoyette 		  $(TDATA) $(PACKRATDATA) >$@.out
    588  1.39.2.1  pgoyette 		mv $@.out $@
    589  1.39.2.2  pgoyette # This file has a version comment that attempts to capture any tailoring
    590  1.39.2.2  pgoyette # via BACKWARD, DATAFORM, PACKRATDATA, and REDO.
    591  1.39.2.2  pgoyette tzdata.zi:	$(DATAFORM).zi version zishrink.awk
    592      1.39  christos 		version=`sed 1q version` && \
    593  1.39.2.2  pgoyette 		  LC_ALL=C $(AWK) \
    594  1.39.2.2  pgoyette 		    -v dataform='$(DATAFORM)' \
    595  1.39.2.2  pgoyette 		    -v deps='$(DSTDATA_ZI_DEPS) zishrink.awk' \
    596  1.39.2.2  pgoyette 		    -v redo='$(REDO)' \
    597  1.39.2.2  pgoyette 		    -v version="$$version" \
    598  1.39.2.2  pgoyette 		    -f zishrink.awk \
    599  1.39.2.1  pgoyette 		    $(DATAFORM).zi >$@.out
    600      1.38  christos 		mv $@.out $@
    601      1.38  christos 
    602      1.34  christos version.h:	version
    603      1.35  christos 		VERSION=`cat version` && printf '%s\n' \
    604      1.35  christos 		  'static char const PKGVERSION[]="($(PACKAGE)) ";' \
    605      1.35  christos 		  "static char const TZVERSION[]=\"$$VERSION\";" \
    606      1.35  christos 		  'static char const REPORT_BUGS_TO[]="$(BUGEMAIL)";' \
    607      1.35  christos 		  >$@.out
    608      1.35  christos 		mv $@.out $@
    609       1.6  christos 
    610       1.1   mlelstv zdump:		$(TZDOBJS)
    611       1.9  christos 		$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS)
    612       1.1   mlelstv 
    613      1.32  christos zic:		$(TZCOBJS)
    614       1.9  christos 		$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS)
    615       1.1   mlelstv 
    616       1.1   mlelstv yearistype:	yearistype.sh
    617       1.1   mlelstv 		cp yearistype.sh yearistype
    618       1.1   mlelstv 		chmod +x yearistype
    619       1.1   mlelstv 
    620      1.16  christos leapseconds:	$(LEAP_DEPS)
    621      1.35  christos 		$(AWK) -f leapseconds.awk leap-seconds.list >$@.out
    622      1.35  christos 		mv $@.out $@
    623      1.15  christos 
    624      1.32  christos # Arguments to pass to submakes of install_data.
    625      1.32  christos # They can be overridden by later submake arguments.
    626      1.32  christos INSTALLARGS = \
    627      1.39  christos  BACKWARD='$(BACKWARD)' \
    628      1.39  christos  DESTDIR='$(DESTDIR)' \
    629      1.32  christos  LEAPSECONDS='$(LEAPSECONDS)' \
    630      1.32  christos  PACKRATDATA='$(PACKRATDATA)' \
    631      1.39  christos  TZDEFAULT='$(TZDEFAULT)' \
    632      1.39  christos  TZDIR='$(TZDIR)' \
    633      1.39  christos  YEARISTYPE='$(YEARISTYPE)' \
    634      1.32  christos  ZIC='$(ZIC)'
    635      1.32  christos 
    636  1.39.2.2  pgoyette INSTALL_DATA_DEPS = zic leapseconds yearistype tzdata.zi
    637  1.39.2.2  pgoyette 
    638  1.39.2.2  pgoyette # 'make install_data' installs one set of TZif files.
    639  1.39.2.2  pgoyette install_data: $(INSTALL_DATA_DEPS)
    640      1.38  christos 		$(ZIC_INSTALL) tzdata.zi
    641      1.32  christos 
    642  1.39.2.2  pgoyette posix_only: $(INSTALL_DATA_DEPS)
    643      1.32  christos 		$(MAKE) $(INSTALLARGS) LEAPSECONDS= install_data
    644      1.32  christos 
    645  1.39.2.2  pgoyette right_only: $(INSTALL_DATA_DEPS)
    646      1.32  christos 		$(MAKE) $(INSTALLARGS) LEAPSECONDS='-L leapseconds' \
    647      1.32  christos 			install_data
    648       1.1   mlelstv 
    649       1.1   mlelstv # In earlier versions of this makefile, the other two directories were
    650       1.1   mlelstv # subdirectories of $(TZDIR).  However, this led to configuration errors.
    651       1.1   mlelstv # For example, with posix_right under the earlier scheme,
    652       1.1   mlelstv # TZ='right/Australia/Adelaide' got you localtime with leap seconds,
    653       1.1   mlelstv # but gmtime without leap seconds, which led to problems with applications
    654       1.1   mlelstv # like sendmail that subtract gmtime from localtime.
    655       1.1   mlelstv # Therefore, the other two directories are now siblings of $(TZDIR).
    656       1.1   mlelstv # You must replace all of $(TZDIR) to switch from not using leap seconds
    657       1.1   mlelstv # to using them, or vice versa.
    658      1.32  christos right_posix:	right_only
    659      1.39  christos 		rm -fr '$(DESTDIR)$(TZDIR)-leaps'
    660      1.39  christos 		ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-leaps' || \
    661      1.39  christos 		  $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only
    662      1.39  christos 		$(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only
    663      1.15  christos 
    664      1.32  christos posix_right:	posix_only
    665      1.39  christos 		rm -fr '$(DESTDIR)$(TZDIR)-posix'
    666      1.39  christos 		ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-posix' || \
    667      1.39  christos 		  $(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only
    668      1.39  christos 		$(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only
    669      1.32  christos 
    670      1.32  christos # This obsolescent rule is present for backwards compatibility with
    671      1.32  christos # tz releases 2014g through 2015g.  It should go away eventually.
    672  1.39.2.2  pgoyette posix_packrat: $(INSTALL_DATA_DEPS)
    673      1.32  christos 		$(MAKE) $(INSTALLARGS) PACKRATDATA=backzone posix_only
    674      1.23  christos 
    675       1.1   mlelstv zones:		$(REDO)
    676       1.1   mlelstv 
    677  1.39.2.1  pgoyette # dummy.zd is not a real file; it is mentioned here only so that the
    678  1.39.2.1  pgoyette # top-level 'make' does not have a syntax error.
    679  1.39.2.1  pgoyette ZDS = dummy.zd
    680  1.39.2.1  pgoyette # Rule used only by submakes invoked by the $(TZS_NEW) rule.
    681  1.39.2.1  pgoyette # It is separate so that GNU 'make -j' can run instances in parallel.
    682  1.39.2.1  pgoyette $(ZDS): zdump
    683  1.39.2.2  pgoyette 		./zdump -i $(TZS_CUTOFF_FLAG) '$(wd)/'$$(expr $@ : '\(.*\).zd') \
    684  1.39.2.2  pgoyette 		  >$@
    685  1.39.2.1  pgoyette 
    686  1.39.2.2  pgoyette TZS_NEW_DEPS = tzdata.zi zdump zic
    687  1.39.2.2  pgoyette $(TZS_NEW): $(TZS_NEW_DEPS)
    688  1.39.2.2  pgoyette 		rm -fr tzs$(TZS_YEAR).dir
    689  1.39.2.2  pgoyette 		mkdir tzs$(TZS_YEAR).dir
    690  1.39.2.2  pgoyette 		$(zic) -d tzs$(TZS_YEAR).dir tzdata.zi
    691      1.38  christos 		$(AWK) '/^L/{print "Link\t" $$2 "\t" $$3}' \
    692      1.38  christos 		   tzdata.zi | LC_ALL=C sort >$@.out
    693      1.35  christos 		wd=`pwd` && \
    694  1.39.2.2  pgoyette 		x=`$(AWK) '/^Z/{print "tzs$(TZS_YEAR).dir/" $$2 ".zd"}' \
    695  1.39.2.2  pgoyette 				tzdata.zi \
    696  1.39.2.1  pgoyette 			| LC_ALL=C sort -t . -k 2,2` && \
    697  1.39.2.2  pgoyette 		set x $$x && \
    698  1.39.2.1  pgoyette 		shift && \
    699  1.39.2.1  pgoyette 		ZDS=$$* && \
    700  1.39.2.2  pgoyette 		$(MAKE) wd="$$wd" TZS_CUTOFF_FLAG="$(TZS_CUTOFF_FLAG)" \
    701  1.39.2.2  pgoyette 		  ZDS="$$ZDS" $$ZDS && \
    702  1.39.2.2  pgoyette 		sed 's,^TZ=".*\.dir/,TZ=",' $$ZDS >>$@.out
    703  1.39.2.2  pgoyette 		rm -fr tzs$(TZS_YEAR).dir
    704  1.39.2.1  pgoyette 		mv $@.out $@
    705      1.34  christos 
    706  1.39.2.2  pgoyette # If $(TZS) exists but 'make check_tzs' fails, a maintainer should inspect the
    707      1.34  christos # failed output and fix the inconsistency, perhaps by running 'make force_tzs'.
    708      1.34  christos $(TZS):
    709  1.39.2.2  pgoyette 		touch $@
    710      1.34  christos 
    711      1.34  christos force_tzs:	$(TZS_NEW)
    712      1.34  christos 		cp $(TZS_NEW) $(TZS)
    713      1.34  christos 
    714      1.16  christos libtz.a:	$(LIBOBJS)
    715      1.37  christos 		rm -f $@
    716      1.37  christos 		$(AR) -rc $@ $(LIBOBJS)
    717      1.16  christos 		$(RANLIB) $@
    718       1.1   mlelstv 
    719       1.1   mlelstv date:		$(DATEOBJS)
    720       1.9  christos 		$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS)
    721       1.1   mlelstv 
    722      1.34  christos tzselect:	tzselect.ksh version
    723      1.35  christos 		VERSION=`cat version` && sed \
    724       1.9  christos 			-e 's|#!/bin/bash|#!$(KSHELL)|g' \
    725       1.1   mlelstv 			-e 's|AWK=[^}]*|AWK=$(AWK)|g' \
    726       1.9  christos 			-e 's|\(PKGVERSION\)=.*|\1='\''($(PACKAGE)) '\''|' \
    727       1.9  christos 			-e 's|\(REPORT_BUGS_TO\)=.*|\1=$(BUGEMAIL)|' \
    728       1.1   mlelstv 			-e 's|TZDIR=[^}]*|TZDIR=$(TZDIR)|' \
    729      1.35  christos 			-e 's|\(TZVERSION\)=.*|\1='"$$VERSION"'|' \
    730      1.35  christos 			<$@.ksh >$@.out
    731      1.35  christos 		chmod +x $@.out
    732      1.35  christos 		mv $@.out $@
    733       1.1   mlelstv 
    734      1.38  christos check:		check_character_set check_white_space check_links \
    735      1.38  christos 		  check_name_lengths check_sorted \
    736      1.38  christos 		  check_tables check_web check_zishrink check_tzs
    737       1.9  christos 
    738       1.9  christos check_character_set: $(ENCHILADA)
    739      1.38  christos 	test ! '$(UTF8_LOCALE)' || \
    740      1.38  christos 	! printf 'A\304\200B\n' | \
    741      1.38  christos 	  LC_ALL='$(UTF8_LOCALE)' grep -q '^A.B$$' >/dev/null 2>&1 || { \
    742      1.38  christos 		LC_ALL='$(UTF8_LOCALE)' && export LC_ALL && \
    743      1.22  christos 		sharp='#' && \
    744      1.35  christos 		! grep -Env $(SAFE_LINE) $(MANS) date.1 $(MANTXTS) \
    745      1.35  christos 			$(MISC) $(SOURCES) $(WEB_PAGES) \
    746  1.39.2.1  pgoyette 			CONTRIBUTING LICENSE README \
    747      1.38  christos 			version tzdata.zi && \
    748  1.39.2.2  pgoyette 		! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_'$(OK_CHAR)'*$$' \
    749  1.39.2.1  pgoyette 			Makefile && \
    750      1.39  christos 		! grep -Env $(SAFE_SHARP_LINE) $(TDATA_TO_CHECK) backzone \
    751      1.29  christos 			leapseconds yearistype.sh zone.tab && \
    752      1.38  christos 		! grep -Env $(OK_LINE) $(ENCHILADA); \
    753      1.38  christos 	}
    754  1.39.2.2  pgoyette 	touch $@
    755      1.22  christos 
    756      1.23  christos check_white_space: $(ENCHILADA)
    757      1.35  christos 		patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \
    758  1.39.2.2  pgoyette 		! grep -En "$$pat" \
    759  1.39.2.2  pgoyette 			$$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list)
    760      1.39  christos 		! grep -n '[[:space:]]$$' \
    761      1.39  christos 			$$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list)
    762  1.39.2.2  pgoyette 		touch $@
    763      1.23  christos 
    764      1.38  christos PRECEDES_FILE_NAME = ^(Zone|Link[[:space:]]+[^[:space:]]+)[[:space:]]+
    765      1.38  christos FILE_NAME_COMPONENT_TOO_LONG = \
    766      1.38  christos   $(PRECEDES_FILE_NAME)[^[:space:]]*[^/[:space:]]{15}
    767      1.38  christos 
    768      1.39  christos check_name_lengths: $(TDATA_TO_CHECK) backzone
    769      1.39  christos 		! grep -En '$(FILE_NAME_COMPONENT_TOO_LONG)' \
    770      1.39  christos 			$(TDATA_TO_CHECK) backzone
    771  1.39.2.2  pgoyette 		touch $@
    772      1.38  christos 
    773      1.23  christos CHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; }
    774      1.23  christos 
    775      1.23  christos check_sorted: backward backzone iso3166.tab zone.tab zone1970.tab
    776      1.23  christos 		$(AWK) '/^Link/ {print $$3}' backward | LC_ALL=C sort -cu
    777      1.23  christos 		$(AWK) '/^Zone/ {print $$2}' backzone | LC_ALL=C sort -cu
    778      1.23  christos 		$(AWK) '/^[^#]/ {print $$1}' iso3166.tab | LC_ALL=C sort -cu
    779      1.23  christos 		$(AWK) '/^[^#]/ {print $$1}' zone.tab | LC_ALL=C sort -c
    780      1.23  christos 		$(AWK) '/^[^#]/ {print substr($$0, 1, 2)}' zone1970.tab | \
    781      1.23  christos 		  LC_ALL=C sort -c
    782      1.23  christos 		$(AWK) '/^[^#]/ $(CHECK_CC_LIST)' zone1970.tab | \
    783      1.23  christos 		  LC_ALL=C sort -cu
    784  1.39.2.2  pgoyette 		touch $@
    785      1.23  christos 
    786  1.39.2.1  pgoyette check_links:	checklinks.awk $(TDATA_TO_CHECK) tzdata.zi
    787      1.39  christos 		$(AWK) -f checklinks.awk $(TDATA_TO_CHECK)
    788      1.38  christos 		$(AWK) -f checklinks.awk tzdata.zi
    789  1.39.2.2  pgoyette 		touch $@
    790      1.26  christos 
    791      1.22  christos check_tables:	checktab.awk $(PRIMARY_YDATA) $(ZONETABLES)
    792      1.22  christos 		for tab in $(ZONETABLES); do \
    793      1.22  christos 		  $(AWK) -f checktab.awk -v zone_table=$$tab $(PRIMARY_YDATA) \
    794      1.22  christos 		    || exit; \
    795      1.22  christos 		done
    796  1.39.2.2  pgoyette 		touch $@
    797       1.1   mlelstv 
    798      1.34  christos check_tzs:	$(TZS) $(TZS_NEW)
    799  1.39.2.2  pgoyette 		if test -s $(TZS); then \
    800  1.39.2.2  pgoyette 		  diff -u $(TZS) $(TZS_NEW); \
    801  1.39.2.2  pgoyette 		else \
    802  1.39.2.2  pgoyette 		  cp $(TZS_NEW) $(TZS); \
    803  1.39.2.2  pgoyette 		fi
    804  1.39.2.2  pgoyette 		touch $@
    805      1.34  christos 
    806  1.39.2.3  pgoyette check_web:	$(CHECK_WEB_PAGES)
    807  1.39.2.3  pgoyette check_tz-art.html: tz-art.html
    808  1.39.2.3  pgoyette check_tz-link.html: tz-link.html
    809  1.39.2.3  pgoyette check_tz-art.html check_tz-link.html:
    810  1.39.2.3  pgoyette 		$(CURL) -sS --url https://validator.w3.org/nu/ -F out=gnu \
    811  1.39.2.3  pgoyette 		    -F file=@$$(expr $@ : 'check_\(.*\)') -o $@.out && \
    812  1.39.2.3  pgoyette 		  test ! -s $@.out || { cat $@.out; exit 1; }
    813  1.39.2.3  pgoyette 		mv $@.out $@
    814  1.39.2.3  pgoyette check_tz-how-to.html: tz-how-to.html
    815      1.38  christos 		$(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) tz-how-to.html
    816  1.39.2.2  pgoyette 		touch $@
    817      1.38  christos 
    818  1.39.2.1  pgoyette # Check that zishrink.awk does not alter the data, and that ziguard.awk
    819  1.39.2.1  pgoyette # preserves main-format data.
    820  1.39.2.2  pgoyette check_zishrink: check_zishrink_posix check_zishrink_right
    821  1.39.2.2  pgoyette check_zishrink_posix check_zishrink_right: \
    822  1.39.2.2  pgoyette   zic leapseconds $(PACKRATDATA) $(TDATA) $(DATAFORM).zi tzdata.zi
    823  1.39.2.2  pgoyette 		rm -fr $@.dir $@-t.dir $@-shrunk.dir
    824  1.39.2.2  pgoyette 		mkdir $@.dir $@-t.dir $@-shrunk.dir
    825  1.39.2.2  pgoyette 		case $@ in \
    826  1.39.2.2  pgoyette 		  *_right) leap='-L leapseconds';; \
    827  1.39.2.2  pgoyette 		  *) leap=;; \
    828  1.39.2.2  pgoyette 		esac && \
    829  1.39.2.2  pgoyette 		  $(ZIC) $$leap -d $@.dir $(DATAFORM).zi && \
    830  1.39.2.2  pgoyette 		  $(ZIC) $$leap -d $@-shrunk.dir tzdata.zi && \
    831  1.39.2.1  pgoyette 		  case $(DATAFORM) in \
    832  1.39.2.1  pgoyette 		    main) \
    833  1.39.2.2  pgoyette 		      $(ZIC) $$leap -d $@-t.dir $(TDATA) && \
    834  1.39.2.1  pgoyette 		      $(AWK) '/^Rule/' $(TDATA) | \
    835  1.39.2.2  pgoyette 			$(ZIC) $$leap -d $@-t.dir - $(PACKRATDATA) && \
    836  1.39.2.2  pgoyette 		      diff -r $@.dir $@-t.dir;; \
    837  1.39.2.2  pgoyette 		  esac
    838  1.39.2.2  pgoyette 		diff -r $@.dir $@-shrunk.dir
    839  1.39.2.2  pgoyette 		rm -fr $@.dir $@-t.dir $@-shrunk.dir
    840  1.39.2.2  pgoyette 		touch $@
    841       1.1   mlelstv 
    842      1.14  christos clean_misc:
    843  1.39.2.2  pgoyette 		rm -f *.o *.out $(TIME_T_ALTERNATIVES) \
    844  1.39.2.2  pgoyette 		  check_* core typecheck_* \
    845      1.18  christos 		  date tzselect version.h zdump zic yearistype libtz.a
    846      1.14  christos clean:		clean_misc
    847  1.39.2.1  pgoyette 		rm -fr *.dir *.zi tzdb-*/ $(TZS_NEW)
    848       1.1   mlelstv 
    849       1.1   mlelstv maintainer-clean: clean
    850       1.1   mlelstv 		@echo 'This command is intended for maintainers to use; it'
    851       1.1   mlelstv 		@echo 'deletes files that may need special tools to rebuild.'
    852      1.34  christos 		rm -f leapseconds version $(MANTXTS) $(TZS) *.asc *.tar.*
    853       1.1   mlelstv 
    854       1.1   mlelstv names:
    855       1.1   mlelstv 		@echo $(ENCHILADA)
    856       1.1   mlelstv 
    857      1.23  christos public:		check check_public $(CHECK_TIME_T_ALTERNATIVES) \
    858      1.16  christos 		tarballs signatures
    859      1.16  christos 
    860      1.16  christos date.1.txt:	date.1
    861      1.16  christos newctime.3.txt:	newctime.3
    862      1.16  christos newstrftime.3.txt: newstrftime.3
    863      1.16  christos newtzset.3.txt:	newtzset.3
    864      1.16  christos time2posix.3.txt: time2posix.3
    865      1.16  christos tzfile.5.txt:	tzfile.5
    866      1.16  christos tzselect.8.txt:	tzselect.8
    867      1.16  christos zdump.8.txt:	zdump.8
    868      1.16  christos zic.8.txt:	zic.8
    869      1.16  christos 
    870      1.16  christos $(MANTXTS):	workman.sh
    871      1.35  christos 		LC_ALL=C sh workman.sh `expr $@ : '\(.*\)\.txt$$'` >$@.out
    872      1.35  christos 		mv $@.out $@
    873       1.9  christos 
    874  1.39.2.2  pgoyette # Set the timestamps to those of the git repository, if available,
    875       1.6  christos # and if the files have not changed since then.
    876       1.6  christos # This uses GNU 'touch' syntax 'touch -d@N FILE',
    877       1.6  christos # where N is the number of seconds since 1970.
    878      1.16  christos # If git or GNU 'touch' is absent, don't bother to sync with git timestamps.
    879      1.16  christos # Also, set the timestamp of each prebuilt file like 'leapseconds'
    880      1.16  christos # to be the maximum of the files it depends on.
    881  1.39.2.2  pgoyette set-timestamps.out: $(EIGHT_YARDS)
    882      1.16  christos 		rm -f $@
    883      1.35  christos 		if (type git) >/dev/null 2>&1 && \
    884  1.39.2.2  pgoyette 		   files=`git ls-files $(EIGHT_YARDS)` && \
    885      1.16  christos 		   touch -md @1 test.out; then \
    886      1.16  christos 		  rm -f test.out && \
    887      1.16  christos 		  for file in $$files; do \
    888      1.16  christos 		    if git diff --quiet $$file; then \
    889      1.16  christos 		      time=`git log -1 --format='tformat:%ct' $$file` && \
    890      1.16  christos 		      touch -cmd @$$time $$file; \
    891      1.16  christos 		    else \
    892      1.16  christos 		      echo >&2 "$$file: warning: does not match repository"; \
    893      1.16  christos 		    fi || exit; \
    894      1.16  christos 		  done; \
    895      1.16  christos 		fi
    896      1.16  christos 		touch -cmr `ls -t $(LEAP_DEPS) | sed 1q` leapseconds
    897      1.16  christos 		for file in `ls $(MANTXTS) | sed 's/\.txt$$//'`; do \
    898      1.16  christos 		  touch -cmr `ls -t $$file workman.sh | sed 1q` $$file.txt || \
    899      1.16  christos 		    exit; \
    900       1.6  christos 		done
    901      1.38  christos 		touch -cmr `ls -t $(TZDATA_ZI_DEPS) | sed 1q` tzdata.zi
    902      1.35  christos 		touch -cmr `ls -t $(VERSION_DEPS) | sed 1q` version
    903      1.16  christos 		touch $@
    904  1.39.2.2  pgoyette set-tzs-timestamp.out: $(TZS)
    905  1.39.2.2  pgoyette 		touch -cmr `ls -t $(TZS_DEPS) | sed 1q` $(TZS)
    906  1.39.2.2  pgoyette 		touch $@
    907       1.6  christos 
    908       1.1   mlelstv # The zics below ensure that each data file can stand on its own.
    909       1.1   mlelstv # We also do an all-files run to catch links to links.
    910       1.1   mlelstv 
    911  1.39.2.2  pgoyette check_public: $(VERSION_DEPS)
    912  1.39.2.2  pgoyette 		rm -fr public.dir
    913  1.39.2.2  pgoyette 		mkdir public.dir
    914  1.39.2.2  pgoyette 		ln $(VERSION_DEPS) public.dir
    915  1.39.2.2  pgoyette 		cd public.dir && $(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' ALL
    916  1.39.2.2  pgoyette 		for i in $(TDATA_TO_CHECK) public.dir/tzdata.zi; do \
    917  1.39.2.2  pgoyette 		  public.dir/zic -v -d public.dir/zoneinfo $$i 2>&1 || exit; \
    918       1.9  christos 		done
    919  1.39.2.2  pgoyette 		public.dir/zic -v -d public.dir/zoneinfo-all $(TDATA_TO_CHECK)
    920      1.34  christos 		rm -fr public.dir
    921  1.39.2.2  pgoyette 		touch $@
    922       1.9  christos 
    923      1.14  christos # Check that the code works under various alternative
    924      1.14  christos # implementations of time_t.
    925  1.39.2.2  pgoyette check_time_t_alternatives: $(TIME_T_ALTERNATIVES)
    926  1.39.2.2  pgoyette $(TIME_T_ALTERNATIVES_TAIL): $(TIME_T_ALTERNATIVES_HEAD)
    927  1.39.2.2  pgoyette $(TIME_T_ALTERNATIVES): $(VERSION_DEPS)
    928  1.39.2.2  pgoyette 		rm -fr $@.dir
    929  1.39.2.2  pgoyette 		mkdir $@.dir
    930  1.39.2.2  pgoyette 		ln $(VERSION_DEPS) $@.dir
    931  1.39.2.2  pgoyette 		case $@ in \
    932  1.39.2.2  pgoyette 		  int32_t) range=-2147483648,2147483648;; \
    933  1.39.2.2  pgoyette 		  u*) range=0,4294967296;; \
    934  1.39.2.2  pgoyette 		  *) range=-4294967296,4294967296;; \
    935  1.39.2.2  pgoyette 		esac && \
    936      1.35  christos 		wd=`pwd` && \
    937      1.22  christos 		zones=`$(AWK) '/^[^#]/ { print $$3 }' <zone1970.tab` && \
    938  1.39.2.2  pgoyette 		if test $@ = $(TIME_T_ALTERNATIVES_HEAD); then \
    939  1.39.2.2  pgoyette 		  range_target=; \
    940  1.39.2.2  pgoyette 		else \
    941  1.39.2.2  pgoyette 		  range_target=to$$range.tzs; \
    942  1.39.2.2  pgoyette 		fi && \
    943  1.39.2.2  pgoyette 		(cd $@.dir && \
    944  1.39.2.2  pgoyette 		  $(MAKE) TOPDIR="$$wd/$@.dir" \
    945  1.39.2.2  pgoyette 		    CFLAGS='$(CFLAGS) -Dtime_tz='"'$@'" \
    946      1.23  christos 		    REDO='$(REDO)' \
    947  1.39.2.2  pgoyette 			D=$$wd/$@.dir \
    948  1.39.2.2  pgoyette 		    TZS_YEAR="$$range" TZS_CUTOFF_FLAG="-t $$range" \
    949  1.39.2.2  pgoyette 		    install $$range_target) && \
    950  1.39.2.2  pgoyette 		test $@ = $(TIME_T_ALTERNATIVES_HEAD) || { \
    951  1.39.2.2  pgoyette 		  (cd $(TIME_T_ALTERNATIVES_HEAD).dir && \
    952  1.39.2.2  pgoyette 		    $(MAKE) TOPDIR="$$wd/$@.dir" \
    953  1.39.2.2  pgoyette 		      TZS_YEAR="$$range" TZS_CUTOFF_FLAG="-t $$range" \
    954  1.39.2.2  pgoyette 			D=$$wd/$@.dir \
    955  1.39.2.2  pgoyette 		      to$$range.tzs) && \
    956  1.39.2.2  pgoyette 		  diff -u $(TIME_T_ALTERNATIVES_HEAD).dir/to$$range.tzs \
    957  1.39.2.2  pgoyette 			  $@.dir/to$$range.tzs && \
    958  1.39.2.2  pgoyette 		  if diff -q Makefile Makefile 2>/dev/null; then \
    959  1.39.2.2  pgoyette 		    quiet_option='-q'; \
    960  1.39.2.2  pgoyette 		  else \
    961  1.39.2.2  pgoyette 		    quiet_option=''; \
    962  1.39.2.2  pgoyette 		  fi && \
    963  1.39.2.2  pgoyette 		    diff $$quiet_option -r $(TIME_T_ALTERNATIVES_HEAD).dir/etc \
    964  1.39.2.2  pgoyette 					   $@.dir/etc && \
    965  1.39.2.2  pgoyette 		    diff $$quiet_option -r \
    966  1.39.2.2  pgoyette 		      $(TIME_T_ALTERNATIVES_HEAD).dir/usr/share \
    967  1.39.2.2  pgoyette 		      $@.dir/usr/share; \
    968  1.39.2.2  pgoyette 		}
    969  1.39.2.2  pgoyette 		touch $@
    970      1.34  christos 
    971  1.39.2.1  pgoyette TRADITIONAL_ASC = \
    972  1.39.2.1  pgoyette   tzcode$(VERSION).tar.gz.asc \
    973  1.39.2.1  pgoyette   tzdata$(VERSION).tar.gz.asc
    974  1.39.2.2  pgoyette REARGUARD_ASC = \
    975  1.39.2.2  pgoyette   tzdata$(VERSION)-rearguard.tar.gz.asc
    976  1.39.2.2  pgoyette ALL_ASC = $(TRADITIONAL_ASC) $(REARGUARD_ASC) \
    977  1.39.2.1  pgoyette   tzdb-$(VERSION).tar.lz.asc
    978  1.39.2.1  pgoyette 
    979  1.39.2.2  pgoyette tarballs rearguard_tarballs traditional_tarballs \
    980  1.39.2.2  pgoyette signatures rearguard_signatures traditional_signatures: \
    981  1.39.2.2  pgoyette   version set-timestamps.out rearguard.zi
    982      1.35  christos 		VERSION=`cat version` && \
    983      1.35  christos 		$(MAKE) VERSION="$$VERSION" $@_version
    984      1.35  christos 
    985  1.39.2.1  pgoyette # These *_version rules are intended for use if VERSION is set by some
    986  1.39.2.1  pgoyette # other means.  Ordinarily these rules are used only by the above
    987  1.39.2.1  pgoyette # non-_version rules, which set VERSION on the 'make' command line.
    988  1.39.2.2  pgoyette tarballs_version: traditional_tarballs_version rearguard_tarballs_version \
    989  1.39.2.1  pgoyette   tzdb-$(VERSION).tar.lz
    990  1.39.2.2  pgoyette rearguard_tarballs_version: \
    991  1.39.2.2  pgoyette   tzdata$(VERSION)-rearguard.tar.gz
    992      1.38  christos traditional_tarballs_version: \
    993      1.38  christos   tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz
    994  1.39.2.1  pgoyette signatures_version: $(ALL_ASC)
    995  1.39.2.2  pgoyette rearguard_signatures_version: $(REARGUARD_ASC)
    996  1.39.2.1  pgoyette traditional_signatures_version: $(TRADITIONAL_ASC)
    997       1.9  christos 
    998      1.16  christos tzcode$(VERSION).tar.gz: set-timestamps.out
    999       1.6  christos 		LC_ALL=C && export LC_ALL && \
   1000       1.7  christos 		tar $(TARFLAGS) -cf - \
   1001      1.23  christos 		    $(COMMON) $(DOCS) $(SOURCES) | \
   1002      1.38  christos 		  gzip $(GZIPFLAGS) >$@.out
   1003      1.35  christos 		mv $@.out $@
   1004      1.10  christos 
   1005      1.16  christos tzdata$(VERSION).tar.gz: set-timestamps.out
   1006       1.6  christos 		LC_ALL=C && export LC_ALL && \
   1007      1.23  christos 		tar $(TARFLAGS) -cf - $(COMMON) $(DATA) $(MISC) | \
   1008      1.38  christos 		  gzip $(GZIPFLAGS) >$@.out
   1009      1.35  christos 		mv $@.out $@
   1010       1.9  christos 
   1011  1.39.2.1  pgoyette tzdata$(VERSION)-rearguard.tar.gz: rearguard.zi set-timestamps.out
   1012  1.39.2.1  pgoyette 		rm -fr tzdata$(VERSION)-rearguard.dir
   1013  1.39.2.1  pgoyette 		mkdir tzdata$(VERSION)-rearguard.dir
   1014  1.39.2.1  pgoyette 		ln $(COMMON) $(DATA) $(MISC) tzdata$(VERSION)-rearguard.dir
   1015  1.39.2.1  pgoyette 		cd tzdata$(VERSION)-rearguard.dir && \
   1016  1.39.2.1  pgoyette 		  rm -f $(TDATA) $(PACKRATDATA) version
   1017  1.39.2.1  pgoyette 		for f in $(TDATA) $(PACKRATDATA); do \
   1018  1.39.2.1  pgoyette 		  rearf=tzdata$(VERSION)-rearguard.dir/$$f; \
   1019  1.39.2.1  pgoyette 		  $(AWK) -v DATAFORM=rearguard -f ziguard.awk $$f >$$rearf && \
   1020  1.39.2.1  pgoyette 		  touch -cmr `ls -t ziguard.awk $$f` $$rearf || exit; \
   1021  1.39.2.1  pgoyette 		done
   1022  1.39.2.1  pgoyette 		sed '1s/$$/-rearguard/' \
   1023  1.39.2.1  pgoyette 		  <version >tzdata$(VERSION)-rearguard.dir/version
   1024  1.39.2.1  pgoyette 		touch -cmr version tzdata$(VERSION)-rearguard.dir/version
   1025  1.39.2.1  pgoyette 		LC_ALL=C && export LC_ALL && \
   1026  1.39.2.1  pgoyette 		  (cd tzdata$(VERSION)-rearguard.dir && \
   1027  1.39.2.1  pgoyette 		   tar $(TARFLAGS) -cf - $(COMMON) $(DATA) $(MISC) | \
   1028  1.39.2.1  pgoyette 		     gzip $(GZIPFLAGS)) >$@.out
   1029  1.39.2.1  pgoyette 		mv $@.out $@
   1030  1.39.2.1  pgoyette 
   1031  1.39.2.2  pgoyette tzdb-$(VERSION).tar.lz: set-timestamps.out set-tzs-timestamp.out
   1032      1.34  christos 		rm -fr tzdb-$(VERSION)
   1033      1.34  christos 		mkdir tzdb-$(VERSION)
   1034      1.34  christos 		ln $(ENCHILADA) tzdb-$(VERSION)
   1035      1.35  christos 		touch -cmr `ls -t tzdb-$(VERSION)/* | sed 1q` tzdb-$(VERSION)
   1036      1.34  christos 		LC_ALL=C && export LC_ALL && \
   1037      1.35  christos 		tar $(TARFLAGS) -cf - tzdb-$(VERSION) | lzip -9 >$@.out
   1038      1.35  christos 		mv $@.out $@
   1039       1.9  christos 
   1040       1.9  christos tzcode$(VERSION).tar.gz.asc: tzcode$(VERSION).tar.gz
   1041       1.9  christos tzdata$(VERSION).tar.gz.asc: tzdata$(VERSION).tar.gz
   1042  1.39.2.1  pgoyette tzdata$(VERSION)-rearguard.tar.gz.asc: tzdata$(VERSION)-rearguard.tar.gz
   1043      1.34  christos tzdb-$(VERSION).tar.lz.asc: tzdb-$(VERSION).tar.lz
   1044  1.39.2.1  pgoyette $(ALL_ASC):
   1045  1.39.2.2  pgoyette 		gpg2 --armor --detach-sign $?
   1046      1.34  christos 
   1047  1.39.2.2  pgoyette TYPECHECK_CFLAGS = $(CFLAGS) -DTYPECHECK -D__time_t_defined -D_TIME_T
   1048  1.39.2.2  pgoyette typecheck: typecheck_long_long typecheck_unsigned
   1049  1.39.2.2  pgoyette typecheck_long_long typecheck_unsigned: $(VERSION_DEPS)
   1050  1.39.2.2  pgoyette 		rm -fr $@.dir
   1051  1.39.2.2  pgoyette 		mkdir $@.dir
   1052  1.39.2.2  pgoyette 		ln $(VERSION_DEPS) $@.dir
   1053  1.39.2.2  pgoyette 		cd $@.dir && \
   1054  1.39.2.2  pgoyette 		  case $@ in \
   1055  1.39.2.2  pgoyette 		    *_long_long) i="long long";; \
   1056  1.39.2.2  pgoyette 		    *_unsigned ) i="unsigned" ;; \
   1057  1.39.2.2  pgoyette 		  esac && \
   1058  1.39.2.2  pgoyette 		  typecheck_cflags='' && \
   1059  1.39.2.2  pgoyette 		  $(MAKE) \
   1060  1.39.2.2  pgoyette 		    CFLAGS="$(TYPECHECK_CFLAGS) \"-Dtime_t=$$i\"" \
   1061  1.39.2.2  pgoyette 		    TOPDIR="`pwd`" \
   1062  1.39.2.2  pgoyette 		    install
   1063  1.39.2.2  pgoyette 		$@.dir/zdump -i -c 1970,1971 Europe/Rome
   1064  1.39.2.2  pgoyette 		touch $@
   1065       1.1   mlelstv 
   1066      1.38  christos zonenames:	tzdata.zi
   1067      1.38  christos 		@$(AWK) '/^Z/ { print $$2 } /^L/ { print $$3 }' tzdata.zi
   1068       1.1   mlelstv 
   1069       1.1   mlelstv asctime.o:	private.h tzfile.h
   1070       1.1   mlelstv date.o:		private.h
   1071       1.1   mlelstv difftime.o:	private.h
   1072       1.1   mlelstv localtime.o:	private.h tzfile.h
   1073      1.23  christos strftime.o:	private.h tzfile.h
   1074       1.6  christos zdump.o:	version.h
   1075       1.6  christos zic.o:		private.h tzfile.h version.h
   1076       1.1   mlelstv 
   1077       1.1   mlelstv .KEEP_STATE:
   1078      1.22  christos 
   1079      1.22  christos .PHONY: ALL INSTALL all
   1080  1.39.2.2  pgoyette .PHONY: check check_time_t_alternatives
   1081  1.39.2.3  pgoyette .PHONY: check_web check_zishrink
   1082  1.39.2.1  pgoyette .PHONY: clean clean_misc dummy.zd force_tzs
   1083      1.32  christos .PHONY: install install_data maintainer-clean names
   1084  1.39.2.2  pgoyette .PHONY: posix_only posix_packrat posix_right public
   1085  1.39.2.2  pgoyette .PHONY: rearguard_signatures rearguard_signatures_version
   1086  1.39.2.2  pgoyette .PHONY: rearguard_tarballs rearguard_tarballs_version
   1087  1.39.2.2  pgoyette .PHONY: right_only right_posix signatures signatures_version
   1088  1.39.2.1  pgoyette .PHONY: tarballs tarballs_version
   1089  1.39.2.1  pgoyette .PHONY: traditional_signatures traditional_signatures_version
   1090  1.39.2.1  pgoyette .PHONY: traditional_tarballs traditional_tarballs_version
   1091  1.39.2.1  pgoyette .PHONY: typecheck
   1092      1.22  christos .PHONY: zonenames zones
   1093  1.39.2.1  pgoyette .PHONY: $(ZDS)
   1094