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