xref: /aoo42x/main/icu/makefile.mk (revision 7871dc3e)
1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22
23PRJ=.
24
25PRJNAME=icu
26TARGET=so_icu
27
28# --- Settings -----------------------------------------------------
29
30.INCLUDE :	settings.mk
31
32# --- Files --------------------------------------------------------
33
34.INCLUDE :	icuversion.mk
35
36.IF "$(ICU_MICRO)"!="0"
37TARFILE_NAME=icu4c-$(ICU_MAJOR)_$(ICU_MINOR)_$(ICU_MICRO)-src
38TARFILE_MD5=2f6ecca935948f7db92d925d88d0d078
39.ELSE
40TARFILE_NAME=icu4c-$(ICU_MAJOR)_$(ICU_MINOR)-src
41TARFILE_MD5=
42.ENDIF
43TARFILE_ROOTDIR=icu
44
45PATCH_FILES=${TARFILE_NAME}.patch icu-mp.patch
46
47# ADDITIONAL_FILES=
48
49.IF "$(GUI)"=="UNX"
50.IF "$(COMNAME)"=="sunpro5"
51#.IF "$(BUILD_TOOLS)$/cc"=="$(shell +-which cc)"
52#CC:=$(COMPATH)$/bin$/cc
53#CXX:=$(COMPATH)$/bin$/CC
54#.ENDIF          # "$(BUILD_TOOLS)$/cc"=="$(shell +-which cc)"
55.ENDIF          # "$(COMNAME)"=="sunpro5"
56
57.IF "$(SYSBASE)"!=""
58icu_CFLAGS+=-I$(SYSBASE)$/usr$/include
59.IF "$(COMNAME)"=="sunpro5"
60icu_CFLAGS+=$(C_RESTRICTIONFLAGS)
61.ENDIF			# "$(COMNAME)"=="sunpro5"
62# add SYSBASE libraries and make certain that they are found *after* the
63# icu build internal libraries - in case that icu is available in SYSBASE
64# as well
65icu_LDFLAGS+= -L../lib  -L../../lib -L../stubdata -L../../stubdata  -L$(SYSBASE)$/usr$/lib
66.ENDIF			# "$(SYSBASE)"!=""
67
68.IF "$(OS)"=="MACOSX"
69.IF "$(EXTRA_CFLAGS)"!=""
70CPP:=gcc -E $(EXTRA_CFLAGS)
71CXX:=g++ $(EXTRA_CFLAGS)
72CC:=gcc $(EXTRA_CFLAGS)
73.EXPORT : CPP
74.ENDIF # "$(EXTRA_CFLAGS)"!=""
75.ENDIF # "$(OS)"=="MACOSX"
76
77icu_CFLAGS+=-O $(ARCH_FLAGS) $(EXTRA_CDEFS)
78icu_LDFLAGS+=$(EXTRA_LINKFLAGS)
79icu_CXXFLAGS+=-O $(ARCH_FLAGS) $(EXTRA_CDEFS)
80
81# remove conversion and transliteration data to reduce binary size.
82CONFIGURE_ACTION=rm data/mappings/ucm*.mk data/translit/trn*.mk ;
83
84# until someone introduces SOLARIS 64-bit builds
85.IF "$(OS)"=="SOLARIS"
86DISABLE_64BIT=--enable-64bit-libs=no
87.ENDIF			# "$(OS)"=="SOLARIS"
88
89.IF "$(HAVE_LD_HASH_STYLE)"  == "TRUE"
90LDFLAGSADD += -Wl,--hash-style=both
91.ENDIF
92
93.IF "$(HAVE_LD_BSYMBOLIC_FUNCTIONS)"  == "TRUE"
94LDFLAGSADD += -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo
95.ENDIF
96
97CONFIGURE_DIR=source
98
99CONFIGURE_ACTION+=sh -c 'CFLAGS="$(icu_CFLAGS)" CXXFLAGS="$(icu_CXXFLAGS)" LDFLAGS="$(icu_LDFLAGS) $(LDFLAGSADD)" ./configure --enable-layout --enable-static --enable-shared=yes $(DISABLE_64BIT)'
100
101#CONFIGURE_FLAGS=--enable-layout --enable-static --enable-shared=yes --enable-64bit-libs=no
102CONFIGURE_FLAGS=
103
104# Use of
105# CONFIGURE_ACTION=sh -c 'CFLAGS=-O CXXFLAGS=-O ./configure'
106# CONFIGURE_FLAGS=--enable-layout --enable-static --enable-shared=yes --enable-64bit-libs=no
107# doesn't work as it would result in
108# sh -c 'CFLAGS=-O CXXFLAGS=-O ./configure' --enable-layout ...
109# note the position of the single quotes.
110
111BUILD_DIR=$(CONFIGURE_DIR)
112BUILD_ACTION=$(AUGMENT_LIBRARY_PATH) $(GNUMAKE) -j$(EXTMAXPROCESS)
113OUT2LIB= \
114	$(BUILD_DIR)$/lib$/libicudata$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR).$(ICU_MICRO) \
115	$(BUILD_DIR)$/lib$/libicudata$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR) \
116	$(BUILD_DIR)$/lib$/libicudata$(DLLPOST) \
117	$(BUILD_DIR)$/lib$/libicuuc$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR).$(ICU_MICRO) \
118	$(BUILD_DIR)$/lib$/libicuuc$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR) \
119	$(BUILD_DIR)$/lib$/libicuuc$(DLLPOST) \
120	$(BUILD_DIR)$/lib$/libicui18n$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR).$(ICU_MICRO) \
121	$(BUILD_DIR)$/lib$/libicui18n$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR) \
122	$(BUILD_DIR)$/lib$/libicui18n$(DLLPOST) \
123	$(BUILD_DIR)$/lib$/libicule$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR).$(ICU_MICRO) \
124	$(BUILD_DIR)$/lib$/libicule$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR) \
125	$(BUILD_DIR)$/lib$/libicule$(DLLPOST) \
126	$(BUILD_DIR)$/lib$/libicutu$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR).$(ICU_MICRO) \
127	$(BUILD_DIR)$/lib$/libicutu$(DLLPOST).$(ICU_MAJOR)$(ICU_MINOR) \
128	$(BUILD_DIR)$/lib$/libicutu$(DLLPOST)
129
130OUT2BIN= \
131	$(BUILD_DIR)$/bin$/genccode \
132	$(BUILD_DIR)$/bin$/genbrk \
133	$(BUILD_DIR)$/bin$/gencmn
134
135.ENDIF
136
137.IF "$(GUI)"=="WNT"
138CONFIGURE_DIR=source
139.IF "$(COM)"=="GCC"
140CONFIGURE_ACTION=rm data/mappings/ucm*.mk data/translit/trn*.mk ;
141.IF "$(MINGW_SHARED_GCCLIB)"=="YES"
142icu_LDFLAGS+=-shared-libgcc
143.ENDIF
144.IF "$(USE_MINGW)"=="cygwin"
145icu_LDFLAGS+=-L$(COMPATH)/lib/mingw -L$(COMPATH)/lib/w32api
146.ENDIF
147icu_LDFLAGS+=-L$(COMPATH)$/lib
148icu_LIBS=
149.IF "$(MINGW_SHARED_GXXLIB)"=="YES"
150icu_LIBS+=$(MINGW_SHARED_LIBSTDCPP)
151.ENDIF
152icu_LDFLAGS+=-Wl,--enable-runtime-pseudo-reloc-v2
153CONFIGURE_ACTION+=sh -c 'CFLAGS="-O -D_MT" CXXFLAGS="-O -D_MT" LDFLAGS="$(icu_LDFLAGS)" LIBS="$(icu_LIBS)" ./configure --build=i586-pc-mingw32 --enable-layout --enable-static --enable-shared=yes --enable-64bit-libs=no'
154
155#CONFIGURE_FLAGS=--enable-layout --enable-static --enable-shared=yes --enable-64bit-libs=no
156CONFIGURE_FLAGS=
157
158# Use of
159# CONFIGURE_ACTION=sh -c 'CFLAGS=-O CXXFLAGS=-O ./configure'
160# CONFIGURE_FLAGS=--enable-layout --enable-static --enable-shared=yes --enable-64bit-libs=no
161# doesn't work as it would result in
162# sh -c 'CFLAGS=-O CXXFLAGS=-O ./configure' --enable-layout ...
163# note the position of the single quotes.
164
165BUILD_DIR=$(CONFIGURE_DIR)
166BUILD_ACTION=$(GNUMAKE)
167OUT2LIB=
168
169OUT2BIN= \
170	$(BUILD_DIR)$/lib$/icudt$(ICU_MAJOR)$(ICU_MINOR)$(DLLPOST) \
171	$(BUILD_DIR)$/lib$/icuuc$(ICU_MAJOR)$(ICU_MINOR)$(DLLPOST) \
172	$(BUILD_DIR)$/lib$/icuin$(ICU_MAJOR)$(ICU_MINOR)$(DLLPOST) \
173	$(BUILD_DIR)$/lib$/icule$(ICU_MAJOR)$(ICU_MINOR)$(DLLPOST) \
174	$(BUILD_DIR)$/lib$/icutu$(ICU_MAJOR)$(ICU_MINOR)$(DLLPOST) \
175	$(BUILD_DIR)$/bin$/genccode.exe \
176	$(BUILD_DIR)$/bin$/genbrk.exe \
177	$(BUILD_DIR)$/bin$/gencmn.exe
178
179.ELSE
180BUILD_DIR=source
181.IF "full_debug" == ""
182
183# Activating the debug mechanism produces incompatible libraries, you'd have
184# at least to relink all modules that are directly using ICU. Note that library
185# names get a 'd' appended and you'd have to edit the solenv/inc/libs.mk
186# ICU*LIB macros as well. Normally you don't want all this.
187#
188# Instead, use the normal already existing Release build and edit the
189# corresponding *.vcproj file of the section you're interested in. Make sure
190# that
191# - for the VCCLCompilerTool section the following line exists:
192#   DebugInformationFormat="3"
193# - and for the VCLinkerTool the line
194#   GenerateDebugInformation="TRUE"
195# Then delete the corresponding Release output directory, and delete the target
196# flag files
197# $(OUTPATH)/misc/build/so_built_so_icu
198# $(OUTPATH)/misc/build/so_predeliver_so_icu
199# and run dmake again, after which you may copy the resulting libraries to your
200# OOo/SO installation.
201ICU_BUILD_VERSION=Debug
202ICU_BUILD_LIBPOST=d
203.ELSE
204ICU_BUILD_VERSION=Release
205ICU_BUILD_LIBPOST=
206.ENDIF
207
208CONFIGURE_ACTION+= $(PERL) ..$/..$/..$/..$/..$/createmak.pl ..$/..$/..$/..$/..$/createmak.cfg .
209
210.IF "$(CCNUMVER)"<="001400000000"
211BUILD_ACTION=cd allinone && nmake /f all.mak EXFLAGS="-EHsc" && cd ..$/..
212.ELSE
213BUILD_ACTION=cd allinone && nmake /f all.mak EXFLAGS="-EHa -Zc:wchar_t-" && cd ..$/..
214.ENDIF
215
216OUT2LIB= \
217	$(BUILD_DIR)$/..$/lib$/icudata.lib \
218	$(BUILD_DIR)$/..$/lib$/icuin$(ICU_BUILD_LIBPOST).lib \
219	$(BUILD_DIR)$/..$/lib$/icuuc$(ICU_BUILD_LIBPOST).lib \
220	$(BUILD_DIR)$/..$/lib$/icule$(ICU_BUILD_LIBPOST).lib \
221	$(BUILD_DIR)$/..$/lib$/icutu$(ICU_BUILD_LIBPOST).lib
222
223OUT2BIN= \
224	$(BUILD_DIR)$/..$/bin$/icudt$(ICU_MAJOR)$(ICU_MINOR).dll \
225	$(BUILD_DIR)$/..$/bin$/icuin$(ICU_MAJOR)$(ICU_MINOR)$(ICU_BUILD_LIBPOST).dll \
226	$(BUILD_DIR)$/..$/bin$/icuuc$(ICU_MAJOR)$(ICU_MINOR)$(ICU_BUILD_LIBPOST).dll \
227	$(BUILD_DIR)$/..$/bin$/icule$(ICU_MAJOR)$(ICU_MINOR)$(ICU_BUILD_LIBPOST).dll \
228	$(BUILD_DIR)$/..$/bin$/icutu$(ICU_MAJOR)$(ICU_MINOR)$(ICU_BUILD_LIBPOST).dll \
229	$(BUILD_DIR)$/..$/bin$/genccode.exe \
230	$(BUILD_DIR)$/..$/bin$/genbrk.exe \
231    $(BUILD_DIR)$/..$/bin$/gencmn.exe
232
233.ENDIF
234.ENDIF		# "$(GUI)"=="WNT"
235
236# --- Targets ------------------------------------------------------
237
238.INCLUDE : set_ext.mk
239.INCLUDE :	target.mk
240.INCLUDE :	tg_ext.mk
241
242.IF "$(BINARY_PATCH_FILES)"!=""
243
244$(PACKAGE_DIR)$/so_add_binary :  $(PACKAGE_DIR)$/$(ADD_FILES_FLAG_FILE)
245	cd $(PACKAGE_DIR) && gunzip -c $(BACK_PATH)$(BINARY_PATCH_FILES) | tar -xvf -
246	$(TOUCH) $(PACKAGE_DIR)$/so_add_binary
247
248$(PACKAGE_DIR)$/$(CONFIGURE_FLAG_FILE) : $(PACKAGE_DIR)$/so_add_binary
249
250.ENDIF
251
252.IF "$(GUI)$(COM)"=="WNTGCC"
253ALLTAR : \
254	$(LB)$/icudata.lib \
255	$(LB)$/icuin$(ICU_BUILD_LIBPOST).lib \
256	$(LB)$/icuuc$(ICU_BUILD_LIBPOST).lib \
257	$(LB)$/icule$(ICU_BUILD_LIBPOST).lib \
258	$(LB)$/icutu$(ICU_BUILD_LIBPOST).lib
259
260$(LB)$/icudata.lib : $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
261	$(TOUCH) $@
262
263$(LB)$/icuin$(ICU_BUILD_LIBPOST).lib : $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
264	$(TOUCH) $@
265
266$(LB)$/icuuc$(ICU_BUILD_LIBPOST).lib : $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
267	$(TOUCH) $@
268
269$(LB)$/icule$(ICU_BUILD_LIBPOST).lib : $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
270	$(TOUCH) $@
271
272$(LB)$/icutu$(ICU_BUILD_LIBPOST).lib : $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
273	$(TOUCH) $@
274.ENDIF
275
276# Since you never know what will be in a patch (for example, it may already
277# patch at configure level) or in the case of a binary patch, we remove the
278# entire package directory if a patch is newer.
279# Changes in this makefile could also make a complete build necessary if
280# configure is affected.
281$(PACKAGE_DIR)$/$(UNTAR_FLAG_FILE) : makefile.mk
282
283