[BACK]Return to Makefile CVS log [TXT][DIR] Up to [local] / src / share / zoneinfo

Annotation of src/share/zoneinfo/Makefile, Revision 1.16

1.16    ! millert     1: #      $OpenBSD: Makefile,v 1.15 2020/10/07 22:33:31 millert Exp $
1.1       deraadt     2:
1.16    ! millert     3: # DATAFORM selects the data format.  OpenBSD always uses "main"
        !             4: # Available formats represent essentially the same data, albeit
        !             5: # possibly with minor discrepancies that users are not likely to notice.
        !             6: # To get new features and the best data right away, use:
        !             7: #      DATAFORM=       vanguard
        !             8: # To wait a while before using new features, to give downstream users
        !             9: # time to upgrade zic (the default), use:
        !            10: #      DATAFORM=       main
        !            11: # To wait even longer for new features, use:
        !            12: #      DATAFORM=       rearguard
        !            13: # Rearguard users might also want "ZFLAGS = -b fat"; see below.
        !            14: DATAFORM=      main
        !            15:
        !            16: # The POSIXRULES macro controls interpretation of POSIX-like TZ
        !            17: # settings like TZ='EET-2EEST' that lack DST transition rules.
        !            18: # If POSIXRULES is '-', no template is installed; this is the default.
        !            19: # Any other value for POSIXRULES is obsolete and should not be relied on, as:
        !            20: # * It does not work correctly in popular implementations such as GNU/Linux.
        !            21: # * It does not work even in tzcode, except for historical timestamps
        !            22: #   that precede the last explicit transition in the POSIXRULES file.
        !            23: #   Hence it typically does not work for current and future timestamps.
        !            24: # If, despite the above, you want a template for handling these settings,
        !            25: # you can change the line below (after finding the timezone you want in the
        !            26: # one of the $(TDATA) source files, or adding it to a source file).
        !            27: # Alternatively, if you discover you've got the wrong timezone, you can just
        !            28: # 'zic -p -' to remove it, or 'zic -p rightzone' to change it.
        !            29: # Use the command
        !            30: #      make zonenames
        !            31: # to get a list of the values you can use for POSIXRULES.
1.1       deraadt    32: POSIXRULES=    US/Pacific
                     33:
1.16    ! millert    34: # "Compiled" timezone information is placed in the "TZDIR" directory
        !            35: # (and subdirectories).
        !            36: # TZDIR_BASENAME should not contain "/" and should not be ".", ".." or empty.
        !            37: TZDIR_BASENAME=        zoneinfo
1.1       deraadt    38: TZDIR= ${DESTDIR}/usr/share/zoneinfo
                     39:
1.16    ! millert    40: # What kind of TZif data files to generate.  (TZif is the binary time
        !            41: # zone data format that zic generates; see Internet RFC 8536.)
        !            42: # If you want only POSIX time, with time values interpreted as
        !            43: # seconds since the epoch (not counting leap seconds), use
        !            44: #      REDO=           posix_only
        !            45: # below.  If you want only "right" time, with values interpreted
        !            46: # as seconds since the epoch (counting leap seconds), use
1.1       deraadt    47: #      REDO=           right_only
                     48: # below.  If you want both sets of data available, with leap seconds not
                     49: # counted normally, use
                     50: #      REDO=           posix_right
                     51: # below.  If you want both sets of data available, with leap seconds counted
                     52: # normally, use
                     53: #      REDO=           right_posix
1.16    ! millert    54: # below.  POSIX mandates that leap seconds not be counted; for compatibility
        !            55: # with it, use "posix_only" or "posix_right".  Use POSIX time on systems with
        !            56: # leap smearing; this can work better than unsmeared "right" time with
        !            57: # applications that are not leap second aware, and is closer to unsmeared
        !            58: # "right" time than unsmeared POSIX time is (e.g., 0.5 vs 1.0 s max error).
        !            59: REDO=          posix_only
1.1       deraadt    60:
1.16    ! millert    61: # Whether to put an "Expires" line in the leapseconds file.
        !            62: # Use EXPIRES_LINE=1 to put the line in, 0 to omit it.
        !            63: # The EXPIRES_LINE value matters only if REDO's value contains "right".
        !            64: # If you change EXPIRES_LINE, remove the leapseconds file before running "make".
        !            65: # zic's support for the Expires line was introduced in tzdb 2020a,
        !            66: # and was modified in tzdb 2021b to generate version 4 TZif files.
        !            67: # EXPIRES_LINE defaults to 0 for now so that the leapseconds file
        !            68: # can be given to pre-2020a zic implementations and so that TZif files
        !            69: # built by newer zic implementations can be read by pre-2021b libraries.
        !            70: EXPIRES_LINE=  0
        !            71:
        !            72: # To install data in text form that has all the information of the TZif data,
        !            73: # (optionally incorporating leap second information), use
        !            74: #      TZDATA_TEXT=    tzdata.zi leapseconds
        !            75: # To install text data without leap second information (e.g., because
        !            76: # REDO='posix_only'), use
        !            77: #      TZDATA_TEXT=    tzdata.zi
        !            78: # To avoid installing text data, use
        !            79: #      TZDATA_TEXT=
        !            80: TZDATA_TEXT=   leapseconds tzdata.zi
1.1       deraadt    81:
1.15      millert    82: TDATA=         africa antarctica asia australasia \
                     83:                europe northamerica southamerica etcetera factory \
