]> git.saurik.com Git - apple/icu.git/blame - icuSources/tools/Makefile.in
ICU-3.13.tar.gz
[apple/icu.git] / icuSources / tools / Makefile.in
CommitLineData
b75a7d8f
A
1## Makefile.in for ICU tools
2## Copyright (c) 1999-2003, International Business Machines Corporation and
3## others. All Rights Reserved.
4
5## Source directory information
6srcdir = @srcdir@
7top_srcdir = @top_srcdir@
8
9top_builddir = ..
10
11include $(top_builddir)/icudefs.mk
12
13include @platform_make_fragment@
14
15##
16
17CPPFLAGS = @CPPFLAGS@ -I$(top_srcdir)/common -I$(top_builddir)/common
18CFLAGS = @CFLAGS@
19CXXFLAGS = @CXXFLAGS@
20
21## Build directory information
22subdir = tools
23
24# OBJDATADIR must be a short path (with ..'s) to the data.
25
26SRCDATADIR=$(top_srcdir)/../data
27
28OBJDATADIR=$(top_builddir)/data
29# tmpdir is INSIDE pkgdata dir. if you change TMPDATADIR then the invokation
30# of pkgdata will break...
31TMPDATADIR=tmp
32
33# DATABUILDDIR must be an absolute path because of the way pkgdata is invoked
34# from the temporary directory.
35
36DATABUILDDIR=$(OBJDATADIR)
37
38# relative lib links from pkgdata are the same as for tmp
39top_builddir_from_tmp = $(patsubst ..%,../..%,$(top_builddir))
40INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(top_builddir_from_tmp)/common:$(top_builddir_from_tmp)/tools/toolutil:$$$(LDLIBRARYPATH_ENVVAR)
41PKGDATA = ../pkgdata/pkgdata -T . -s $(DATABUILDDIR) -O ./icupkg.inc -d $(DATABUILDDIR)
42PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION)
43
44## Install program information
45MKINSTALLDIRS = $(SHELL) $(top_srcdir)/mkinstalldirs
46
47INSTALL = @INSTALL@
48INSTALL_PROGRAM = @INSTALL_PROGRAM@
49INSTALL_DATA = @INSTALL_DATA@
50INSTALL_SCRIPT = @INSTALL_SCRIPT@
51
52## for cleaning up libraries
53STRIP = @STRIP@
54
55## Package information
56PACKAGE = @PACKAGE@
57VERSION = @VERSION@
58
59
60SUBDIRS = ctestfw toolutil makeconv genrb genuca genbrk \
61genccode genprops gennames genpname gennorm gencmn gencnval gentz gentest genidna pkgdata
62
63## List of phony targets
64.PHONY : all all-local all-recursive install install-local install-files install-dlls build-cmnfile build-dll \
65install-recursive clean clean-local clean-recursive distclean \
66distclean-local distclean-recursive dist dist-local dist-recursive \
67check check-local check-recursive build-testdlls build-basetestdata build-local
68
69## Clear suffix list
70.SUFFIXES :
71
72## List of standard targets
73all: all-recursive
74install: install-recursive
75clean: clean-local clean-recursive
76distclean : distclean-recursive
77dist: dist-recursive
78check: all check-recursive
79
80## Recursive targets
81all-recursive install-recursive clean-recursive distclean-recursive dist-recursive check-recursive:
82 @dot_seen=no; \
83 target=`echo $@ | sed s/-recursive//`; \
84 list='$(SUBDIRS)'; for subdir in $$list; do \
85 echo "$(MAKE)[$(MAKELEVEL)]: Making \`$$target' in \`$$subdir'"; \
86 if test "$$subdir" = "."; then \
87 dot_seen=yes; \
88 local_target="$$target-local"; \
89 else \
90 local_target="$$target"; \
91 fi; \
92 (cd $$subdir && $(MAKE) $$local_target) || exit; \
93 done; \
94 if test "$$dot_seen" = "no"; then \
95 $(MAKE) "$$target-local" || exit; \
96 fi
97
98all-local: build-local
99
100DAT_FILES=uprops.dat unames.dat cnvalias.dat tz.dat
101# ALL of these files can be deleted (the following BRK files) - they are copied
102BRK_FILES=char.brk line.brk line_th.brk sent.brk word.brk title.brk word_th.brk
103# don't include thaidict.brk - it goes into a resource bundle - plus it isn't deleted
104
105DATAFILESD=$(DAT_FILES:%=$(OBJDATADIR)/%)
106DATAFILESB=$(BRK_FILES:%=$(OBJDATADIR)/%)
107
108# copy the right endianness
109
110ifeq (@U_IS_BIG_ENDIAN@,1)
111$(OBJDATADIR)/%.brk: $(SRCDATADIR)/%BE.brk
112 cp $< $@
113else
114$(OBJDATADIR)/%.brk: $(SRCDATADIR)/%LE.brk
115 cp $< $@
116endif
117
118#include $(srcdir)/makeconv/ucmfiles.mk
119#-include $(srcdir)/makeconv/ucmebcdic.mk
120#-include $(srcdir)/makeconv/ucmlocal.mk
121ALL_UCM_SOURCE= $(UCM_SOURCE) $(UCM_EBCDIC_SOURCE) $(UCM_SOURCE_LOCAL)
122
123#include $(srcdir)/genrb/genrbfiles.mk
124#-include $(srcdir)/genrb/reslocal.mk
125ALL_RES_SOURCE= $(GENRB_SOURCE) $(TRANSLIT_SOURCE) $(RESOURCE_SRC) $(GENRB_SOURCE_LOCAL)
126
127UCM_FILES = $(ALL_UCM_SOURCE:%=$(SRCDATADIR)/%)
128CNV_FILES = $(ALL_UCM_SOURCE:%.ucm=$(OBJDATADIR)/%.cnv)
129CNV_FILESL = $(ALL_UCM_SOURCE:%.ucm=%.cnv)
130
131RES_SRC_FILES = $(ALL_RES_SOURCE:%=$(SRCDATADIR)/%)
132RES_FILES = $(ALL_RES_SOURCE:%.txt=$(OBJDATADIR)/%.res)
133RES_FILESL = $(ALL_RES_SOURCE:%.txt=%.res)
134
135DATAFILESC=$(CNV_FILES)
136DATAFILESR=$(RES_FILES)
137
138DATAFILES=$(DATAFILESD) $(CNV_FILES) $(DATAFILESB) $(RES_FILES)
139DATAFILESL=$(DAT_FILES) $(CNV_FILESL) $(BRK_FILES) $(RES_FILESL)
140
141
142## Files to remove for 'make clean'
143CLEANFILES = *~ $(BRK_FILES)
144
145install-local:
146
147dist-local:
148
149clean-local: clean-pkgdata
150 test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
151 test -z "$(SRCDATAFILES)" || $(RMV) $(SRCDATAFILES)
152 $(RMV) $(DATAFILES)
153 $(RMV) icupkg.inc
154 -@if [ -f $(TMPDATADIR)/$(ICUDATA_NAME)_dll.mak ]; then \
155 (cd pkgdata ; $(INVOKE) ./pkgdata -T $(TMPDATADIR) -m dll $(PKGDATA_VERSIONING) -p $(ICUDATA_NAME) -O $(DATABUILDDIR)/icupkg.inc $(TMPDATADIR)/$(ICUDATA_NAME).lst -d $(DATABUILDDIR) --clean ) \
156 fi
157 -@if [ -f $(TMPDATADIR)/$(ICUDATA_NAME)_common.mak ]; then \
158 (cd pkgdata; $(INVOKE) ./pkgdata -T $(TMPDATADIR) -m common -p $(ICUDATA_NAME) -O $(DATABUILDDIR)/icupkg.inc $(TMPDATADIR)/$(ICUDATA_NAME).lst -d $(DATABUILDDIR) --clean ) \
159 fi
160 -@$(RMV) $(TMPDATADIR) $(TMPDATADIR)2
161
162# Clean up any old variations..
163distclean-local: clean-local
164 $(RMV) Makefile
165
166$(TMPDATADIR)/$(ICUDATA_NAME).lst: Makefile $(srcdir)/Makefile.in $(srcdir)/genrb/genrbfiles.mk $(srcdir)/makeconv/ucmfiles.mk
167 @echo "generating $@ (list of data files)"
168 @$(MKINSTALLDIRS) $(TMPDATADIR)
169 @-$(RMV) $(TMPDATADIR)/$(ICUDATA_NAME).lst
170 @for file in $(DATAFILESL); do \
171 echo $(OBJDATADIR)/$$file >> $(TMPDATADIR)/$(ICUDATA_NAME).lst; \
172 done;
173
174$(TMPDATADIR)/testdata.lst: Makefile
175 $(MKINSTALLDIRS) $(TMPDATADIR)
176 echo $(DATABUILDDIR)/test.dat > $@
177
178$(TMPDATADIR)2/testdata.lst: Makefile $(top_builddir)/test/testdata/root.res
179 $(MKINSTALLDIRS) $(TMPDATADIR)2
180 echo $(DATABUILDDIR)/test.dat > $@
181 echo $(DATABUILDDIR)/../test/testdata/root.res >> $@
182
183$(TMPDATADIR)/icupkg.inc: pkgdata/icupkg.inc
184 $(MKINSTALLDIRS) $(TMPDATADIR)
185 cp pkgdata/icupkg.inc $(TMPDATADIR)/icupkg.inc
186
187$(TMPDATADIR)2/icupkg.inc: pkgdata/icupkg.inc
188 $(MKINSTALLDIRS) $(TMPDATADIR)2
189 cp pkgdata/icupkg.inc $(TMPDATADIR)2/icupkg.inc
190
191# build the ICU and test data
192
193build-local:
194
195clean-pkgdata:
196 -(cd $(TMPDATADIR); $(INVOKE) $(PKGDATA) -m dll -p $(ICUDATA_NAME) ./$(ICUDATA_NAME).lst --clean || echo '### Warning, cannot clean up icu/data if pkgdata is already gone.' )
197 -(cd $(TMPDATADIR); $(INVOKE) $(PKGDATA) -m common -p testdat1 ./testdata.lst --clean || echo '### Warning, cannot clean up icu/data if pkgdata is already gone.' )
198 -(cd $(TMPDATADIR)2; $(INVOKE) $(PKGDATA) -m common -p testdat2 ./testdata.lst --clean || echo '### Warning, cannot clean up icu/data if pkgdata is already gone.' )
199 -$(RMV) $(TMPDATADIR)/$(ICUDATA_NAME).lst $(TMPDATADIR)/testdata.lst $(TMPDATADIR)/icupkg.inc $(TMPDATADIR)2/testdata.lst
200
201check-local:
202
203Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
204 cd $(top_builddir) \
205 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
206