]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/tools/tzcode/Makefile.in
ICU-66108.tar.gz
[apple/icu.git] / icuSources / tools / tzcode / Makefile.in
index cc135b8d3fe444c7039044c87c96fbb5999371ba..485a23eab4d131ef235d28bce760bfcc2f06b1f7 100644 (file)
@@ -1,3 +1,5 @@
+# Copyright (C) 2016 and later: Unicode, Inc. and others.
+# License & terms of use: http://www.unicode.org/copyright.html
 # Some Portions Copyright (c) 2006-2012 IBM and others. All Rights Reserved.
 
 srcdir = @srcdir@
@@ -16,6 +18,28 @@ ifeq ($(TZCODE),)
 TZCODE = $(firstword $(wildcard ./tzcode*.tar.gz) $(wildcard $(srcdir)/tzcode*.tar.gz))
 endif
 
+
+PRIMARY_YDATA= africa antarctica asia australasia \
+               europe northamerica southamerica
+YDATA=         $(PRIMARY_YDATA) pacificnew etcetera factory backward
+NDATA=         systemv
+SDATA=         solar87 solar88 solar89
+#TDATA=                $(YDATA) $(NDATA) $(SDATA)
+TDATA=         $(YDATA) $(NDATA)
+YEARISTYPE=     ./yearistype
+
+TZDIR=zoneinfo
+
+CFLAGS+=-D_POSIX_C_SOURCE=200112L
+CPPFLAGS+= -DTZDIR=\"$(TZDIR)\" 
+
+# more data
+XDATA=zone.tab yearistype.sh leapseconds iso3166.tab
+ICUDATA=ZoneMetaData.java icu_zone.txt tz2icu zoneinfo64.txt zoneinfo.txt
+
+VANGUARD_DIR= ./vanguard
+
+# For TZ DB/ICU comparison
 TZORIG=./tzorig
 TZORIG_TZDIR=./tzorig/tzdir
 TZORIG_ABS := $(shell pwd)/tzorig
@@ -70,15 +94,25 @@ tzorig:     $(TZCODE) $(TZDATA)
        mkdir $(TZORIG_TZDIR)
        gunzip -d < $(TZDATA) | ( cd $@ ; tar xf - )
        gunzip -d < $(TZCODE) | ( cd $@ ; tar xf - )
+       if test -e $(TZORIG)/ziguard.awk; then \
+               for tzfile in $(TDATA) ; do \
+                       mv $(TZORIG)/$$tzfile $(TZORIG)/$$tzfile.bak && \
+                       awk -v DATAFORM=rearguard -f $(TZORIG)/ziguard.awk $(TZORIG)/$$tzfile.bak > $(TZORIG)/$$tzfile; \
+               done; \
+       fi;
        -mv $(TZORIG)/zdump.c $(TZORIG)/zdump.c.orig
        cp $(srcdir)/zdump.c $(TZORIG)/zdump.c
        -mv $(TZORIG)/factory $(TZORIG)/factory.orig
        cat $(TZORIG)/factory.orig $(srcdir)/icuzones > $(TZORIG)/factory
+       -mv $(TZORIG)/zishrink.awk $(TZORIG)/zishrink.awk.orig
+       sed -e '/if (line ~ \/^R SystemV \/) return/s/^/#/' $(TZORIG)/zishrink.awk.orig > $(TZORIG)/zishrink.awk
+       -mv $(TZORIG)/Makefile $(TZORIG)/Makefile.orig
+       sed -e "s/^BACKWARD=.*/BACKWARD= backward pacificnew/" $(TZORIG)/Makefile.orig > $(TZORIG)/Makefile
        $(MAKE) -C $@ $(TZORIG_OPTS) zdump zones
 
 $(ZDUMPOUT): tzorig
        ( cd $(TZORIG) ; ./zdump$(EXEEXT) $(ZDUMP_OPTS) )
-
+       find $(ZDUMPOUT) -name '*--ICU' -exec sh -c 'mv "$${0}" $${0%--ICU}' {} \;
 
 dump-out: $(ZDUMPOUT) $(ICUZDUMPOUT)
 
@@ -99,24 +133,6 @@ $(ICUZDUMPOUT): $(ICUZDUMPEXEC)
 #
 
 
-PRIMARY_YDATA= africa antarctica asia australasia \
-               europe northamerica southamerica
-YDATA=         $(PRIMARY_YDATA) pacificnew etcetera factory backward
-NDATA=         systemv
-SDATA=         solar87 solar88 solar89
-#TDATA=                $(YDATA) $(NDATA) $(SDATA)
-TDATA=         $(YDATA) $(NDATA)
-YEARISTYPE=     ./yearistype
-
-TZDIR=zoneinfo
-
-CFLAGS+=-D_POSIX_C_SOURCE
-CPPFLAGS+= -DTZDIR=\"$(TZDIR)\" 
-
-# more data
-XDATA=zone.tab yearistype.sh leapseconds iso3166.tab
-ICUDATA=ZoneMetaData.java icu_zone.txt tz2icu zoneinfo64.txt zoneinfo.txt
-
 # create modified CXXFLAGS without -fXXX, -Wxxxx (the settings for these don't work for tz2icu)
 TZCODE_CXXFLAGS=$(patsubst -W%,,$(patsubst -f%,,$(CXXFLAGS)))
 
@@ -138,9 +154,18 @@ $(ICUZDUMPOBJ):    $(srcdir)/icuzdump.cpp
 $(TDATA): tdatamarker
 
 tdatamarker: $(TZDATA)
+       mkdir $(VANGUARD_DIR)
        gunzip -d < $(TZDATA) | tar xf - --exclude=Makefile
+       if test -e ziguard.awk; then \
+               for tzfile in $(TDATA) ; do \
+                       mv $$tzfile $(VANGUARD_DIR)/$$tzfile && \
+                       awk -v DATAFORM=rearguard -f ziguard.awk $(VANGUARD_DIR)/$$tzfile > $$tzfile; \
+               done; \
+       fi;
        touch $@
 
+yearistype.sh: | $(TDATA)
+
 yearistype:    yearistype.sh
                cp yearistype.sh yearistype
                chmod +x yearistype
@@ -160,10 +185,11 @@ clean:
                @echo ICU specific cleanup:
                -rm -f $(ICUDATA)
                -rm -rf $(TZDIR)
+               -rm -rf $(VANGUARD_DIR)
                -$(RMV) $(ICUZDUMPTARG) tzorig ./zdumpout/ ./icuzdumpout/
 ifneq ($(TZDATA),)
                -rm -rf `gunzip -d < $(TZDATA) | tar tf - --exclude=Makefile | grep -o '[^ ]*$$' | tr '\n' ' '`
-               -rm tdatamarker
+               -rm -f tdatamarker
 endif
 
 checkclean: