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 $
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 #*************************************************************************
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
)
47 TARFILE_NAME
=icu-
$(ICU_MAJOR
).
$(ICU_MINOR
)
51 PATCH_FILES
=${TARFILE_NAME}.patch
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"
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
71 icu_LDFLAGS
+= -L..
/lib
-L..
/..
/lib
-L..
/stubdata
-L..
/..
/stubdata
-L
$(SYSBASE
)$/usr
$/lib
72 .ENDIF
# "$(SYSBASE)"!=""
75 .IF
"$(EXTRA_CFLAGS)"!=""
76 CPP
:=gcc
-E
$(EXTRA_CFLAGS
)
77 CXX
:=g
++ $(EXTRA_CFLAGS
)
78 CC
:=gcc
$(EXTRA_CFLAGS
)
80 .ENDIF
# "$(EXTRA_CFLAGS)"!=""
81 .ENDIF
# "$(OS)"=="MACOSX"
83 # Disable executable stack
84 .IF
"$(OS)$(COM)"=="LINUXGCC"
85 icu_LDFLAGS
+=-Wl
,-z
,noexecstack
88 icu_CFLAGS
+=-O
$(ARCH_FLAGS
) $(EXTRA_CDEFS
)
89 icu_CXXFLAGS
+=-O
$(ARCH_FLAGS
) $(EXTRA_CDEFS
)
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
104 .IF
"$(HAVE_LD_BSYMBOLIC_FUNCTIONS)" == "TRUE"
105 LDFLAGSADD
+= -Wl
,-Bsymbolic-functions
-Wl
,--dynamic-list-cpp-new
-Wl
,--dynamic-list-cpp-typeinfo
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
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
)
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
)
142 $(BUILD_DIR
)$/bin
$/genccode \
143 $(BUILD_DIR
)$/bin
$/genbrk \
144 $(BUILD_DIR
)$/bin
$/gencmn
151 CONFIGURE_ACTION
=rm data
/mappings
/ucm
*.mk data
/translit
/trn
*.mk
;
152 .IF
"$(MINGW_SHARED_GCCLIB)"=="YES"
153 icu_LDFLAGS
+=-shared-libgcc
155 .IF
"$(USE_MINGW)"=="cygwin"
156 icu_LDFLAGS
+=-L
$(COMPATH
)/lib
/mingw
-L
$(COMPATH
)/lib
/w32api
158 icu_LDFLAGS
+=-L
$(COMPATH
)$/lib
160 .IF
"$(MINGW_SHARED_GXXLIB)"=="YES"
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
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
)
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
190 .IF
"$(USE_SHELL)"=="4nt"
194 .ENDIF
# "$(USE_SHELL)"=="4nt"
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
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
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
219 ICU_BUILD_VERSION
=Release
223 CONFIGURE_ACTION
+= $(PERL
) ..
$/..
$/..
$/..
$/..
$/createmak.pl ..
$/..
$/..
$/..
$/..
$/createmak.cfg .
225 .IF
"$(CCNUMVER)"<="001400000000"
226 BUILD_ACTION
=cd allinone
&& nmake
/f
all.mak EXFLAGS
="-EHsc" && cd ..
$/..
228 BUILD_ACTION
=cd allinone
&& nmake
/f
all.mak EXFLAGS
="-EHa -Zc:wchar_t-" && cd ..
$/..
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
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
249 .ENDIF
# "$(GUI)"=="WNT"
251 # --- Targets ------------------------------------------------------
253 .INCLUDE
: set_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
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