]>
Commit | Line | Data |
---|---|---|
73c04bcf A |
1 | # Some Portions Copyright (c) 2006 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 | ||
15 | ifeq ($(TZDATA),) | |
16 | all: | |
17 | @echo ERROR tzdata*.tar.gz can\'t be found. | |
18 | @false | |
19 | else | |
20 | all: icu_data | |
21 | endif | |
22 | ||
23 | PRIMARY_YDATA= africa antarctica asia australasia \ | |
24 | europe northamerica southamerica | |
25 | YDATA= $(PRIMARY_YDATA) pacificnew etcetera factory backward | |
26 | NDATA= systemv | |
27 | SDATA= solar87 solar88 solar89 | |
28 | TDATA= $(YDATA) $(NDATA) $(SDATA) | |
29 | YEARISTYPE= ./yearistype | |
30 | ||
31 | ZIC = ./zic | |
32 | TZDIR=zoneinfo | |
33 | ||
34 | CFLAGS+=-D_POSIX_C_SOURCE | |
35 | CPPFLAGS+= -DTZDIR=\"$(TZDIR)\" | |
36 | ||
37 | # more data | |
38 | XDATA=zone.tab yearistype.sh leapseconds iso3166.tab | |
39 | ICUDATA=ZoneMetaData.java icu_zone.txt tz2icu zoneinfo.txt | |
40 | ||
41 | ||
42 | ||
43 | zic: $(OBJECTS) yearistype $(srcdir)/tz2icu.h | |
44 | $(CC) $(CFLAGS) $(LFLAGS) -I$(srcdir) $(OBJECTS) $(LDLIBS) -o $@ | |
45 | ||
46 | tz2icu: $(srcdir)/tz2icu.cpp $(srcdir)/tz2icu.h | |
47 | $(CXX) -W -Wall -I$(srcdir) -pedantic $(srcdir)/tz2icu.cpp -o $@ | |
48 | ||
49 | yearistype.sh: $(TZDATA) | |
50 | gunzip -d < $(TZDATA) | tar xf - | |
51 | ||
52 | yearistype: yearistype.sh | |
53 | cp yearistype.sh yearistype | |
54 | chmod +x yearistype | |
55 | ||
56 | tz.alias: $(srcdir)/tz.alias | |
57 | cp $< . | |
58 | ||
59 | posix_only: zic $(TDATA) | |
60 | $(ZIC) -y $(YEARISTYPE) -d $(TZDIR) -L /dev/null $(TDATA) | |
61 | ||
62 | ||
63 | icu_data: tz2icu posix_only tz.alias | |
64 | ./tz2icu $(TZDIR) zone.tab `echo $(TZDATA) | sed -e "s/.*\/tzdata//;s/\.tar\.gz$$//"` | |
65 | ||
66 | clean: | |
67 | -rm -f core *.o *.out zdump zic yearistype date | |
68 | @echo ICU specific cleanup: | |
69 | -rm -f $(ICUDATA) | |
70 | -rm -rf $(TZDIR) | |
71 | ifneq ($(srcdir),.) | |
72 | -$(RMV) tz.alias | |
73 | endif | |
74 | ifneq ($(TZDATA),) | |
75 | -rm -rf `gunzip -d < $(TZDATA) | tar tf - | grep -o '[^ ]*$$' | tr '\n' ' '` | |
76 | endif | |
77 | ||
78 | dataclean: clean | |
79 | -rm -f $(TDATA) $(XDATA) | |
80 | ||
81 | distclean: dataclean clean | |
82 | -rm -f Makefile | |
83 | ||
84 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | |
85 | cd $(top_builddir) \ | |
86 | && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status | |
87 | ||
88 |