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 .
22 gb_PROGRAMDIRNAME
:= program
25 $(error You must set CC in the environment. See README.cross for example.
)
28 $(error You must set CXX in the environment. See README.cross for example.
)
31 include $(GBUILDDIR
)/platform
/com_GCC_defs.mk
33 # Darwin mktemp -t expects a prefix, not a pattern
34 gb_MKTEMP
:= /usr
/bin
/mktemp
-t gbuild.
42 -DNO_PTHREAD_PRIORITY \
48 -fno-strict-aliasing \
50 # For -Wno-non-virtual-dtor see <http://markmail.org/message/664jsoqe6n6smy3b>
51 # "Re: [dev] warnings01: -Wnon-virtual-dtor" message to dev@openoffice.org from
54 $(gb_CXXFLAGS_COMMON
) \
55 -Wno-ctor-dtor-privacy \
56 -Wno-non-virtual-dtor \
57 -fno-strict-aliasing \
61 # these are to get gcc to switch to Objective-C++ or Objective-C mode
62 gb_OBJC_OBJCXX_COMMON_FLAGS
:= -fobjc-abi-version
=2 -fobjc-legacy-dispatch
-D__IPHONE_OS_VERSION_MIN_REQUIRED
=40300
64 gb_OBJCXXFLAGS
:= -x objective-c
++ $(gb_OBJC_OBJCXX_COMMON_FLAGS
)
66 gb_OBJCFLAGS
:= -x objective-c
$(gb_OBJC_OBJCXX_COMMON_FLAGS
)
69 -DBOOST_DETAIL_NO_CONTAINER_FWD
71 gb_LinkTarget_LDFLAGS
:= $(SOLARLIB
) \
72 #man ld says: obsolete -Wl,-multiply_defined,suppress \
74 gb_DEBUG_CFLAGS
:= -g
-fno-inline
78 gb_LinkTarget_CFLAGS
:= $(gb_CFLAGS
)
79 gb_LinkTarget_CXXFLAGS
:= $(gb_CXXFLAGS
)
80 gb_LinkTarget_OBJCXXFLAGS
:= $(gb_CXXFLAGS
) $(gb_OBJCXXFLAGS
)
81 gb_LinkTarget_OBJCFLAGS
:= $(gb_CFLAGS
) $(gb_OBJCFLAGS
)
83 ifeq ($(gb_SYMBOL
),$(true
))
84 gb_LinkTarget_CFLAGS
+= $(gb_DEBUG_CFLAGS
)
85 gb_LinkTarget_CXXFLAGS
+= $(gb_DEBUG_CFLAGS
)
86 gb_LinkTarget_OBJCXXFLAGS
+= $(gb_DEBUG_CFLAGS
)
87 gb_LinkTarget_OBJCFLAGS
+= $(gb_DEBUG_CFLAGS
)
90 define gb_LinkTarget__get_liblinkflags
91 $(patsubst lib
%.a
,-l
%,$(foreach lib
,$(1),$(call gb_Library_get_filename
,$(lib
))))
94 define gb_LinkTarget__get_layer
95 $(if
$(filter Executable
,$(1)),\
96 $$(call gb_Executable_get_layer
,$(2)),\
97 $$(call gb_Library_get_layer
,$(2)))
100 # To not export anything: -Wl$(COMMA)-exported_symbols_list$(COMMA)/dev/null
101 # But for some reason that slows down ld significantly.
103 define gb_LinkTarget__command_dynamiclink
104 $(if
$(filter Library CppunitTest
,$(TARGETTYPE
)),@echo No dynamic libraries should be built for iOS
&& exit
1, \
105 mkdir
-p
$(dir $(1)) && \
106 $(if
$(CXXOBJECTS
)$(OBJCXXOBJECTS
)$(GENCXXOBJECTS
)$(EXTRAOBJECTLISTS
),$(gb_CXX
),$(gb_CC
)) \
107 $(gb_Executable_TARGETTYPEFLAGS
) \
108 $(subst \d
,$$,$(RPATH
)) \
110 -dead_strip
-fobjc_link_runtime \
111 $(foreach object
,$(COBJECTS
),$(call gb_CObject_get_target
,$(object
))) \
112 $(foreach object
,$(CXXOBJECTS
),$(call gb_CxxObject_get_target
,$(object
))) \
113 $(foreach object
,$(ASMOBJECTS
),$(call gb_AsmObject_get_target
,$(object
))) \
114 $(foreach object
,$(OBJCOBJECTS
),$(call gb_ObjCObject_get_target
,$(object
))) \
115 $(foreach object
,$(OBJCXXOBJECTS
),$(call gb_ObjCxxObject_get_target
,$(object
))) \
116 $(foreach object
,$(GENCOBJECTS
),$(call gb_GenCObject_get_target
,$(object
))) \
117 $(foreach object
,$(GENCXXOBJECTS
),$(call gb_GenCxxObject_get_target
,$(object
))) \
118 $(foreach extraobjectlist
,$(EXTRAOBJECTLISTS
),`cat $(extraobjectlist)`) \
119 $(foreach lib
,$(LINKED_STATIC_LIBS
),$(call gb_StaticLibrary_get_target
,$(lib
))) \
120 $(call gb_LinkTarget__get_liblinkflags
,$(LINKED_LIBS
)) \
121 $(wildcard $(OUTDIR
)/lib
/*.a
) \
126 # parameters: 1-linktarget 2-cobjects 3-cxxobjects
127 define gb_LinkTarget__command_staticlink
128 $(call gb_Helper_abbreviate_dirs
,\
129 mkdir
-p
$(dir $(1)) && \
132 $(foreach object
,$(COBJECTS
),$(call gb_CObject_get_target
,$(object
))) \
133 $(foreach object
,$(CXXOBJECTS
),$(call gb_CxxObject_get_target
,$(object
))) \
134 $(foreach object
,$(OBJCOBJECTS
),$(call gb_ObjCObject_get_target
,$(object
))) \
135 $(foreach object
,$(OBJCXXOBJECTS
),$(call gb_ObjCxxObject_get_target
,$(object
))) \
136 $(foreach object
,$(ASMOBJECTS
),$(call gb_AsmObject_get_target
,$(object
))) \
137 $(foreach object
,$(GENCOBJECTS
),$(call gb_GenCObject_get_target
,$(object
))) \
138 $(foreach object
,$(GENCXXOBJECTS
),$(call gb_GenCxxObject_get_target
,$(object
))) \
139 $(foreach extraobjectlist
,$(EXTRAOBJECTLISTS
),@
$(extraobjectlist
)) \
140 $(if
$(findstring s
,$(MAKEFLAGS
)),2> /dev
/null
))
143 define gb_LinkTarget__command
144 $(call gb_Output_announce
,$(2),$(true
),LNK
,4)
145 $(if
$(filter Executable
,$(TARGETTYPE
)),$(call gb_LinkTarget__command_dynamiclink
,$(1),$(2)))
146 $(if
$(filter CppunitTest Library StaticLibrary
,$(TARGETTYPE
)),$(call gb_LinkTarget__command_staticlink
,$(1)))
149 define gb_LinkTarget_use_system_darwin_frameworks
150 $(call gb_LinkTarget_add_libs
,$(1),$(foreach fw
,$(2),-framework
$(fw
)))
157 gb_Library_SYSPRE
:= lib
158 gb_Library_UNOVERPRE
:= $(gb_Library_SYSPRE
)uno_
159 gb_Library_PLAINEXT
:= .a
160 gb_Library_DLLEXT
:= .a
161 gb_Library_RTEXT
:= gcc3
$(gb_Library_PLAINEXT
)
163 gb_Library_OOOEXT
:= $(gb_Library_DLLPOSTFIX
)$(gb_Library_PLAINEXT
)
164 gb_Library_UNOEXT
:= .uno
$(gb_Library_PLAINEXT
)
166 gb_Library_FILENAMES
:= \
167 $(foreach lib
,$(gb_Library_OOOLIBS
),$(lib
):$(gb_Library_SYSPRE
)$(lib
)$(gb_Library_OOOEXT
)) \
168 $(foreach lib
,$(gb_Library_PLAINLIBS_NONE
),$(lib
):$(gb_Library_SYSPRE
)$(lib
)$(gb_Library_PLAINEXT
)) \
169 $(foreach lib
,$(gb_Library_PLAINLIBS_URE
),$(lib
):$(gb_Library_SYSPRE
)$(lib
)$(gb_Library_PLAINEXT
)) \
170 $(foreach lib
,$(gb_Library_PLAINLIBS_OOO
),$(lib
):$(gb_Library_SYSPRE
)$(lib
)$(gb_Library_PLAINEXT
)) \
171 $(foreach lib
,$(gb_Library_PRIVATELIBS_URE
),$(lib
):$(gb_Library_SYSPRE
)$(lib
)$(gb_Library_OOOEXT
)) \
172 $(foreach lib
,$(gb_Library_RTVERLIBS
),$(lib
):$(gb_Library_SYSPRE
)$(lib
)$(gb_Library_RTEXT
)) \
173 $(foreach lib
,$(gb_Library_UNOLIBS_URE
),$(lib
):$(lib
)$(gb_Library_UNOEXT
)) \
174 $(foreach lib
,$(gb_Library_UNOVERLIBS
),$(lib
):$(gb_Library_UNOVERPRE
)$(lib
)$(gb_Library_PLAINEXT
)) \
175 $(foreach lib
,$(gb_Library_EXTENSIONLIBS
),$(lib
):$(lib
)$(gb_Library_UNOEXT
)) \
178 gb_Library_LAYER
:= \
179 $(foreach lib
,$(gb_Library_OOOLIBS
),$(lib
):OOO
) \
180 $(foreach lib
,$(gb_Library_PLAINLIBS_URE
),$(lib
):OOO
) \
181 $(foreach lib
,$(gb_Library_PLAINLIBS_OOO
),$(lib
):OOO
) \
182 $(foreach lib
,$(gb_Library_PRIVATELIBS_URE
),$(lib
):OOO
) \
183 $(foreach lib
,$(gb_Library_RTVERLIBS
),$(lib
):OOO
) \
184 $(foreach lib
,$(gb_Library_UNOLIBS_URE
),$(lib
):OOO
) \
185 $(foreach lib
,$(gb_Library_UNOVERLIBS
),$(lib
):OOO
) \
186 $(foreach lib
,$(gb_Library_EXTENSIONLIBS
),$(lib
):OXT
) \
188 define gb_Library_Library_platform
189 $(call gb_LinkTarget_get_target
,$(2)) : LAYER
:= $(call gb_Library_get_layer
,$(1))
194 # StaticLibrary class
196 gb_StaticLibrary_SYSPRE
:= lib
197 gb_StaticLibrary_PLAINEXT
:= .a
199 gb_StaticLibrary_FILENAMES
:= \
200 $(foreach lib
,$(gb_StaticLibrary_PLAINLIBS
),$(lib
):$(gb_StaticLibrary_SYSPRE
)$(lib
)$(gb_StaticLibrary_PLAINEXT
)) \
202 gb_StaticLibrary_StaticLibrary_platform
=
208 gb_Executable_TARGETTYPEFLAGS
:=
210 gb_Executable_LAYER
:= \
211 $(foreach exe
,$(gb_Executable_UREBIN
),$(exe
):OOO
) \
212 $(foreach exe
,$(gb_Executable_SDK
),$(exe
):OOO
) \
213 $(foreach exe
,$(gb_Executable_OOO
),$(exe
):OOO
) \
214 $(foreach exe
,$(gb_Executable_NONE
),$(exe
):OOO
) \
217 define gb_Executable_Executable_platform
218 $(call gb_LinkTarget_get_target
,$(2)) : LAYER
:= $(call gb_Executable_get_layer
,$(1))
225 gb_CppunitTest_CPPTESTPRECOMMAND
:= :
226 gb_CppunitTest_SYSPRE
:= libtest_
227 gb_CppunitTest_EXT
:= .a
228 gb_CppunitTest_LIBDIR
:= $(gb_Helper_OUTDIRLIBDIR
)
229 gb_CppunitTest_get_filename
= $(gb_CppunitTest_SYSPRE
)$(1)$(gb_CppunitTest_EXT
)
230 gb_CppunitTest_get_libfilename
= $(gb_CppunitTest_get_filename
)
232 define gb_CppunitTest_CppunitTest_platform
233 $(call gb_LinkTarget_get_target
,$(2)) : LAYER
:= NONE
237 # InstallModuleTarget class
239 define gb_InstallModuleTarget_InstallModuleTarget_platform
240 $(call gb_InstallModuleTarget_add_defs
,$(1),\
245 $(if
$(filter TRUE
,$(SOLAR_JAVA
)),-DSOLAR_JAVA
) \
250 # InstallScript class
252 gb_InstallScript_EXT
:= .ins
254 # CliAssemblyTarget class
256 gb_CliAssemblyTarget_POLICYEXT
:=
257 gb_CliAssemblyTarget_get_dll
:=
259 # ExtensionTarget class
261 gb_ExtensionTarget_LICENSEFILE_DEFAULT
:= $(OUTDIR
)/bin
/osl
/LICENSE
263 # UnpackedTarget class
265 gb_UnpackedTarget_TARFILE_LOCATION
:= $(TARFILE_LOCATION
)
267 # UnoApiHeadersTarget class
269 ifeq ($(DISABLE_DYNLOADING
),TRUE
)
270 gb_UnoApiHeadersTarget_select_variant
= $(if
$(filter udkapi
,$(1)),comprehensive
,$(2))
272 gb_UnoApiHeadersTarget_select_variant
= $(2)
276 gb_Package_PROGRAMDIRNAME
:= program
277 gb_Package_SDKDIRNAME
:= sdk
279 # UIMenubarTarget class
281 define gb_UIMenubarTarget__command
282 $(call gb_Output_announce
,$(2),$(true
),UIM
,1)
287 gb_UIMenubarTarget_UIMenubarTarget_platform
:=
290 gb_PYTHON_PRECOMMAND
:= DYLD_LIBRARY_PATH
=$(OUTDIR_FOR_BUILD
)/lib
292 include $(GBUILDDIR
)/platform
/com_GCC_class.mk
294 # vim: set noet sw=4: