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 .
21 $(error You must set CC in the environment. See README.cross for example.
)
24 $(error You must set CXX in the environment. See README.cross for example.
)
27 gb_COMPILEROPTFLAGS
:= -Oz
29 include $(GBUILDDIR
)/platform
/com_GCC_defs.mk
31 # Use standard lldb debugger
33 gb_LINKER_DEBUGINFO_FLAGS
=
35 # Darwin mktemp -t expects a prefix, not a pattern
36 gb_MKTEMP
:= /usr
/bin
/mktemp
-t gbuild.
44 -DNO_PTHREAD_PRIORITY \
50 -fno-strict-aliasing \
53 $(gb_CXXFLAGS_COMMON
) \
54 -Wno-ctor-dtor-privacy \
55 -fno-strict-aliasing \
59 # These are to get the compiler to switch to Objective-C++ or Objective-C mode
60 gb_OBJCXXFLAGS
:= -x objective-c
++
61 gb_OBJCFLAGS
:= -x objective-c
64 -DBOOST_DETAIL_NO_CONTAINER_FWD
68 gb_LinkTarget_CFLAGS
:= $(gb_CFLAGS
)
69 gb_LinkTarget_CXXFLAGS
:= $(gb_CXXFLAGS
)
70 gb_LinkTarget_OBJCXXFLAGS
:= $(gb_CXXFLAGS
) $(gb_OBJCXXFLAGS
)
71 gb_LinkTarget_OBJCFLAGS
:= $(gb_CFLAGS
) $(gb_OBJCFLAGS
)
73 define gb_LinkTarget__get_liblinkflags
74 $(patsubst lib
%.a
,-l
%,$(foreach lib
,$(1),$(call gb_Library_get_filename
,$(lib
))))
77 define gb_LinkTarget__get_layer
78 $(if
$(filter Executable
,$(1)),\
79 $$(call gb_Executable_get_layer
,$(2)),\
80 $$(call gb_Library_get_layer
,$(2)))
83 # To not export anything: -Wl$(COMMA)-exported_symbols_list$(COMMA)/dev/null
84 # But for some reason that slows down ld significantly.
86 define gb_LinkTarget__command_dynamiclink
87 $(if
$(filter Library CppunitTest
,$(TARGETTYPE
)),@echo No dynamic libraries should be built for iOS
&& exit
1, \
88 $(if
$(CXXOBJECTS
)$(OBJCXXOBJECTS
)$(GENCXXOBJECTS
)$(EXTRAOBJECTLISTS
),$(gb_CXX
),$(gb_CC
)) \
89 $(gb_Executable_TARGETTYPEFLAGS
) \
90 $(subst \d
,$$,$(RPATH
)) \
93 $(foreach object
,$(COBJECTS
),$(call gb_CObject_get_target
,$(object
))) \
94 $(foreach object
,$(CXXOBJECTS
),$(call gb_CxxObject_get_target
,$(object
))) \
95 $(foreach object
,$(ASMOBJECTS
),$(call gb_AsmObject_get_target
,$(object
))) \
96 $(foreach object
,$(OBJCOBJECTS
),$(call gb_ObjCObject_get_target
,$(object
))) \
97 $(foreach object
,$(OBJCXXOBJECTS
),$(call gb_ObjCxxObject_get_target
,$(object
))) \
98 $(foreach object
,$(GENCOBJECTS
),$(call gb_GenCObject_get_target
,$(object
))) \
99 $(foreach object
,$(GENCXXOBJECTS
),$(call gb_GenCxxObject_get_target
,$(object
))) \
100 $(foreach extraobjectlist
,$(EXTRAOBJECTLISTS
),`cat $(extraobjectlist)`) \
101 $(foreach lib
,$(LINKED_STATIC_LIBS
),$(call gb_StaticLibrary_get_target
,$(lib
))) \
102 $(call gb_LinkTarget__get_liblinkflags
,$(LINKED_LIBS
)) \
103 $(shell $(SRCDIR
)/bin
/lo-all-static-libs
) \
108 # parameters: 1-linktarget 2-cobjects 3-cxxobjects
109 define gb_LinkTarget__command_staticlink
110 $(call gb_Helper_abbreviate_dirs
,\
113 $(foreach object
,$(COBJECTS
),$(call gb_CObject_get_target
,$(object
))) \
114 $(foreach object
,$(CXXOBJECTS
),$(call gb_CxxObject_get_target
,$(object
))) \
115 $(foreach object
,$(OBJCOBJECTS
),$(call gb_ObjCObject_get_target
,$(object
))) \
116 $(foreach object
,$(OBJCXXOBJECTS
),$(call gb_ObjCxxObject_get_target
,$(object
))) \
117 $(foreach object
,$(ASMOBJECTS
),$(call gb_AsmObject_get_target
,$(object
))) \
118 $(foreach object
,$(GENCOBJECTS
),$(call gb_GenCObject_get_target
,$(object
))) \
119 $(foreach object
,$(GENCXXOBJECTS
),$(call gb_GenCxxObject_get_target
,$(object
))) \
120 $(foreach extraobjectlist
,$(EXTRAOBJECTLISTS
),@
$(extraobjectlist
)) \
121 $(if
$(findstring s
,$(MAKEFLAGS
)),2> /dev
/null
))
124 define gb_LinkTarget__command
125 $(call gb_Output_announce
,$(2),$(true
),LNK
,4)
126 $(if
$(filter Executable
,$(TARGETTYPE
)),$(call gb_LinkTarget__command_dynamiclink
,$(1),$(2)))
127 $(if
$(filter CppunitTest Library StaticLibrary
,$(TARGETTYPE
)),$(call gb_LinkTarget__command_staticlink
,$(1)))
130 define gb_LinkTarget_use_system_darwin_frameworks
131 $(call gb_LinkTarget_add_libs
,$(1),$(foreach fw
,$(2),-framework
$(fw
)))
132 $(if
$(call gb_LinkTarget__is_merged
,$(1)),\
133 $(call gb_LinkTarget_add_libs
,$(call gb_Library_get_linktarget
,merged
),$(foreach fw
,$(2),-framework
$(fw
))))
140 gb_Library_SYSPRE
:= lib
141 gb_Library_UNOVERPRE
:= $(gb_Library_SYSPRE
)uno_
142 gb_Library_PLAINEXT
:= .a
143 gb_Library_DLLEXT
:= .a
144 gb_Library_RTEXT
:= gcc3
$(gb_Library_PLAINEXT
)
146 gb_Library_OOOEXT
:= $(gb_Library_DLLPOSTFIX
)$(gb_Library_PLAINEXT
)
147 gb_Library_UNOEXT
:= .uno
$(gb_Library_PLAINEXT
)
149 gb_Library_FILENAMES
:= \
150 $(foreach lib
,$(gb_Library_OOOLIBS
),$(lib
):$(gb_Library_SYSPRE
)$(lib
)$(gb_Library_OOOEXT
)) \
151 $(foreach lib
,$(gb_Library_PLAINLIBS_NONE
),$(lib
):$(gb_Library_SYSPRE
)$(lib
)$(gb_Library_PLAINEXT
)) \
152 $(foreach lib
,$(gb_Library_PLAINLIBS_URE
),$(lib
):$(gb_Library_SYSPRE
)$(lib
)$(gb_Library_PLAINEXT
)) \
153 $(foreach lib
,$(gb_Library_PLAINLIBS_OOO
),$(lib
):$(gb_Library_SYSPRE
)$(lib
)$(gb_Library_PLAINEXT
)) \
154 $(foreach lib
,$(gb_Library_PLAINLIBS_OXT
),$(lib
):$(gb_Library_SYSPRE
)$(lib
)$(gb_Library_PLAINEXT
)) \
155 $(foreach lib
,$(gb_Library_PRIVATELIBS_URE
),$(lib
):$(gb_Library_SYSPRE
)$(lib
)$(gb_Library_OOOEXT
)) \
156 $(foreach lib
,$(gb_Library_RTVERLIBS
),$(lib
):$(gb_Library_SYSPRE
)$(lib
)$(gb_Library_RTEXT
)) \
157 $(foreach lib
,$(gb_Library_UNOVERLIBS
),$(lib
):$(gb_Library_UNOVERPRE
)$(lib
)$(gb_Library_PLAINEXT
)) \
158 $(foreach lib
,$(gb_Library_EXTENSIONLIBS
),$(lib
):$(lib
)$(gb_Library_UNOEXT
)) \
161 gb_Library_LAYER
:= \
162 $(foreach lib
,$(gb_Library_OOOLIBS
),$(lib
):OOO
) \
163 $(foreach lib
,$(gb_Library_PLAINLIBS_URE
),$(lib
):OOO
) \
164 $(foreach lib
,$(gb_Library_PLAINLIBS_OOO
),$(lib
):OOO
) \
165 $(foreach lib
,$(gb_Library_PLAINLIBS_OXT
),$(lib
):OXT
) \
166 $(foreach lib
,$(gb_Library_PLAINLIBS_NONE
),$(lib
):NONE
) \
167 $(foreach lib
,$(gb_Library_PRIVATELIBS_URE
),$(lib
):OOO
) \
168 $(foreach lib
,$(gb_Library_RTVERLIBS
),$(lib
):OOO
) \
169 $(foreach lib
,$(gb_Library_UNOVERLIBS
),$(lib
):OOO
) \
170 $(foreach lib
,$(gb_Library_EXTENSIONLIBS
),$(lib
):OXT
) \
172 define gb_Library_Library_platform
173 $(call gb_LinkTarget_get_target
,$(2)) : LAYER
:= $(call gb_Library_get_layer
,$(1))
177 gb_Library__set_soversion_script_platform
=
179 gb_Library_get_sdk_link_dir
= $(WORKDIR
)/LinkTarget
/Library
184 gb_Executable_TARGETTYPEFLAGS
:=
186 gb_Executable_LAYER
:= \
187 $(foreach exe
,$(gb_Executable_UREBIN
),$(exe
):UREBIN
) \
188 $(foreach exe
,$(gb_Executable_SDK
),$(exe
):SDKBIN
) \
189 $(foreach exe
,$(gb_Executable_OOO
),$(exe
):OOO
) \
190 $(foreach exe
,$(gb_Executable_NONE
),$(exe
):NONE
) \
193 define gb_Executable_Executable_platform
194 $(call gb_LinkTarget_get_target
,$(2)) : LAYER
:= $(call gb_Executable_get_layer
,$(1))
201 gb_CppunitTest_CPPTESTPRECOMMAND
:= :
202 gb_CppunitTest_get_filename
= libtest_
(1).a
203 gb_CppunitTest_get_ilibfilename
= $(gb_CppunitTest_get_filename
)
205 define gb_CppunitTest_CppunitTest_platform
206 $(call gb_LinkTarget_get_target
,$(2)) : LAYER
:= NONE
210 # InstallModuleTarget class
212 define gb_InstallModuleTarget_InstallModuleTarget_platform
213 $(call gb_InstallModuleTarget_add_defs
,$(1),\
222 # InstallScript class
224 gb_InstallScript_EXT
:= .ins
226 # CliAssemblyTarget class
228 gb_CliAssemblyTarget_POLICYEXT
:=
229 gb_CliAssemblyTarget_get_dll
:=
233 gb_Extension_LICENSEFILE_DEFAULT
:= $(INSTROOT
)/LICENSE
235 # UnpackedTarget class
237 gb_UnpackedTarget_TARFILE_LOCATION
:= $(TARFILE_LOCATION
)
239 # UnoApiHeadersTarget class
241 ifeq ($(DISABLE_DYNLOADING
),TRUE
)
242 gb_UnoApiHeadersTarget_select_variant
= $(if
$(filter udkapi
,$(1)),comprehensive
,$(2))
244 gb_UnoApiHeadersTarget_select_variant
= $(2)
247 # UIMenubarTarget class
249 define gb_UIMenubarTarget__command
250 $(call gb_Output_announce
,$(2),$(true
),UIM
,1)
255 gb_UIMenubarTarget_UIMenubarTarget_platform
:=
258 gb_PYTHON_PRECOMMAND
:=
260 include $(GBUILDDIR
)/platform
/com_GCC_class.mk
262 # vim: set noet sw=4: