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