ICU-4716 make tzcode build with out of source builds

X-SVN-Rev: 19981
This commit is contained in:
Steven R. Loomis 2006-08-05 03:29:17 +00:00
parent ad595e0ccd
commit 6db4e2da84
2 changed files with 49 additions and 24 deletions

View file

@ -493,25 +493,49 @@ all-RES: $(RES_FILES)
$(BUILDDIR)/%.res: $(LOCSRCDIR)/%.txt $(BINDIR)/genrb$(EXEEXT) $(DAT_FILES)
$(INVOKE) $(BINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(LOCSRCDIR) -d $(BUILDDIR) $(<F)
# if the 'in' directory contains a new tzdata*.tar.gz file, use it for zoneinfo.txt
TZDATA = $(firstword $(wildcard ./in/tzdata*.tar.gz) $(wildcard $(srcdir)/in/tzdata*.tar.gz))
ifneq ($(TZDATA),)
OUTMISC=$(OUTDIR)/misc
ZONEINFO=$(OUTMISC)/zoneinfo.txt
TZCODE=$(OUTTMPDIR)/tzcode
# Override the normal genrb for zoneinfo.txt to always pull from out/zoneinfo.txt
$(BUILDDIR)/zoneinfo.res: $(ZONEINFO) $(BINDIR)/genrb$(EXEEXT)
@echo Note: $(MISCSRCDIR)/zoneinfo.txt is IGNORED because $(TZDATA) is present.
$(INVOKE) $(BINDIR)/genrb $(GENRBOPTS) -q -i $(BUILDDIR) -s $(OUTMISC) -d $(BUILDDIR) $(<F)
# create the out/tmp/tzcode directory from source/tools/tzcode
$(TZCODE):
-$(MKINSTALLDIRS) $(TZCODE)
-$(MKINSTALLDIRS)
(cd $(top_srcdir)/tools/ ; tar cf - tzcode ) | (cd $(OUTTMPDIR) ; tar xf -)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/out/tmp/tzcode/Makefile CONFIG_HEADERS= $(SHELL) ./config.status
$(OUTMISC):
-$(MKINSTALLDIRS) $@
# perform the actual build.
$(ZONEINFO): $(OUTMISC) $(TZCODE) $(TZDATA)
@echo "******* Updating $(ZONEINFO) from $(TZDATA) ..."
cp $(TZDATA) $(TZCODE)
gunzip -d < $(TZDATA) | ( cd $(TZCODE) ; tar xf - )
$(MAKE) -C $(TZCODE) icu_data
mv $(TZCODE)/zoneinfo.txt $@
# $(MAKE) -C $(TZCODE) dataclean
# $(RMV) $(top_builddir)/tools/tzcode/tzdata*.tar.gz
@echo "******* Done building $@ from $< **********"
# end of zoneinfo.txt-generation
endif
# zoneinfo has some issues. Ignore some warnings with -q
$(BUILDDIR)/%.res: $(MISCSRCDIR)/%.txt $(BINDIR)/genrb$(EXEEXT)
$(INVOKE) $(BINDIR)/genrb $(GENRBOPTS) -q -i $(BUILDDIR) -s $(MISCSRCDIR) -d $(BUILDDIR) $(<F)
# if the 'in' directory contains a new tzdata*.tar.gz file, use it for zoneinfo.txt
TZDATA = $(firstword $(wildcard $(srcdir)/in/tzdata*.tar.gz))
ifneq ($(TZDATA),)
$(MISCSRCDIR)/zoneinfo.txt: $(TZDATA)
@echo "******* Updating zoneinfo.txt from $(TZDATA) ..."
cd $(top_builddir) \
&& CONFIG_FILES=tools/tzcode/Makefile CONFIG_HEADERS= $(SHELL) ./config.status
cp $(TZDATA) $(top_builddir)/tools/tzcode
gunzip -d < $(TZDATA) | ( cd $(top_builddir)/tools/tzcode ; tar xf - )
$(MAKE) -C $(top_builddir)/tools/tzcode icu_data
mv $(top_builddir)/tools/tzcode/zoneinfo.txt $@
$(MAKE) -C $(top_builddir)/tools/tzcode dataclean
$(RMV) $(top_builddir)/tools/tzcode/tzdata*.tar.gz
@echo "******* Done building $@ from $< **********"
endif
$(OUTTMPDIR)/$(INDEX_NAME).txt: $(SRCLISTDEPS)

View file

@ -1,14 +1,17 @@
# Some Portions Copyright (c) 2006 IBM and others. All Rights Reserved.
all:
@echo This code is intended to be run by the icu/source/data makefile only.
@echo Furthermore, it is intended to be relocated to data/out/tmp/tzcode
false
srcdir = @srcdir@
top_srcdir = @top_srcdir@
subdir = tools/tzcode
top_builddir = ../..
include ../../icudefs.mk
subdir = data/out/tmp/tzcode
top_builddir = ../../../..
include $(top_builddir)/icudefs.mk
TZCOBJS= zic.o localtime.o asctime.o scheck.o ialloc.o
@ -31,9 +34,6 @@ CPPFLAGS+= -DTZDIR=\"$(TZDIR)\"
XDATA=zone.tab yearistype.sh leapseconds iso3166.tab
ICUDATA=ZoneMetaData.java icu_zone.txt tz2icu zoneinfo.txt
all:
@echo This code is intended to be run by the icu/source/data makefile only.
false
zic: $(TZCOBJS) yearistype tz2icu.h
@ -65,6 +65,7 @@ dataclean: clean
distclean: dataclean clean
-rm -f Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
## NB: this Makefile.in is sourced from $(builddir), because it was copied.
Makefile: Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status