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 .
23 $(error You must set CC in the environment. See README.cross for example.
)
26 $(error You must set CXX in the environment. See README.cross for example.
)
29 gb_COMPILEROPTFLAGS
:= -Oz
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 \
51 $(gb_CXXFLAGS_COMMON
) \
52 -Wno-ctor-dtor-privacy \
53 -fno-strict-aliasing \
57 # These are to get the compiler to switch to Objective-C++ or Objective-C mode
58 gb_OBJCXXFLAGS
:= -x objective-c
++
59 gb_OBJCFLAGS
:= -x objective-c
62 -DBOOST_DETAIL_NO_CONTAINER_FWD
64 gb_DEBUG_CFLAGS
:= -g
-fno-inline
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 ifeq ($(gb_SYMBOL
),$(true
))
74 gb_LinkTarget_CFLAGS
+= -g
75 gb_LinkTarget_CXXFLAGS
+= -g
76 gb_LinkTarget_OBJCXXFLAGS
+= -g
77 gb_LinkTarget_OBJCFLAGS
+= -g
80 define gb_LinkTarget__get_liblinkflags
81 $(patsubst lib
%.a
,-l
%,$(foreach lib
,$(1),$(call gb_Library_get_filename
,$(lib
))))
84 define gb_LinkTarget__get_layer
85 $(if
$(filter Executable
,$(1)),\
86 $$(call gb_Executable_get_layer
,$(2)),\
87 $$(call gb_Library_get_layer
,$(2)))
90 # To not export anything: -Wl$(COMMA)-exported_symbols_list$(COMMA)/dev/null
91 # But for some reason that slows down ld significantly.
93 define gb_LinkTarget__command_dynamiclink
94 $(if
$(filter Library CppunitTest
,$(TARGETTYPE
)),@echo No dynamic libraries should be built for iOS
&& exit
1, \
95 $(if
$(CXXOBJECTS
)$(OBJCXXOBJECTS
)$(GENCXXOBJECTS
)$(EXTRAOBJECTLISTS
),$(gb_CXX
),$(gb_CC
)) \
96 $(gb_Executable_TARGETTYPEFLAGS
) \
97 $(subst \d
,$$,$(RPATH
)) \
100 $(foreach object
,$(COBJECTS
),$(call gb_CObject_get_target
,$(object
))) \
101 $(foreach object
,$(CXXOBJECTS
),$(call gb_CxxObject_get_target
,$(object
))) \
102 $(foreach object
,$(ASMOBJECTS
),$(call gb_AsmObject_get_target
,$(object
))) \
103 $(foreach object
,$(OBJCOBJECTS
),$(call gb_ObjCObject_get_target
,$(object
))) \
104 $(foreach object
,$(OBJCXXOBJECTS
),$(call gb_ObjCxxObject_get_target
,$(object
))) \
105 $(foreach object
,$(GENCOBJECTS
),$(call gb_GenCObject_get_target
,$(object
))) \
106 $(foreach object
,$(GENCXXOBJECTS
),$(call gb_GenCxxObject_get_target
,$(object
))) \
107 $(foreach extraobjectlist
,$(EXTRAOBJECTLISTS
),`cat $(extraobjectlist)`) \
108 $(foreach lib
,$(LINKED_STATIC_LIBS
),$(call gb_StaticLibrary_get_target
,$(lib
))) \
109 $(call gb_LinkTarget__get_liblinkflags
,$(LINKED_LIBS
)) \
110 $(shell $(SRCDIR
)/bin
/lo-all-static-libs
) \
115 # parameters: 1-linktarget 2-cobjects 3-cxxobjects
116 define gb_LinkTarget__command_staticlink
117 $(call gb_Helper_abbreviate_dirs
,\
120 $(foreach object
,$(COBJECTS
),$(call gb_CObject_get_target
,$(object
))) \
121 $(foreach object
,$(CXXOBJECTS
),$(call gb_CxxObject_get_target
,$(object
))) \
122 $(foreach object
,$(OBJCOBJECTS
),$(call gb_ObjCObject_get_target
,$(object
))) \
123 $(foreach object
,$(OBJCXXOBJECTS
),$(call gb_ObjCxxObject_get_target
,$(object
))) \
124 $(foreach object
,$(ASMOBJECTS
),$(call gb_AsmObject_get_target
,$(object
))) \
125 $(foreach object
,$(GENCOBJECTS
),$(call gb_GenCObject_get_target
,$(object
))) \
126 $(foreach object
,$(GENCXXOBJECTS
),$(call gb_GenCxxObject_get_target
,$(object
))) \
127 $(foreach extraobjectlist
,$(EXTRAOBJECTLISTS
),@
$(extraobjectlist
)) \
128 $(if
$(findstring s
,$(MAKEFLAGS
)),2> /dev
/null
))
131 define gb_LinkTarget__command
132 $(call gb_Output_announce
,$(2),$(true
),LNK
,4)
133 $(if
$(filter Executable
,$(TARGETTYPE
)),$(call gb_LinkTarget__command_dynamiclink
,$(1),$(2)))
134 $(if
$(filter CppunitTest Library StaticLibrary
,$(TARGETTYPE
)),$(call gb_LinkTarget__command_staticlink
,$(1)))
137 define gb_LinkTarget_use_system_darwin_frameworks
138 $(call gb_LinkTarget_add_libs
,$(1),$(foreach fw
,$(2),-framework
$(fw
)))
139 $(if
$(call gb_LinkTarget__is_merged
,$(1)),\
140 $(call gb_LinkTarget_add_libs
,$(call gb_Library_get_linktarget
,merged
),$(foreach fw
,$(2),-framework
$(fw
))))
147 gb_Library_SYSPRE
:= lib
148 gb_Library_UNOVERPRE
:= $(gb_Library_SYSPRE
)uno_
149 gb_Library_PLAINEXT
:= .a
150 gb_Library_DLLEXT
:= .a
151 gb_Library_RTEXT
:= gcc3
$(gb_Library_PLAINEXT
)
153 gb_Library_OOOEXT
:= $(gb_Library_DLLPOSTFIX
)$(gb_Library_PLAINEXT
)
154 gb_Library_UNOEXT
:= .uno
$(gb_Library_PLAINEXT
)
156 gb_Library_FILENAMES
:= \
157 $(foreach lib
,$(gb_Library_OOOLIBS
),$(lib
):$(gb_Library_SYSPRE
)$(lib
)$(gb_Library_OOOEXT
)) \
158 $(foreach lib
,$(gb_Library_PLAINLIBS_NONE
),$(lib
):$(gb_Library_SYSPRE
)$(lib
)$(gb_Library_PLAINEXT
)) \
159 $(foreach lib
,$(gb_Library_PLAINLIBS_URE
),$(lib
):$(gb_Library_SYSPRE
)$(lib
)$(gb_Library_PLAINEXT
)) \
160 $(foreach lib
,$(gb_Library_PLAINLIBS_OOO
),$(lib
):$(gb_Library_SYSPRE
)$(lib
)$(gb_Library_PLAINEXT
)) \
161 $(foreach lib
,$(gb_Library_PRIVATELIBS_URE
),$(lib
):$(gb_Library_SYSPRE
)$(lib
)$(gb_Library_OOOEXT
)) \
162 $(foreach lib
,$(gb_Library_RTVERLIBS
),$(lib
):$(gb_Library_SYSPRE
)$(lib
)$(gb_Library_RTEXT
)) \
163 $(foreach lib
,$(gb_Library_UNOVERLIBS
),$(lib
):$(gb_Library_UNOVERPRE
)$(lib
)$(gb_Library_PLAINEXT
)) \
164 $(foreach lib
,$(gb_Library_EXTENSIONLIBS
),$(lib
):$(lib
)$(gb_Library_UNOEXT
)) \
167 gb_Library_LAYER
:= \
168 $(foreach lib
,$(gb_Library_OOOLIBS
),$(lib
):OOO
) \
169 $(foreach lib
,$(gb_Library_PLAINLIBS_URE
),$(lib
):OOO
) \
170 $(foreach lib
,$(gb_Library_PLAINLIBS_OOO
),$(lib
):OOO
) \
171 $(foreach lib
,$(gb_Library_PLAINLIBS_NONE
),$(lib
):NONE
) \
172 $(foreach lib
,$(gb_Library_PRIVATELIBS_URE
),$(lib
):OOO
) \
173 $(foreach lib
,$(gb_Library_RTVERLIBS
),$(lib
):OOO
) \
174 $(foreach lib
,$(gb_Library_UNOVERLIBS
),$(lib
):OOO
) \
175 $(foreach lib
,$(gb_Library_EXTENSIONLIBS
),$(lib
):OXT
) \
177 define gb_Library_Library_platform
178 $(call gb_LinkTarget_get_target
,$(2)) : LAYER
:= $(call gb_Library_get_layer
,$(1))
182 gb_Library__set_soversion_script_platform
=
184 gb_Library_get_sdk_link_dir
= $(WORKDIR
)/LinkTarget
/Library
189 gb_Executable_TARGETTYPEFLAGS
:=
191 gb_Executable_LAYER
:= \
192 $(foreach exe
,$(gb_Executable_UREBIN
),$(exe
):UREBIN
) \
193 $(foreach exe
,$(gb_Executable_SDK
),$(exe
):SDKBIN
) \
194 $(foreach exe
,$(gb_Executable_OOO
),$(exe
):OOO
) \
195 $(foreach exe
,$(gb_Executable_NONE
),$(exe
):NONE
) \
198 define gb_Executable_Executable_platform
199 $(call gb_LinkTarget_get_target
,$(2)) : LAYER
:= $(call gb_Executable_get_layer
,$(1))
206 gb_CppunitTest_CPPTESTPRECOMMAND
:= :
207 gb_CppunitTest_get_filename
= libtest_
(1).a
208 gb_CppunitTest_get_ilibfilename
= $(gb_CppunitTest_get_filename
)
210 define gb_CppunitTest_CppunitTest_platform
211 $(call gb_LinkTarget_get_target
,$(2)) : LAYER
:= NONE
215 # InstallModuleTarget class
217 define gb_InstallModuleTarget_InstallModuleTarget_platform
218 $(call gb_InstallModuleTarget_add_defs
,$(1),\
227 # InstallScript class
229 gb_InstallScript_EXT
:= .ins
231 # CliAssemblyTarget class
233 gb_CliAssemblyTarget_POLICYEXT
:=
234 gb_CliAssemblyTarget_get_dll
:=
238 gb_Extension_LICENSEFILE_DEFAULT
:= $(INSTROOT
)/LICENSE
240 # UnpackedTarget class
242 gb_UnpackedTarget_TARFILE_LOCATION
:= $(TARFILE_LOCATION
)
244 # UnoApiHeadersTarget class
246 ifeq ($(DISABLE_DYNLOADING
),TRUE
)
247 gb_UnoApiHeadersTarget_select_variant
= $(if
$(filter udkapi
,$(1)),comprehensive
,$(2))
249 gb_UnoApiHeadersTarget_select_variant
= $(2)
252 # UIMenubarTarget class
254 define gb_UIMenubarTarget__command
255 $(call gb_Output_announce
,$(2),$(true
),UIM
,1)
260 gb_UIMenubarTarget_UIMenubarTarget_platform
:=
263 gb_PYTHON_PRECOMMAND
:=
265 include $(GBUILDDIR
)/platform
/com_GCC_class.mk
267 # vim: set noet sw=4: