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