2006-08-03 23:40:18 +00:00
|
|
|
# Some Portions Copyright (c) 2006 IBM and others. All Rights Reserved.
|
|
|
|
|
|
|
|
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))
|
2006-08-03 23:40:18 +00:00
|
|
|
|
2006-08-11 22:23:08 +00:00
|
|
|
ifeq ($(TZDATA),)
|
|
|
|
all:
|
|
|
|
@echo ERROR tzdata*.tar.gz can\'t be found.
|
|
|
|
@false
|
|
|
|
else
|
|
|
|
all: icu_data
|
|
|
|
endif
|
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
|
|
|
|
$(CC) $(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
|
|
|
|
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-08-15 00:58:57 +00:00
|
|
|
tz.alias: $(srcdir)/tz.alias
|
|
|
|
cp $< .
|
|
|
|
|
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
|
|
|
|
|
|
|
|
2006-08-15 00:58:57 +00:00
|
|
|
icu_data: tz2icu posix_only tz.alias
|
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:
|
2006-08-04 01:18:19 +00:00
|
|
|
-rm -f core *.o *.out zdump zic yearistype date
|
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)
|
2006-08-15 00:58:57 +00:00
|
|
|
ifneq ($(srcdir),.)
|
|
|
|
-$(RMV) tz.alias
|
|
|
|
endif
|
|
|
|
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
|
|
|
|
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
|
|
|
|
|
|
|
|