1.1       deraadt    84:                backward
1.16    ! millert    85: TABDATA=       iso3166.tab zone.tab zone1970.tab $(TZDATA_TEXT)
        !            86: DATA=          $(TDATA) $(TABDATA)
        !            87: DSTDATA_ZI_DEPS= ziguard.awk $(TDATA)
1.1       deraadt    88:
1.15      millert    89: ZIC=           zic
1.1       deraadt    90:
1.16    ! millert    91: all: leapseconds tzdata.zi
        !            92:
        !            93: $(DATAFORM).zi:        $(DSTDATA_ZI_DEPS)
        !            94:                (cd ${.CURDIR}/datfiles && \
        !            95:                    awk -v DATAFORM=`expr $@ : '\(.*\).zi'` -f ../ziguard.awk \
        !            96:                    $(TDATA) >${.OBJDIR}/$@.out)
        !            97:                mv ${.OBJDIR}/$@.out ${.OBJDIR}/$@
        !            98:
        !            99: tzdata.zi:     $(DATAFORM).zi version zishrink.awk
        !           100:                (cd ${.CURDIR}/datfiles && version=`sed 1q ../version` && \
        !           101:                  LC_ALL=C awk \
        !           102:                    -v dataform='$(DATAFORM)' \
        !           103:                    -v deps='$(DSTDATA_ZI_DEPS) zishrink.awk' \
        !           104:                    -v redo='$(REDO)' \
        !           105:                    -v version="$$version" \
        !           106:                    -f ../zishrink.awk \
        !           107:                    ${.OBJDIR}/$(DATAFORM).zi >${.OBJDIR}/$@.out)
        !           108:                mv ${.OBJDIR}/$@.out ${.OBJDIR}/$@
        !           109:
        !           110: leapseconds: leapseconds.awk datfiles/leap-seconds.list
        !           111:        awk -v EXPIRES_LINE=$(EXPIRES_LINE) -f ${.CURDIR}/leapseconds.awk \
        !           112:            ${.CURDIR}/datfiles/leap-seconds.list >${.OBJDIR}/$@.out
        !           113:        mv ${.OBJDIR}/$@.out ${.OBJDIR}/$@
1.2       deraadt   114:
1.15      millert   115: posix_only: ${TDATA}
1.1       deraadt   116:        (cd ${.CURDIR}/datfiles; \
1.15      millert   117:            ${ZIC} -d ${TZDIR} -L /dev/null ${TDATA})
1.1       deraadt   118:
1.15      millert   119: right_only: leapseconds ${TDATA}
1.1       deraadt   120:        (cd ${.CURDIR}/datfiles; \
1.15      millert   121:            ${ZIC} -d ${TZDIR} -L leapseconds ${TDATA})
1.1       deraadt   122:
1.15      millert   123: other_two: leapseconds ${TDATA}
1.1       deraadt   124:        (cd ${.CURDIR}/datfiles; \
1.15      millert   125:            ${ZIC} -d ${TZDIR}/posix -L /dev/null ${TDATA})
1.1       deraadt   126:        (cd ${.CURDIR}/datfiles; \
1.15      millert   127:            ${ZIC} -d ${TZDIR}/right -L leapseconds ${TDATA})
1.1       deraadt   128:
                    129: posix_right: posix_only other_two
                    130:
                    131: right_posix: right_only other_two
                    132:
1.15      millert   133: realinstall: ${DATA} ${REDO}
1.1       deraadt   134:        (cd ${.CURDIR}/datfiles; \
1.15      millert   135:            ${ZIC} -d ${TZDIR} -p ${POSIXRULES})
1.1       deraadt   136:        chown -R ${BINOWN}:${BINGRP} ${TZDIR}
1.12      naddy     137:        find ${TZDIR} \
                    138:                -type f -exec chmod a=r {} + -o \
1.13      tb        139:                -type d -exec chmod a=rx,u+w {} +
1.8       espie     140:        ${INSTALL} -c -o root -g bin -m 644 ${.CURDIR}/datfiles/iso3166.tab \
1.7       deraadt   141:            ${DESTDIR}/usr/share/misc
1.16    ! millert   142:        ${INSTALL} -c -o root -g bin -m 644 leapseconds \
        !           143:            ${DESTDIR}/usr/share/zoneinfo
        !           144:        ${INSTALL} -c -o root -g bin -m 644 ${.CURDIR}/datfiles/leap-seconds.list \
        !           145:            ${DESTDIR}/usr/share/zoneinfo
        !           146:        ${INSTALL} -c -o root -g bin -m 644 tzdata.zi \
        !           147:            ${DESTDIR}/usr/share/zoneinfo
1.8       espie     148:        ${INSTALL} -c -o root -g bin -m 644 ${.CURDIR}/datfiles/zone.tab \
1.9       millert   149:            ${DESTDIR}/usr/share/zoneinfo
                    150:        ${INSTALL} -c -o root -g bin -m 644 ${.CURDIR}/datfiles/zone1970.tab \
1.8       espie     151:            ${DESTDIR}/usr/share/zoneinfo
1.7       deraadt   152:
1.16    ! millert   153: clean:
        !           154:        rm -f leapseconds *.zi
1.1       deraadt   155:
                    156: .PATH: ${.CURDIR}/datfiles
                    157: .include <bsd.prog.mk>