2007-07-27 03:12:12 +00:00
|
|
|
# Some Portions Copyright (c) 2006-2007 IBM and others. All Rights Reserved.
|
2006-08-03 23:40:18 +00:00
|
|
|
|
|
|
|
srcdir = @srcdir@
|
|
|
|
top_srcdir = @top_srcdir@
|
|
|
|
|
2006-08-11 22:23:08 +00:00
|
|
|
top_builddir = ../..
|
2006-08-04 01:18:19 +00:00
|
|
|
|
2006-08-15 00:58:57 +00:00
|
|
|
subdir = tools/tzcode
|
|
|
|
|
2006-08-05 03:29:17 +00:00
|
|
|
include $(top_builddir)/icudefs.mk
|
2006-08-04 01:18:19 +00:00
|
|
|
|
2006-08-15 00:58:57 +00:00
|
|
|
OBJECTS= zic.o localtime.o asctime.o scheck.o ialloc.o
|
2006-08-11 22:23:08 +00:00
|
|
|
TZDATA = $(firstword $(wildcard ./tzdata*.tar.gz) $(wildcard $(srcdir)/tzdata*.tar.gz))
|
2007-04-02 21:45:28 +00:00
|
|
|
TZCODE = $(firstword $(wildcard ./tzcode*.tar.gz) $(wildcard $(srcdir)/tzcode*.tar.gz))
|
|
|
|
|
|
|
|
TZORIG=./tzorig
|
|
|
|
TZORIG_TZDIR=./tzorig/tzdir
|
|
|
|
TZORIG_ABS := $(shell pwd)/tzorig
|
|
|
|
TZORIG_TZDIR_ABS := $(TZORIG_ABS)/tzdir
|
2007-08-24 05:22:45 +00:00
|
|
|
TZORIG_OPTS := CFLAGS="-D_POSIX_C_SOURCE $(TZORIG_EXTRA_CFLAGS)" TZDIR=$(TZORIG_TZDIR_ABS)
|
2007-04-02 21:45:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
## Options for building zdumps
|
|
|
|
ZDUMPOUT=$(shell pwd)/zdumpout
|
|
|
|
ICUZDUMPOUT=$(shell pwd)/icuzdumpout
|
|
|
|
|
|
|
|
ZDUMP_OPTS= -v -a -d $(ZDUMPOUT) -c 1902,2038 -i
|
|
|
|
ICUZDUMP_OPTS= -a -d $(ICUZDUMPOUT)
|
2006-08-03 23:40:18 +00:00
|
|
|
|
2006-08-11 22:23:08 +00:00
|
|
|
ifeq ($(TZDATA),)
|
|
|
|
all:
|
2007-04-02 21:45:28 +00:00
|
|
|
@echo ERROR "tzdata*.tar.gz" can\'t be found.
|
2006-08-11 22:23:08 +00:00
|
|
|
@false
|
|
|
|
else
|
|
|
|
all: icu_data
|
|
|
|
endif
|
2006-08-03 23:40:18 +00:00
|
|
|
|
2007-04-02 21:45:28 +00:00
|
|
|
TZCODE_TARGETS= tzorig check-dump
|
|
|
|
|
|
|
|
ifeq ($(TZCODE),)
|
|
|
|
# we're broken.
|
|
|
|
$(TZCODE_TARGETS):
|
|
|
|
@echo ERROR "tzcode*.tar.gz" can\'t be found.
|
|
|
|
@false
|
|
|
|
|
|
|
|
else
|
|
|
|
ifeq ($(TZDATA),)
|
|
|
|
# we're broken.
|
|
|
|
$(TZCODE_TARGETS):
|
|
|
|
@echo ERROR "tzdata*.tar.gz" can\'t be found.
|
|
|
|
@false
|
|
|
|
else
|
|
|
|
tzorig: $(TZCODE) $(TZDATA)
|
|
|
|
-$(RMV) ./tzorig/
|
|
|
|
mkdir $@
|
|
|
|
mkdir $(TZORIG_TZDIR)
|
|
|
|
gunzip -d < $(TZDATA) | ( cd $@ ; tar xf - )
|
|
|
|
gunzip -d < $(TZCODE) | ( cd $@ ; tar xf - )
|
|
|
|
-mv $(TZORIG)/zdump.c $(TZORIG)/zdump.c.orig
|
|
|
|
cp $(srcdir)/zdump.c $(TZORIG)/zdump.c
|
2007-04-03 04:36:52 +00:00
|
|
|
-mv $(TZORIG)/factory $(TZORIG)/factory.orig
|
|
|
|
cat $(TZORIG)/factory.orig $(srcdir)/icuzones > $(TZORIG)/factory
|
2007-04-02 21:45:28 +00:00
|
|
|
$(MAKE) -C $@ $(TZORIG_OPTS) zdump zones
|
|
|
|
|
|
|
|
$(ZDUMPOUT): tzorig
|
|
|
|
( cd $(TZORIG) ; ./zdump$(EXEEXT) $(ZDUMP_OPTS) )
|
|
|
|
|
|
|
|
|
|
|
|
dump-out: $(ZDUMPOUT) $(ICUZDUMPOUT)
|
|
|
|
|
|
|
|
check-dump: dump-out
|
2007-04-02 21:46:41 +00:00
|
|
|
diff -r zdumpout icuzdumpout
|
2007-04-02 21:45:28 +00:00
|
|
|
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(ICUZDUMPOUT): icuzdump$(EXEEXT)
|
|
|
|
-$(RMV) $(ICUZDUMPOUT)
|
|
|
|
-mkdir $(ICUZDUMPOUT)
|
|
|
|
$(INVOKE) ./icuzdump $(ICUZDUMP_OPTS)
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# old 'tz' rules start here
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2006-08-03 23:40:18 +00:00
|
|
|
PRIMARY_YDATA= africa antarctica asia australasia \
|
|
|
|
europe northamerica southamerica
|
|
|
|
YDATA= $(PRIMARY_YDATA) pacificnew etcetera factory backward
|
|
|
|
NDATA= systemv
|
|
|
|
SDATA= solar87 solar88 solar89
|
2006-12-01 20:11:43 +00:00
|
|
|
TDATA= $(YDATA) $(NDATA) $(SDATA)
|
2006-08-04 01:18:19 +00:00
|
|
|
YEARISTYPE= ./yearistype
|
|
|
|
|
|
|
|
ZIC = ./zic
|
|
|
|
TZDIR=zoneinfo
|
|
|
|
|
|
|
|
CFLAGS+=-D_POSIX_C_SOURCE
|
2006-12-01 20:11:43 +00:00
|
|
|
CPPFLAGS+= -DTZDIR=\"$(TZDIR)\"
|
2006-08-03 23:40:18 +00:00
|
|
|
|
2006-08-03 23:58:44 +00:00
|
|
|
# more data
|
|
|
|
XDATA=zone.tab yearistype.sh leapseconds iso3166.tab
|
|
|
|
ICUDATA=ZoneMetaData.java icu_zone.txt tz2icu zoneinfo.txt
|
2006-08-03 23:40:18 +00:00
|
|
|
|
2006-08-15 00:58:57 +00:00
|
|
|
zic: $(OBJECTS) yearistype $(srcdir)/tz2icu.h
|
2007-08-24 05:22:45 +00:00
|
|
|
$(CC) $(CFLAGS) $(TZORIG_EXTRA_CFLAGS) $(LFLAGS) -I$(srcdir) $(OBJECTS) $(LDLIBS) -o $@
|
2006-08-03 23:40:18 +00:00
|
|
|
|
2006-08-15 00:58:57 +00:00
|
|
|
tz2icu: $(srcdir)/tz2icu.cpp $(srcdir)/tz2icu.h
|
2006-12-01 20:11:43 +00:00
|
|
|
$(CXX) -W -Wall -I$(srcdir) -I$(top_srcdir)/common -pedantic $(srcdir)/tz2icu.cpp -o $@
|
2006-08-03 23:40:18 +00:00
|
|
|
|
2007-04-03 04:36:52 +00:00
|
|
|
icuzdump${EXEEXT}: $(srcdir)/icuzdump.cpp
|
2007-04-02 21:45:28 +00:00
|
|
|
$(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 $@
|
|
|
|
|
|
|
|
|
|
|
|
# $(CXX) -W -Wall -I$(srcdir) -I$(top_srcdir)/common -pedantic $(srcdir)/icuzdump.cpp -o $@
|
|
|
|
|
2006-08-11 22:23:08 +00:00
|
|
|
yearistype.sh: $(TZDATA)
|
|
|
|
gunzip -d < $(TZDATA) | tar xf -
|
|
|
|
|
2006-08-03 23:40:18 +00:00
|
|
|
yearistype: yearistype.sh
|
|
|
|
cp yearistype.sh yearistype
|
|
|
|
chmod +x yearistype
|
|
|
|
|
2006-12-01 20:11:43 +00:00
|
|
|
posix_only: zic $(TDATA) $(srcdir)/icuzones
|
|
|
|
$(ZIC) -y $(YEARISTYPE) -d $(TZDIR) -L /dev/null $(TDATA) $(srcdir)/icuzones
|
2006-08-03 23:40:18 +00:00
|
|
|
|
|
|
|
|
2007-04-03 04:36:52 +00:00
|
|
|
icu_data: tz2icu posix_only
|
2006-08-11 22:23:08 +00:00
|
|
|
./tz2icu $(TZDIR) zone.tab `echo $(TZDATA) | sed -e "s/.*\/tzdata//;s/\.tar\.gz$$//"`
|
2006-08-03 23:40:18 +00:00
|
|
|
|
|
|
|
clean:
|
2007-04-03 04:36:52 +00:00
|
|
|
-rm -f core *.o *.out zdump${EXEEXT} zic${EXEEXT} yearistype date tz2icu${EXEEXT}
|
2006-08-03 23:40:18 +00:00
|
|
|
@echo ICU specific cleanup:
|
2006-08-15 00:58:57 +00:00
|
|
|
-rm -f $(ICUDATA)
|
2006-08-04 01:18:19 +00:00
|
|
|
-rm -rf $(TZDIR)
|
2007-04-03 04:36:52 +00:00
|
|
|
-$(RMV) icuzdump${EXEEXT} tzorig ./zdumpout/ ./icuzdumpout/
|
2006-08-15 00:58:57 +00:00
|
|
|
ifneq ($(TZDATA),)
|
2006-08-11 22:36:29 +00:00
|
|
|
-rm -rf `gunzip -d < $(TZDATA) | tar tf - | grep -o '[^ ]*$$' | tr '\n' ' '`
|
2006-08-15 00:58:57 +00:00
|
|
|
endif
|
2006-08-03 23:40:18 +00:00
|
|
|
|
2007-04-02 21:45:28 +00:00
|
|
|
checkclean:
|
|
|
|
|
2006-08-03 23:58:44 +00:00
|
|
|
dataclean: clean
|
|
|
|
-rm -f $(TDATA) $(XDATA)
|
|
|
|
|
|
|
|
distclean: dataclean clean
|
|
|
|
-rm -f Makefile
|
|
|
|
|
2006-08-15 00:58:57 +00:00
|
|
|
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
2006-08-03 23:58:44 +00:00
|
|
|
cd $(top_builddir) \
|
|
|
|
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
2006-08-11 22:23:08 +00:00
|
|
|
|
|
|
|
|