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/.
10 ifeq ($(gb_FULLDEPS
),$(true
))
11 define gb_cxx_dep_generation_options
12 -MMD
-MT
$(1) -MP
-MF
$(2)_
14 define gb_cxx_dep_copy
18 define gb_cxx_dep_generation_options
20 define gb_cxx_dep_copy
26 gb_AsmObject_get_source
= $(1)/$(2).s
28 # $(call gb_AsmObject__command,object,relative-source,source,dep-file)
29 define gb_AsmObject__command
30 $(call gb_Output_announce
,$(2),$(true
),ASM
,3)
31 $(call gb_Helper_abbreviate_dirs
,\
32 mkdir
-p
$(dir $(1)) $(dir $(4)) && cd
$(SRCDIR
) && \
34 -x assembler-with-cpp \
40 echo
"$(1) : $(3)" > $(4)
45 # $(call gb_CObject__command_pattern,object,flags,source,dep-file,compiler-plugins)
46 define gb_CObject__command_pattern
47 $(call gb_Helper_abbreviate_dirs
,\
48 mkdir
-p
$(dir $(1)) $(dir $(4)) && cd
$(SRCDIR
) && \
49 $(if
$(5),$(gb_COMPILER_PLUGINS_SETUP
)) \
50 $(if
$(filter %.c
%.m
,$(3)), $(gb_CC
), $(gb_CXX
)) \
53 $(if
$(VISIBILITY
),,$(gb_VISIBILITY_FLAGS
)) \
54 $(if
$(WARNINGS_NOT_ERRORS
),,$(gb_CFLAGS_WERROR
)) \
55 $(if
$(5),$(gb_COMPILER_PLUGINS
)) \
57 $(if
$(EXTERNAL_CODE
),$(gb_CXXFLAGS_Wundef
),$(gb_DEFS_INTERNAL
)) \
60 $(call gb_cxx_dep_generation_options
,$(1),$(4)) \
64 $(call gb_cxx_dep_copy
,$(4)) \
68 # Used to run a compiler plugin tool.
69 # $(call gb_CObject__tool_command,relative-source,source)
70 define gb_CObject__tool_command
71 $(call gb_Output_announce
,$(1).c
,$(true
),C
,3)
72 $(call gb_Helper_abbreviate_dirs
,\
73 ICECC
=no CCACHE_DISABLE
=1 \
77 $(if
$(VISIBILITY
),,$(gb_VISIBILITY_FLAGS
)) \
78 $(if
$(WARNINGS_NOT_ERRORS
),,$(gb_CFLAGS_WERROR
)) \
79 $(gb_COMPILER_PLUGINS
) \
80 $(T_CFLAGS
) $(T_CFLAGS_APPEND
) \
81 $(if
$(EXTERNAL_CODE
),$(gb_CXXFLAGS_Wundef
),$(gb_DEFS_INTERNAL
)) \
87 define gb_ObjCObject__tool_command
88 $(call gb_Output_announce
,$(1).m
,$(true
),OCC
,3)
89 $(call gb_Helper_abbreviate_dirs
,\
90 ICECC
=no CCACHE_DISABLE
=1 \
94 $(if
$(VISIBILITY
),,$(gb_VISIBILITY_FLAGS
)) \
95 $(if
$(WARNINGS_NOT_ERRORS
),,$(gb_CFLAGS_WERROR
)) \
96 $(gb_COMPILER_PLUGINS
) \
97 $(T_OBJCFLAGS
) $(T_OBJCFLAGS_APPEND
) \
98 $(if
$(EXTERNAL_CODE
),$(gb_CXXFLAGS_Wundef
),$(gb_DEFS_INTERNAL
)) \
105 # Used to run a compiler plugin tool.
106 # $(call gb_CxxObject__tool_command,relative-source,source)
107 define gb_CxxObject__tool_command
108 $(call gb_Output_announce
,$(1).
cxx,$(true
),CXX
,3)
109 $(call gb_Helper_abbreviate_dirs
,\
110 ICECC
=no CCACHE_DISABLE
=1 \
114 $(if
$(VISIBILITY
),,$(gb_VISIBILITY_FLAGS
)) \
115 $(if
$(WARNINGS_NOT_ERRORS
),,$(gb_CFLAGS_WERROR
)) \
116 $(gb_COMPILER_PLUGINS
) \
117 $(T_CXXFLAGS
) $(T_CXXFLAGS_APPEND
) \
118 $(if
$(EXTERNAL_CODE
),$(gb_CXXFLAGS_Wundef
),$(gb_DEFS_INTERNAL
)) \
124 define gb_ObjCxxObject__tool_command
125 $(call gb_Output_announce
,$(1).mm
,$(true
),OCX
,3)
126 $(call gb_Helper_abbreviate_dirs
,\
127 ICECC
=no CCACHE_DISABLE
=1 \
131 $(if
$(VISIBILITY
),,$(gb_VISIBILITY_FLAGS
)) \
132 $(if
$(WARNINGS_NOT_ERRORS
),,$(gb_CFLAGS_WERROR
)) \
133 $(gb_COMPILER_PLUGINS
) \
134 $(T_OBJCXXFLAGS
) $(T_OBJCXXFLAGS_APPEND
) \
135 $(if
$(EXTERNAL_CODE
),$(gb_CXXFLAGS_Wundef
),$(gb_DEFS_INTERNAL
)) \
142 define gb_SrsPartTarget__command_dep
143 $(call gb_Helper_abbreviate_dirs
,\
144 mkdir
-p
$(dir $(call gb_SrsPartTarget_get_dep_target
,$(1))) && cd
$(SRCDIR
) && \
146 -MM
-MP
-MT
$(call gb_SrsPartTarget_get_target
,$(1)) \
149 -c
-x c
++-header
$(2) \
150 -o
$(call gb_SrsPartTarget_get_dep_target
,$(1)))
153 # PrecompiledHeader class
155 ifeq ($(COM_GCC_IS_CLANG
),TRUE
)
156 gb_PrecompiledHeader_get_enableflags
= -include-pch
$(call gb_PrecompiledHeader_get_target
,$(1))
158 gb_PrecompiledHeader_get_enableflags
= -include $(notdir $(subst .gch
,,$(call gb_PrecompiledHeader_get_target
,$(1)))) \
159 -I
$(dir $(call gb_PrecompiledHeader_get_target
,$(1)))
162 # Clang and gcc do not need any extra .o file for PCH
163 gb_PrecompiledHeader_get_objectfile
=
165 define gb_PrecompiledHeader__command
166 $(call gb_Output_announce
,$(2),$(true
),PCH
,1)
167 $(call gb_Helper_abbreviate_dirs
,\
168 mkdir
-p
$(dir $(1)) $(dir $(call gb_PrecompiledHeader_get_dep_target
,$(2))) && \
172 $(gb_COMPILERDEPFLAGS
) \
173 $(if
$(VISIBILITY
),,$(gb_VISIBILITY_FLAGS
)) \
174 $(if
$(EXTERNAL_CODE
),$(gb_CXXFLAGS_Wundef
),$(gb_DEFS_INTERNAL
)) \
176 $(call gb_cxx_dep_generation_options
,$(1),$(call gb_PrecompiledHeader_get_dep_target_tmp
,$(2))) \
177 -c
$(patsubst %.
cxx,%.hxx
,$(3)) \
179 $(call gb_cxx_dep_copy
,$(call gb_PrecompiledHeader_get_dep_target_tmp
,$(2))) \
185 define gb_YaccTarget__command
186 $(call gb_Output_announce
,$(2),$(true
),YAC
,3)
187 $(call gb_Helper_abbreviate_dirs
,\
188 mkdir
-p
$(dir $(3)) && \
189 $(gb_YACC
) $(T_YACCFLAGS
) -v
--defines
=$(4) -o
$(5) $(1) && touch
$(3) )
193 # ExternalProject class
195 gb_ExternalProject_use_autoconf
:=
196 gb_ExternalProject_use_nmake
:=
198 # StaticLibrary class
200 gb_StaticLibrary_get_filename
= lib
$(1).a
201 gb_StaticLibrary_PLAINEXT
:= .a
202 gb_StaticLibrary_StaticLibrary_platform
:=
204 gb_LinkTarget_get_linksearchpath_for_layer
= \
205 -L
$(WORKDIR
)/LinkTarget
/StaticLibrary \
206 -L
$(call gb_Library_get_sdk_link_dir
) \
208 $(subst +, ,$(patsubst $(1):%.
,%,\
209 $(filter $(1):%.
,$(gb_LinkTarget_LAYER_LINKPATHS
)))),\
210 $(patsubst $(layer
):%,-L
%,\
211 $(filter $(layer
):%,$(gb_Library_LAYER_DIRS
))))
214 gb_ICU_PRECOMMAND
:= $(call gb_Helper_extend_ld_path
,$(WORKDIR_FOR_BUILD
)/UnpackedTarball
/icu
/source
/lib
)
218 # Mac OS X sort(1) cannot read a response file
219 define gb_UIConfig__command
220 $(call gb_Helper_abbreviate_dirs
,\
221 sort -u
$(UI_IMAGELISTS
) /dev
/null
> $@ \
226 # vim: set noet sw=4 ts=4: