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