1 # Some Portions Copyright (c) 2006-2010 IBM and others. All Rights Reserved.
4 top_srcdir = @top_srcdir@
10 include $(top_builddir)/icudefs.mk
13 TZDATA = $(firstword $(wildcard ./tzdata*.tar.gz) $(wildcard $(srcdir)/tzdata*.tar.gz))
16 TZCODE = $(firstword $(wildcard ./tzcode*.tar.gz) $(wildcard $(srcdir)/tzcode*.tar.gz))
20 TZORIG_TZDIR=./tzorig/tzdir
21 TZORIG_ABS := $(shell pwd)/tzorig
22 TZORIG_TZDIR_ABS := $(TZORIG_ABS)/tzdir
23 TZORIG_OPTS := CFLAGS="-D_POSIX_C_SOURCE $(TZORIG_EXTRA_CFLAGS)" TZDIR=$(TZORIG_TZDIR_ABS)
26 ## Options for building zdumps
27 ZDUMPOUT=$(shell pwd)/zdumpout
28 ICUZDUMPOUT=$(shell pwd)/icuzdumpout
30 ZDUMP_OPTS= -v -a -d $(ZDUMPOUT) -c 1902,2038 -i
31 ICUZDUMP_OPTS= -a -d $(ICUZDUMPOUT)
33 # Executables & objects
34 OBJECTS= zic.o localtime.o asctime.o scheck.o ialloc.o
35 ZICTARG=$(BINDIR)/zic$(EXEEXT)
36 ZICEXEC=$(TOOLBINDIR)/zic$(TOOLEXEEXT)
37 TZ2ICUTARG=$(BINDIR)/tz2icu$(EXEEXT)
38 TZ2ICUEXEC=$(TOOLBINDIR)/tz2icu$(TOOLEXEEXT)
39 ICUZDUMPTARG=$(BINDIR)/icuzdump$(EXEEXT)
40 ICUZDUMPEXEC=$(TOOLBINDIR)/icuzdump$(TOOLEXEEXT)
44 @echo ERROR "tzdata*.tar.gz" can\'t be found.
50 TZCODE_TARGETS= tzorig check-dump
55 @echo ERROR "tzcode*.tar.gz" can\'t be found.
62 @echo ERROR "tzdata*.tar.gz" can\'t be found.
65 tzorig: $(TZCODE) $(TZDATA)
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
78 ( cd $(TZORIG) ; ./zdump$(EXEEXT) $(ZDUMP_OPTS) )
81 dump-out: $(ZDUMPOUT) $(ICUZDUMPOUT)
84 diff -r zdumpout icuzdumpout
89 $(ICUZDUMPOUT): $(ICUZDUMPEXEC)
90 -$(RMV) $(ICUZDUMPOUT)
92 $(INVOKE) $(ICUZDUMPEXEC) $(ICUZDUMP_OPTS)
96 # old 'tz' rules start here
100 PRIMARY_YDATA= africa antarctica asia australasia \
101 europe northamerica southamerica
102 YDATA= $(PRIMARY_YDATA) pacificnew etcetera factory backward
104 SDATA= solar87 solar88 solar89
105 TDATA= $(YDATA) $(NDATA) $(SDATA)
106 YEARISTYPE= ./yearistype
110 CFLAGS+=-D_POSIX_C_SOURCE
111 CPPFLAGS+= -DTZDIR=\"$(TZDIR)\"
114 XDATA=zone.tab yearistype.sh leapseconds iso3166.tab
115 ICUDATA=ZoneMetaData.java icu_zone.txt tz2icu zoneinfo64.txt zoneinfo.txt
117 $(ZICTARG): $(OBJECTS) $(TDATA) yearistype $(srcdir)/tz2icu.h
118 $(CC) $(CFLAGS) $(TZORIG_EXTRA_CFLAGS) $(LFLAGS) -I$(srcdir) $(OBJECTS) $(LDLIBS) -o $@
120 $(TZ2ICUTARG): $(srcdir)/tz2icu.cpp $(srcdir)/tz2icu.h
121 $(CXX) -W -Wall $(TZ_EXTRA_CXXFLAGS) -I$(srcdir) -I$(top_srcdir)/common -pedantic $(srcdir)/tz2icu.cpp -o $@
123 $(ICUZDUMPTARG): $(srcdir)/icuzdump.cpp
124 $(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 $@
127 $(TDATA): tdatamarker
129 tdatamarker: $(TZDATA)
130 gunzip -d < $(TZDATA) | tar xf -
133 yearistype: yearistype.sh
134 cp yearistype.sh yearistype
137 posix_only: $(ZICEXEC) $(TDATA) $(srcdir)/icuzones
138 $(ZICEXEC) -y $(YEARISTYPE) -d $(TZDIR) -L /dev/null $(TDATA) $(srcdir)/icuzones
141 icu_data: $(TZ2ICUEXEC) posix_only
142 $(TZ2ICUEXEC) $(TZDIR) zone.tab `echo $(TZDATA) | sed -e "s/.*\/tzdata//;s/\.tar\.gz$$//"`
143 $(TZ2ICUEXEC) $(TZDIR) zone.tab `echo $(TZDATA) | sed -e "s/.*\/tzdata//;s/\.tar\.gz$$//"` --old
146 -rm -f core *.o *.out zdump${EXEEXT} $(ZICTARG) yearistype date $(TZ2ICUTARG)
147 @echo ICU specific cleanup:
150 -$(RMV) $(ICUZDUMPTARG) tzorig ./zdumpout/ ./icuzdumpout/
152 -rm -rf `gunzip -d < $(TZDATA) | tar tf - | grep -o '[^ ]*$$' | tr '\n' ' '`
159 -rm -f $(TDATA) $(XDATA)
161 distclean: dataclean clean
164 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
166 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status