]> git.saurik.com Git - apple/icu.git/blame - icuSources/tools/tzcode/Makefile.in
ICU-511.31.tar.gz
[apple/icu.git] / icuSources / tools / tzcode / Makefile.in
CommitLineData
51004dcb 1# Some Portions Copyright (c) 2006-2012 IBM and others. All Rights Reserved.
73c04bcf
A
2
3srcdir = @srcdir@
4top_srcdir = @top_srcdir@
5
6top_builddir = ../..
7
8subdir = tools/tzcode
9
10include $(top_builddir)/icudefs.mk
11
729e4ab9 12ifeq ($(TZDATA),)
73c04bcf 13TZDATA = $(firstword $(wildcard ./tzdata*.tar.gz) $(wildcard $(srcdir)/tzdata*.tar.gz))
729e4ab9
A
14endif
15ifeq ($(TZCODE),)
4162bf98 16TZCODE = $(firstword $(wildcard ./tzcode*.tar.gz) $(wildcard $(srcdir)/tzcode*.tar.gz))
729e4ab9 17endif
4162bf98
A
18
19TZORIG=./tzorig
20TZORIG_TZDIR=./tzorig/tzdir
21TZORIG_ABS := $(shell pwd)/tzorig
22TZORIG_TZDIR_ABS := $(TZORIG_ABS)/tzdir
23TZORIG_OPTS := CFLAGS="-D_POSIX_C_SOURCE $(TZORIG_EXTRA_CFLAGS)" TZDIR=$(TZORIG_TZDIR_ABS)
24
25
26## Options for building zdumps
27ZDUMPOUT=$(shell pwd)/zdumpout
28ICUZDUMPOUT=$(shell pwd)/icuzdumpout
29
30ZDUMP_OPTS= -v -a -d $(ZDUMPOUT) -c 1902,2038 -i
31ICUZDUMP_OPTS= -a -d $(ICUZDUMPOUT)
73c04bcf 32
729e4ab9
A
33# Executables & objects
34OBJECTS= zic.o localtime.o asctime.o scheck.o ialloc.o
35ZICTARG=$(BINDIR)/zic$(EXEEXT)
36ZICEXEC=$(TOOLBINDIR)/zic$(TOOLEXEEXT)
37TZ2ICUTARG=$(BINDIR)/tz2icu$(EXEEXT)
38TZ2ICUEXEC=$(TOOLBINDIR)/tz2icu$(TOOLEXEEXT)
39ICUZDUMPTARG=$(BINDIR)/icuzdump$(EXEEXT)
40ICUZDUMPEXEC=$(TOOLBINDIR)/icuzdump$(TOOLEXEEXT)
41
73c04bcf
A
42ifeq ($(TZDATA),)
43all:
4162bf98 44 @echo ERROR "tzdata*.tar.gz" can\'t be found.
73c04bcf
A
45 @false
46else
47all: icu_data
48endif
49
4162bf98
A
50TZCODE_TARGETS= tzorig check-dump
51
52ifeq ($(TZCODE),)
53# we're broken.
54$(TZCODE_TARGETS):
55 @echo ERROR "tzcode*.tar.gz" can\'t be found.
56 @false
57
58else
59ifeq ($(TZDATA),)
60# we're broken.
61$(TZCODE_TARGETS):
62 @echo ERROR "tzdata*.tar.gz" can\'t be found.
63 @false
64else
65tzorig: $(TZCODE) $(TZDATA)
66 -$(RMV) ./tzorig/
67 mkdir $@
68 mkdir $(TZORIG_TZDIR)
69 gunzip -d < $(TZDATA) | ( cd $@ ; tar xf - )
70 gunzip -d < $(TZCODE) | ( cd $@ ; tar xf - )
71 -mv $(TZORIG)/zdump.c $(TZORIG)/zdump.c.orig
72 cp $(srcdir)/zdump.c $(TZORIG)/zdump.c
73 -mv $(TZORIG)/factory $(TZORIG)/factory.orig
74 cat $(TZORIG)/factory.orig $(srcdir)/icuzones > $(TZORIG)/factory
75 $(MAKE) -C $@ $(TZORIG_OPTS) zdump zones
76
77$(ZDUMPOUT): tzorig
78 ( cd $(TZORIG) ; ./zdump$(EXEEXT) $(ZDUMP_OPTS) )
79
80
81dump-out: $(ZDUMPOUT) $(ICUZDUMPOUT)
82
83check-dump: dump-out
84 diff -r zdumpout icuzdumpout
85
86endif
87endif
88
729e4ab9 89$(ICUZDUMPOUT): $(ICUZDUMPEXEC)
4162bf98
A
90 -$(RMV) $(ICUZDUMPOUT)
91 -mkdir $(ICUZDUMPOUT)
729e4ab9 92 $(INVOKE) $(ICUZDUMPEXEC) $(ICUZDUMP_OPTS)
4162bf98
A
93
94
95#
96# old 'tz' rules start here
97#
98
99
73c04bcf
A
100PRIMARY_YDATA= africa antarctica asia australasia \
101 europe northamerica southamerica
102YDATA= $(PRIMARY_YDATA) pacificnew etcetera factory backward
103NDATA= systemv
104SDATA= solar87 solar88 solar89
4d9eefca
A
105#TDATA= $(YDATA) $(NDATA) $(SDATA)
106TDATA= $(YDATA) $(NDATA)
73c04bcf
A
107YEARISTYPE= ./yearistype
108
73c04bcf
A
109TZDIR=zoneinfo
110
111CFLAGS+=-D_POSIX_C_SOURCE
4162bf98 112CPPFLAGS+= -DTZDIR=\"$(TZDIR)\"
73c04bcf
A
113
114# more data
115XDATA=zone.tab yearistype.sh leapseconds iso3166.tab
729e4ab9 116ICUDATA=ZoneMetaData.java icu_zone.txt tz2icu zoneinfo64.txt zoneinfo.txt
73c04bcf 117
51004dcb
A
118# create modified CXXFLAGS without -fXXX, -Wxxxx (the settings for these don't work for tz2icu)
119TZCODE_CXXFLAGS=$(patsubst -W%,,$(patsubst -f%,,$(CXXFLAGS)))
120
729e4ab9 121$(ZICTARG): $(OBJECTS) $(TDATA) yearistype $(srcdir)/tz2icu.h
4162bf98 122 $(CC) $(CFLAGS) $(TZORIG_EXTRA_CFLAGS) $(LFLAGS) -I$(srcdir) $(OBJECTS) $(LDLIBS) -o $@
73c04bcf 123
729e4ab9 124$(TZ2ICUTARG): $(srcdir)/tz2icu.cpp $(srcdir)/tz2icu.h
51004dcb 125 $(CXX) -W -Wall $(TZCODE_CXXFLAGS) -I$(srcdir) -I$(top_srcdir)/common -pedantic $(srcdir)/tz2icu.cpp -o $@
4162bf98 126
729e4ab9 127$(ICUZDUMPTARG): $(srcdir)/icuzdump.cpp
4162bf98
A
128 $(LINK.cc) -I$(srcdir) -I$(top_srcdir)/common -I$(top_srcdir)/i18n -I$(top_srcdir)/tools/toolutil -I$(top_srcdir)/io -pedantic $(srcdir)/icuzdump.cpp $(LIBICUUC) $(LIBICUDT) $(LIBICUI18N) $(LIBICUIO) $(LIBICUTOOLUTIL) -o $@
129
130
729e4ab9 131$(TDATA): tdatamarker
73c04bcf 132
729e4ab9 133tdatamarker: $(TZDATA)
51004dcb 134 gunzip -d < $(TZDATA) | tar xf - --exclude=Makefile
729e4ab9 135 touch $@
73c04bcf
A
136
137yearistype: yearistype.sh
138 cp yearistype.sh yearistype
139 chmod +x yearistype
140
729e4ab9
A
141posix_only: $(ZICEXEC) $(TDATA) $(srcdir)/icuzones
142 $(ZICEXEC) -y $(YEARISTYPE) -d $(TZDIR) -L /dev/null $(TDATA) $(srcdir)/icuzones
73c04bcf 143
73c04bcf 144
729e4ab9
A
145icu_data: $(TZ2ICUEXEC) posix_only
146 $(TZ2ICUEXEC) $(TZDIR) zone.tab `echo $(TZDATA) | sed -e "s/.*\/tzdata//;s/\.tar\.gz$$//"`
147 $(TZ2ICUEXEC) $(TZDIR) zone.tab `echo $(TZDATA) | sed -e "s/.*\/tzdata//;s/\.tar\.gz$$//"` --old
73c04bcf
A
148
149clean:
729e4ab9 150 -rm -f core *.o *.out zdump${EXEEXT} $(ZICTARG) yearistype date $(TZ2ICUTARG)
73c04bcf
A
151 @echo ICU specific cleanup:
152 -rm -f $(ICUDATA)
153 -rm -rf $(TZDIR)
729e4ab9 154 -$(RMV) $(ICUZDUMPTARG) tzorig ./zdumpout/ ./icuzdumpout/
73c04bcf 155ifneq ($(TZDATA),)
51004dcb 156 -rm -rf `gunzip -d < $(TZDATA) | tar tf - --exclude=Makefile | grep -o '[^ ]*$$' | tr '\n' ' '`
729e4ab9 157 -rm tdatamarker
73c04bcf
A
158endif
159
4162bf98
A
160checkclean:
161
73c04bcf
A
162dataclean: clean
163 -rm -f $(TDATA) $(XDATA)
164
165distclean: dataclean clean
166 -rm -f Makefile
167
168Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
169 cd $(top_builddir) \
170 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
171
172