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