1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 # This file incorporates work covered by the following license notice:
11 # Licensed to the Apache Software Foundation (ASF) under one or more
12 # contributor license agreements. See the NOTICE file distributed
13 # with this work for additional information regarding copyright
14 # ownership. The ASF licenses this file to you under the Apache
15 # License, Version 2.0 (the "License"); you may not use this file
16 # except in compliance with the License. You may obtain a copy of
17 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 gb_COMPILERDEFAULTOPTFLAGS
:= -Os
21 gb_CPUDEFS
:= -D_M_IX86
22 gb_TMPDIR
:=$(if
$(TMPDIR
),$(TMPDIR
),/tmp
)
24 gb_PROGRAMDIRNAME
:= program
26 # please make generic modifications to either of these
27 include $(GBUILDDIR
)/platform
/com_GCC_defs.mk
28 include $(GBUILDDIR
)/platform
/windows.mk
30 gb_CCVER
:= $(shell $(gb_CC
) -dumpversion |
$(gb_AWK
) -F.
-- \
31 '{ print $$1*10000+$$2*100+$$3 }')
32 gb_GccLess470
:= $(shell expr
$(gb_CCVER
) \
< 40700)
38 -D_NATIVE_WCHAR_T_DEFINED \
40 -D_FORCENAMELESSUNION \
42 # Until GCC 4.6, MinGW used __cdecl by default, and BOOST_MEM_FN_ENABLE_CDECL
43 # would result in ambiguous calls to overloaded boost::bind; since GCC 4.7,
44 # MinGW uses __thiscall by default, so now needs BOOST_MEM_FN_ENABLE_CDECL for
45 # uses of boost::bind with functions annotated with SAL_CALL:
46 ifeq ($(gb_GccLess470
),0)
47 gb_COMPILERDEFS
+= -DBOOST_MEM_FN_ENABLE_CDECL
59 -Wdeclaration-after-statement \
60 -fno-strict-aliasing \
62 # For -Wno-non-virtual-dtor see <http://markmail.org/message/664jsoqe6n6smy3b>
63 # "Re: [dev] warnings01: -Wnon-virtual-dtor" message to dev@openoffice.org from
66 $(gb_CXXFLAGS_COMMON
) \
67 -Wno-ctor-dtor-privacy \
68 -Wno-non-virtual-dtor \
72 -fno-strict-aliasing \
76 gb_CXXFLAGS
+= --sysroot
=$(SYSBASE
)
77 gb_CFLAGS
+= --sysroot
=$(SYSBASE
)
80 ifeq ($(HAVE_CXX0X
),TRUE
)
81 gb_CXXFLAGS
+= -std
=gnu
++0x
84 # At least sal defines its own __main, which would cause DLLs linking against
85 # sal to pick up sal's __main instead of the one from MinGW's dllcrt2.o:
86 gb_LinkTarget_LDFLAGS
:= \
87 -Wl
,--export-all-symbols \
88 -Wl
,--exclude-symbols
,__main \
89 -Wl
,--enable-stdcall-fixup \
90 -Wl
,--enable-runtime-pseudo-reloc-v2 \
93 ifeq ($(MINGW_GCCLIB_EH
),YES
)
94 gb_LinkTarget_LDFLAGS
+= -shared-libgcc
102 gb_DEBUG_CFLAGS
:= -g
-fno-inline
106 gb_LinkTarget_CFLAGS
:= $(gb_CFLAGS
)
107 gb_LinkTarget_CXXFLAGS
:= $(gb_CXXFLAGS
)
109 ifeq ($(gb_SYMBOL
),$(true
))
110 gb_LinkTarget_CXXFLAGS
+= $(GGDB2
)
111 gb_LinkTarget_CFLAGS
+= $(GGDB2
)
114 gb_LinkTarget_INCLUDE
+=\
115 $(foreach inc
,$(subst ;, ,$(JDKINC
)),-I
$(inc
)) \
117 define gb_LinkTarget__command_dynamiclinkexecutable
118 $(call gb_Helper_abbreviate_dirs
,\
119 mkdir
-p
$(dir $(1)) && \
120 $(if
$(CXXOBJECTS
)$(GENCXXOBJECTS
)$(EXTRAOBJECTLISTS
),$(gb_CXX
),$(gb_CC
)) $(strip \
121 $(gb_Executable_TARGETTYPEFLAGS
) \
122 $(if
$(filter YES
,$(TARGETGUI
)), -mwindows
, -mconsole
) \
124 $(foreach object
,$(COBJECTS
),$(call gb_CObject_get_target
,$(object
))) \
125 $(foreach object
,$(CXXOBJECTS
),$(call gb_CxxObject_get_target
,$(object
))) \
126 $(foreach object
,$(GENCOBJECTS
),$(call gb_GenCObject_get_target
,$(object
))) \
127 $(foreach object
,$(GENCXXOBJECTS
),$(call gb_GenCxxObject_get_target
,$(object
))) \
128 $(foreach object
,$(ASMOBJECTS
),$(call gb_AsmObject_get_target
,$(object
))) \
129 $(foreach extraobjectlist
,$(EXTRAOBJECTLISTS
),@
$(extraobjectlist
)) \
131 $(if
$(LINKED_STATIC_LIBS
),-Wl
$(COMMA
)--start-group
$(foreach lib
,$(LINKED_STATIC_LIBS
),$(call gb_StaticLibrary_get_target
,$(lib
))) -Wl
$(COMMA
)--end-group
) \
132 $(patsubst lib
%.a
,-l
%,$(patsubst lib
%.dll.a
,-l
%,$(foreach lib
,$(LINKED_LIBS
),$(call gb_Library_get_filename
,$(lib
))))) \
134 -Wl
$(COMMA
)-Map
$(COMMA
)$(basename $(1)).map \
138 define gb_LinkTarget__command_dynamiclinklibrary
139 $(call gb_Helper_abbreviate_dirs
,\
140 mkdir
-p
$(dir $(1)) && \
141 $(if
$(CXXOBJECTS
)$(GENCXXOBJECTS
)$(EXTRAOBJECTLISTS
),$(gb_CXX
),$(gb_CC
)) $(strip \
142 $(gb_Library_TARGETTYPEFLAGS
) \
144 $(foreach object
,$(COBJECTS
),$(call gb_CObject_get_target
,$(object
))) \
145 $(foreach object
,$(CXXOBJECTS
),$(call gb_CxxObject_get_target
,$(object
))) \
146 $(foreach object
,$(GENCOBJECTS
),$(call gb_GenCObject_get_target
,$(object
))) \
147 $(foreach object
,$(GENCXXOBJECTS
),$(call gb_GenCxxObject_get_target
,$(object
))) \
148 $(foreach object
,$(ASMOBJECTS
),$(call gb_AsmObject_get_target
,$(object
))) \
149 $(foreach extraobjectlist
,$(EXTRAOBJECTLISTS
),@
$(extraobjectlist
)) \
151 $(if
$(LINKED_STATIC_LIBS
),-Wl
$(COMMA
)--start-group
$(foreach lib
,$(LINKED_STATIC_LIBS
),$(call gb_StaticLibrary_get_target
,$(lib
))) -Wl
$(COMMA
)--end-group
) \
152 $(patsubst lib
%.a
,-l
%,$(patsubst lib
%.dll.a
,-l
%,$(foreach lib
,$(LINKED_LIBS
),$(call gb_Library_get_filename
,$(lib
))))) \
154 -Wl
$(COMMA
)-Map
$(COMMA
)$(dir $(1))$(notdir $(basename $(DLLTARGET
)).map
) \
155 -Wl
$(COMMA
)--out-implib
$(COMMA
)$(1) \
156 -o
$(dir $(1))/$(notdir $(DLLTARGET
))) \
157 $(if
$(findstring s
,$(MAKEFLAGS
)),> /dev
/null
))
160 define gb_LinkTarget__command_staticlinklibrary
161 $(call gb_Helper_abbreviate_dirs
,\
162 mkdir
-p
$(dir $(1)) && \
165 $(foreach object
,$(COBJECTS
),$(call gb_CObject_get_target
,$(object
))) \
166 $(foreach object
,$(CXXOBJECTS
),$(call gb_CxxObject_get_target
,$(object
))) \
167 $(foreach object
,$(GENCOBJECTS
),$(call gb_GenCObject_get_target
,$(object
))) \
168 $(foreach object
,$(GENCXXOBJECTS
),$(call gb_GenCxxObject_get_target
,$(object
))) \
169 $(foreach extraobjectlist
,$(EXTRAOBJECTLISTS
),@
$(extraobjectlist
)) \
170 $(if
$(findstring s
,$(MAKEFLAGS
)),> /dev
/null
))
173 define gb_LinkTarget__command
174 $(call gb_Output_announce
,$(2),$(true
),LNK
,4)
175 $(if
$(filter Executable
,$(TARGETTYPE
)),$(call gb_LinkTarget__command_dynamiclinkexecutable
,$(1),$(2)))
176 $(if
$(filter Library CppunitTest
,$(TARGETTYPE
)),$(call gb_LinkTarget__command_dynamiclinklibrary
,$(1),$(2)))
177 $(if
$(filter StaticLibrary
,$(TARGETTYPE
)),$(call gb_LinkTarget__command_staticlinklibrary
,$(1)))
180 define gb_LinkTarget_use_system_win32_libs
181 $(call gb_LinkTarget_add_libs
,$(1),$(foreach lib
,$(2),-l
$(patsubst oldnames
,moldname
,$(lib
))))
187 gb_Library_DEFS
:= -D_DLL
188 gb_Library_TARGETTYPEFLAGS
:= -shared
189 gb_Library_get_rpath
:=
191 gb_Library_SYSPRE
:= lib
192 gb_Library_UNOVERPRE
:= $(gb_Library_SYSPRE
)uno_
193 gb_Library_UDK_MAJORVER
:= 3
195 gb_Library_PLAINEXT
:= .dll.a
197 gb_Library_RTEXT
:= gcc3
$(gb_Library_PLAINEXT
)
198 gb_Library_RTVEREXT
:= $(gb_Library_UDK_MAJORVER
)$(gb_Library_RTEXT
)
199 gb_Library_OOOEXT
:= $(gb_Library_DLLPOSTFIX
)$(gb_Library_PLAINEXT
)
200 gb_Library_UNOEXT
:= .uno
$(gb_Library_PLAINEXT
)
201 gb_Library_UNOVEREXT
:= $(gb_Library_UDK_MAJORVER
)$(gb_Library_PLAINEXT
)
203 gb_Library_DLLEXT
:= .dll
205 gb_Library_RTDLLEXT
:= gcc3
$(gb_Library_DLLEXT
)
206 gb_Library_RTVERDLLEXT
:= $(gb_Library_UDK_MAJORVER
)$(gb_Library_RTDLLEXT
)
207 gb_Library_OOODLLEXT
:= $(gb_Library_DLLPOSTFIX
)$(gb_Library_DLLEXT
)
208 gb_Library_UNODLLEXT
:= .uno
$(gb_Library_DLLEXT
)
209 gb_Library_UNOVERDLLEXT
:= $(gb_Library_UDK_MAJORVER
)$(gb_Library_DLLEXT
)
211 gb_Library_LAYER
:= \
212 $(foreach lib
,$(gb_Library_OOOLIBS
),$(lib
):OOO
) \
213 $(foreach lib
,$(gb_Library_PLAINLIBS_NONE
),$(lib
):OOO
) \
214 $(foreach lib
,$(gb_Library_PLAINLIBS_URE
),$(lib
):URELIB
) \
215 $(foreach lib
,$(gb_Library_PLAINLIBS_OOO
),$(lib
):OOO
) \
216 $(foreach lib
,$(gb_Library_PRIVATELIBS_URE
),$(lib
):URELIB
) \
217 $(foreach lib
,$(gb_Library_RTVERLIBS
),$(lib
):URELIB
) \
218 $(foreach lib
,$(gb_Library_UNOLIBS_URE
),$(lib
):URELIB
) \
219 $(foreach lib
,$(gb_Library_UNOVERLIBS
),$(lib
):URELIB
) \
220 $(foreach lib
,$(gb_Library_EXTENSIONLIBS
),$(lib
):OXT
) \
222 gb_Library_FILENAMES
:=\
223 $(foreach lib
,$(gb_Library_OOOLIBS
),$(lib
):$(gb_Library_SYSPRE
)$(lib
)$(gb_Library_OOOEXT
)) \
224 $(foreach lib
,$(gb_Library_PLAINLIBS_NONE
),$(lib
):$(gb_Library_SYSPRE
)$(lib
)$(gb_Library_PLAINEXT
)) \
225 $(foreach lib
,$(gb_Library_PLAINLIBS_URE
),$(lib
):$(gb_Library_SYSPRE
)$(lib
)$(gb_Library_PLAINEXT
)) \
226 $(foreach lib
,$(gb_Library_PLAINLIBS_OOO
),$(lib
):$(gb_Library_SYSPRE
)$(lib
)$(gb_Library_PLAINEXT
)) \
227 $(foreach lib
,$(gb_Library_PRIVATELIBS_URE
),$(lib
):$(lib
)$(gb_Library_OOOEXT
)) \
228 $(foreach lib
,$(gb_Library_RTVERLIBS
),$(lib
):$(gb_Library_SYSPRE
)$(lib
)$(gb_Library_RTVEREXT
)) \
229 $(foreach lib
,$(gb_Library_UNOLIBS_URE
),$(lib
):$(lib
)$(gb_Library_UNOEXT
)) \
230 $(foreach lib
,$(gb_Library_UNOVERLIBS
),$(lib
):$(gb_Library_UNOVERPRE
)$(lib
)$(gb_Library_PLAINEXT
)) \
231 $(foreach lib
,$(gb_Library_EXTENSIONLIBS
),$(lib
):$(lib
)$(gb_Library_UNOEXT
)) \
234 gb_Library_DLLFILENAMES
:=\
235 $(foreach lib
,$(gb_Library_OOOLIBS
),$(lib
):$(lib
)$(gb_Library_OOODLLEXT
)) \
236 $(foreach lib
,$(gb_Library_PLAINLIBS_NONE
),$(lib
):$(lib
)$(gb_Library_DLLEXT
)) \
237 $(foreach lib
,$(gb_Library_PLAINLIBS_URE
),$(lib
):$(lib
)$(gb_Library_DLLEXT
)) \
238 $(foreach lib
,$(gb_Library_PLAINLIBS_OOO
),$(lib
):$(lib
)$(gb_Library_DLLEXT
)) \
239 $(foreach lib
,$(gb_Library_PRIVATELIBS_URE
),$(lib
):$(lib
)$(gb_Library_OOODLLEXT
)) \
240 $(foreach lib
,$(gb_Library_RTVERLIBS
),$(lib
):$(lib
)$(gb_Library_RTVERDLLEXT
)) \
241 $(foreach lib
,$(gb_Library_UNOLIBS_URE
),$(lib
):$(lib
)$(gb_Library_UNODLLEXT
)) \
242 $(foreach lib
,$(gb_Library_UNOVERLIBS
),$(lib
):$(lib
)$(gb_Library_UNOVERDLLEXT
)) \
243 $(foreach lib
,$(gb_Library_EXTENSIONLIBS
),$(lib
):$(lib
)$(gb_Library_UNOEXT
)) \
245 gb_Library_IARCSYSPRE
:= lib
246 gb_Library_IARCEXT
:= .a
248 gb_Library_ILIBEXT
:= .lib
250 define gb_Library_Library_platform
251 $(call gb_LinkTarget_set_dlltarget
,$(2),$(3))
253 $(call gb_Library_get_target
,$(1)) :|
$(OUTDIR
)/bin
/.
dir
255 $(call gb_Library_add_auxtargets
,$(1), \
256 $(OUTDIR
)/bin
/$(notdir $(3)) \
257 $(OUTDIR
)/bin
/$(notdir $(patsubst %.dll
,%.map
,$(3))) \
260 $(call gb_Library_add_default_nativeres
,$(1),$(1)/default
)
264 define gb_Library_add_default_nativeres
265 $(call gb_WinResTarget_WinResTarget_init
,$(2))
266 $(call gb_WinResTarget_set_rcfile
,$(2),include/default
)
267 $(call gb_WinResTarget_add_defs
,$(2),\
268 -DVERVARIANT
="$(LIBO_VERSION_PATCH)" \
269 -DRES_APP_VENDOR
="$(OOO_VENDOR)" \
270 -DADDITIONAL_VERINFO1
="" \
271 -DADDITIONAL_VERINFO2
="" \
272 -DADDITIONAL_VERINFO3
="" \
274 $(call gb_Library_add_nativeres
,$(1),$(2))
275 $(call gb_Library_get_clean_target
,$(1)) : $(call gb_WinResTarget_get_clean_target
,$(2))
279 define gb_LinkTarget_add_nativeres
280 $(call gb_LinkTarget_get_target
,$(1)) : $(call gb_WinResTarget_get_target
,$(2))
281 $(call gb_LinkTarget_get_target
,$(1)) : NATIVERES
+= $(call gb_WinResTarget_get_target
,$(2))
285 define gb_LinkTarget_set_nativeres
286 $(call gb_LinkTarget_get_target
,$(1)) : $(call gb_WinResTarget_get_target
,$(2))
287 $(call gb_LinkTarget_get_target
,$(1)) : NATIVERES
:= $(call gb_WinResTarget_get_target
,$(2))
291 define gb_Library_get_dllname
292 $(patsubst $(1):%,%,$(filter $(1):%,$(gb_Library_DLLFILENAMES
)))
295 # StaticLibrary class
297 gb_StaticLibrary_SYSPRE
:= lib
298 gb_StaticLibrary_PLAINEXT
:= .a
300 gb_StaticLibrary_FILENAMES
:= \
301 $(foreach lib
,$(gb_StaticLibrary_PLAINLIBS
),$(lib
):$(gb_StaticLibrary_SYSPRE
)$(lib
)$(gb_StaticLibrary_PLAINEXT
)) \
303 gb_StaticLibrary_StaticLibrary_platform
=
307 gb_Executable_EXT
:= .exe
308 gb_Executable_TARGETTYPEFLAGS
:=
309 gb_Executable_get_rpath
:=
311 define gb_Executable_Executable_platform
312 $(call gb_LinkTarget_get_target
,$(2)) : TARGETGUI
:=
317 gb_CppunitTest_CPPTESTPRECOMMAND
:= $(gb_Helper_set_ld_path
)
318 gb_CppunitTest_SYSPRE
:= itest_
319 gb_CppunitTest_EXT
:= .lib
320 gb_CppunitTest_get_filename
= $(gb_CppunitTest_SYSPRE
)$(1)$(gb_CppunitTest_EXT
)
321 gb_CppunitTest_get_libfilename
= test_
$(1).dll
323 define gb_CppunitTest_CppunitTest_platform
324 $(call gb_LinkTarget_set_dlltarget
,$(2),$(3))
326 $(call gb_LinkTarget_add_auxtargets
,$(2),\
328 $(patsubst %.dll
,%.map
,$(3)) \
335 gb_WinResTarget_POSTFIX
:=.o
337 define gb_WinResTarget__command
338 $(call gb_Output_announce
,$(2),$(true
),RC
,3)
339 $(call gb_Helper_abbreviate_dirs
,\
340 mkdir
-p
$(dir $(1)) && \
348 gb_WinResTarget_WinResTarget_platform
:=
350 $(eval
$(call gb_Helper_make_dep_targets
,\
354 ifeq ($(gb_FULLDEPS
),$(true
))
355 gb_WinResTarget__command_target
= $(OUTDIR_FOR_BUILD
)/bin
/makedepend
356 define gb_WinResTarget__command_dep
357 $(call gb_Output_announce
,RC
:$(2),$(true
),DEP
,1)
358 $(call gb_Helper_abbreviate_dirs
,\
359 mkdir
-p
$(dir $(1)) && \
360 $(OUTDIR_FOR_BUILD
)/bin
/makedepend \
369 gb_WinResTarget__command_target
=
370 gb_WinResTarget__command_dep
=
373 # InstallModuleTarget class
375 define gb_InstallModuleTarget_InstallModuleTarget_platform
376 $(call gb_InstallModuleTarget_add_defs
,$(1),\
381 $(if
$(filter TRUE
,$(SOLAR_JAVA
)),-DSOLAR_JAVA
) \
386 # InstallScript class
388 gb_InstallScript_EXT
:= .inf
390 # CliAssemblyTarget class
392 gb_CliAssemblyTarget_POLICYEXT
:=
393 gb_CliAssemblyTarget_get_dll
:=
395 # ExtensionTarget class
397 gb_ExtensionTarget_LICENSEFILE_DEFAULT
:= $(OUTDIR
)/bin
/osl
/license.txt
399 # UnpackedTarget class
401 gb_UnpackedTarget_TARFILE_LOCATION
:= $(TARFILE_LOCATION
)
403 # UnoApiHeadersTarget class
405 ifeq ($(DISABLE_DYNLOADING
),TRUE
)
406 gb_UnoApiHeadersTarget_select_variant
= $(if
$(filter udkapi
,$(1)),comprehensive
,$(2))
408 gb_UnoApiHeadersTarget_select_variant
= $(2)
412 gb_Package_PROGRAMDIRNAME
:= program
413 gb_Package_SDKDIRNAME
:= sdk
415 # UIMenubarTarget class
417 define gb_UIMenubarTarget__command
418 $(call gb_Output_announce
,$(2),$(true
),UIM
,1)
423 gb_UIMenubarTarget_UIMenubarTarget_platform
:=
426 gb_PYTHON_PRECOMMAND
:= PATH
="$${PATH}:$(OUTDIR_FOR_BUILD)/bin" PYTHONHOME
="$(OUTDIR_FOR_BUILD)/lib/python" PYTHONPATH
="$(OUTDIR_FOR_BUILD)/lib/python;$(OUTDIR_FOR_BUILD)/lib/python/lib-dynload"
428 include $(GBUILDDIR
)/platform
/com_GCC_class.mk
430 # vim: set noet sw=4: