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 ifneq (,$(CCACHE_HARDLINK
))
12 # cannot move hardlink over itself, so create dep file directly, even if that
13 # might leave a broken file behind in case the build is interrupted forcefully
14 define gb_cxx_dep_generation_options
15 -MMD
-MT
$(1) -MP
-MF
$(2)
17 define gb_cxx_dep_copy
20 define gb_cxx_dep_generation_options
21 -MMD
-MT
$(1) -MP
-MF
$(2)_
23 define gb_cxx_dep_copy
28 define gb_cxx_dep_generation_options
30 define gb_cxx_dep_copy
36 gb_AsmObject_get_source
= $(1)/$(2).s
38 # $(call gb_AsmObject__command,object,relative-source,source,dep-file)
39 define gb_AsmObject__command
40 $(call gb_Output_announce
,$(2),$(true
),ASM
,3)
41 $(call gb_Helper_abbreviate_dirs
,\
42 mkdir
-p
$(dir $(1)) $(dir $(4)) && cd
$(SRCDIR
) && \
44 -x assembler-with-cpp \
50 echo
"$(1) : $(3)" > $(4)
55 # $(call gb_CObject__command_pattern,object,flags,source,dep-file,compiler-plugins,symbols)
56 define gb_CObject__command_pattern
57 $(call gb_Helper_abbreviate_dirs
,\
58 mkdir
-p
$(dir $(1)) $(dir $(4)) && cd
$(SRCDIR
) && \
59 $(gb_COMPILER_SETUP
) \
60 $(if
$(5),$(gb_COMPILER_PLUGINS_SETUP
)) \
61 $(if
$(filter %.c
%.m
,$(3)), $(gb_CC
), $(gb_CXX
)) \
64 $(if
$(VISIBILITY
),,$(gb_VISIBILITY_FLAGS
)) \
65 $(if
$(WARNINGS_NOT_ERRORS
),$(if
$(ENABLE_WERROR
),$(if
$(PLUGIN_WARNINGS_AS_ERRORS
),$(gb_COMPILER_PLUGINS_WARNINGS_AS_ERRORS
))),$(gb_CFLAGS_WERROR
)) \
66 $(if
$(5),$(gb_COMPILER_PLUGINS
)) \
67 $(if
$(COMPILER_TEST
),-fsyntax-only
-ferror-limit
=0 -Xclang
-verify
) \
69 $(if
$(WARNINGS_DISABLED
),$(gb_CXXFLAGS_DISABLE_WARNINGS
)) \
70 $(if
$(EXTERNAL_CODE
),$(gb_CXXFLAGS_Wundef
),$(gb_DEFS_INTERNAL
)) \
73 $(if
$(COMPILER_TEST
),,$(call gb_cxx_dep_generation_options
,$(1),$(4))) \
76 $(if
$(COMPILER_TEST
),,$(call gb_cxx_dep_copy
,$(4))) \
80 # PrecompiledHeader class
82 ifeq ($(COM_IS_CLANG
),TRUE
)
83 gb_PrecompiledHeader_get_enableflags
= -include-pch
$(call gb_PrecompiledHeader_get_target
,$(1),$(2))
84 gb_PrecompiledHeader_EXT
:= .pch
86 gb_PrecompiledHeader_get_enableflags
= \
87 -include $(dir $(call gb_PrecompiledHeader_get_target
,$(1),$(2)))$(notdir $(subst .gch
,,$(call gb_PrecompiledHeader_get_target
,$(1),$(2))))
88 gb_PrecompiledHeader_EXT
:= .gch
91 # Clang and gcc do not need any extra .o file for PCH
92 gb_PrecompiledHeader_get_objectfile
=
94 define gb_PrecompiledHeader__command
95 $(call gb_Output_announce
,$(2),$(true
),PCH
,1)
96 $(call gb_Helper_abbreviate_dirs
,\
97 mkdir
-p
$(dir $(1)) $(dir $(call gb_PrecompiledHeader_get_dep_target
,$(2),$(7))) && \
99 CCACHE_DISABLE
=1 $(gb_COMPILER_SETUP
) \
103 $(if
$(WARNINGS_DISABLED
),$(gb_CXXFLAGS_DISABLE_WARNINGS
)) \
104 $(gb_COMPILERDEPFLAGS
) \
105 $(if
$(VISIBILITY
),,$(gb_VISIBILITY_FLAGS
)) \
106 $(if
$(EXTERNAL_CODE
),$(gb_CXXFLAGS_Wundef
),$(gb_DEFS_INTERNAL
)) \
107 $(gb_NO_PCH_TIMESTAMP
) \
109 $(call gb_cxx_dep_generation_options
,$(1),$(call gb_PrecompiledHeader_get_dep_target_tmp
,$(2),$(7))) \
110 -c
$(patsubst %.
cxx,%.hxx
,$(3)) \
112 $(call gb_cxx_dep_copy
,$(call gb_PrecompiledHeader_get_dep_target_tmp
,$(2),$(7))) \
116 ifeq ($(COM_IS_CLANG
),TRUE
)
117 # Clang has -fno-pch-timestamp, just checksum the file for CCACHE_PCH_EXTSUM
118 define gb_PrecompiledHeader__sum_command
119 $(SHA256SUM
) $(1) >$(1).sum
122 # GCC does not generate the same .gch for the same input, so checksum the (preprocessed) input
123 define gb_PrecompiledHeader__sum_command
124 $(call gb_Helper_abbreviate_dirs
,\
125 CCACHE_DISABLE
=1 $(gb_COMPILER_SETUP
) \
129 $(if
$(WARNINGS_DISABLED
),$(gb_CXXFLAGS_DISABLE_WARNINGS
)) \
130 $(gb_COMPILERDEPFLAGS
) \
131 $(if
$(VISIBILITY
),,$(gb_VISIBILITY_FLAGS
)) \
132 $(if
$(EXTERNAL_CODE
),$(gb_CXXFLAGS_Wundef
),$(gb_DEFS_INTERNAL
)) \
133 $(gb_NO_PCH_TIMESTAMP
) \
135 -E
$(patsubst %.
cxx,%.hxx
,$(3)) \
137 |
$(SHA256SUM
) >$(1).sum \
143 gb_PrecompiledHeader__create_reuse_files
=
144 gb_PrecompiledHeader__copy_reuse_files
=
148 define gb_YaccTarget__command
149 $(call gb_Output_announce
,$(2),$(true
),YAC
,3)
150 $(call gb_Helper_abbreviate_dirs
,\
151 mkdir
-p
$(dir $(3)) && \
152 $(gb_YACC
) $(T_YACCFLAGS
) -v
--defines
=$(4) -o
$(5) $(1) && touch
$(3) )
158 ifeq ($(strip $(DEBUGCPPUNIT
)),TRUE
)
159 gb_CppunitTest_GDBTRACE
:= gdb
-nx
-ex
"add-auto-load-safe-path $(INSTDIR)" -ex
"set environment $(subst =, ,$(gb_CppunitTest_CPPTESTPRECOMMAND))" --batch
--command
=$(SRCDIR
)/solenv
/bin
/gdbtrycatchtrace-stdout
-return-child-result
--args
162 # ExternalProject class
164 gb_ExternalProject_use_autoconf
:=
165 gb_ExternalProject_use_nmake
:=
167 # StaticLibrary class
169 gb_StaticLibrary_get_filename
= lib
$(1).a
170 gb_StaticLibrary_PLAINEXT
:= .a
171 gb_StaticLibrary_StaticLibrary_platform
:=
173 gb_LinkTarget_get_linksearchpath_for_layer
= \
174 -L
$(WORKDIR
)/LinkTarget
/StaticLibrary \
175 -L
$(call gb_Library_get_sdk_link_dir
) \
177 $(subst +, ,$(patsubst $(1):%.
,%,\
178 $(filter $(1):%.
,$(gb_LinkTarget_LAYER_LINKPATHS
)))),\
179 $(patsubst $(layer
):%,-L
%,\
180 $(filter $(layer
):%,$(gb_Library_LAYER_DIRS
))))
183 gb_ICU_PRECOMMAND
:= $(call gb_Helper_extend_ld_path
,$(WORKDIR_FOR_BUILD
)/UnpackedTarball
/icu
/source
/lib
)
187 # macOS sort(1) cannot read a response file
188 define gb_UIConfig__command
189 $(call gb_Helper_abbreviate_dirs
,\
190 $(SORT
) -u
$(UI_IMAGELISTS
) /dev
/null
> $@ \
195 define gb_UIConfig__gla11y_command
196 $(call gb_Helper_abbreviate_dirs
,\
197 $(gb_UIConfig_LXML_PATH
) $(if
$(SYSTEM_LIBXML
)$(SYSTEM_LIBXSLT
),,$(gb_Helper_set_ld_path
)) \
198 $(call gb_ExternalExecutable_get_command
,python
) \
199 $(gb_UIConfig_gla11y_SCRIPT
) $(gb_UIConfig_gla11y_PARAMETERS
) -o
$@
$(UIFILES
)
204 # vim: set noet sw=4 ts=4: