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,object,relative-source,source,dep-file)
46 define gb_CObject__command
47 $(call gb_Output_announce
,$(2).c
,$(true
),C
,3)
48 $(call gb_Helper_abbreviate_dirs
,\
49 mkdir
-p
$(dir $(1)) $(dir $(4)) && cd
$(SRCDIR
) && \
50 $(if
$(COMPILER_PLUGINS
),$(gb_COMPILER_PLUGINS_SETUP
)) \
54 $(if
$(VISIBILITY
),,$(gb_VISIBILITY_FLAGS
)) \
55 $(if
$(WARNINGS_NOT_ERRORS
),,$(gb_CFLAGS_WERROR
)) \
56 $(if
$(COMPILER_PLUGINS
),$(gb_COMPILER_PLUGINS
)) \
57 $(T_CFLAGS
) $(T_CFLAGS_APPEND
) \
60 $(call gb_cxx_dep_generation_options
,$(1),$(4)) \
63 $(call gb_cxx_dep_copy
,$(4)) \
67 # Used to run a compiler plugin tool.
68 # $(call gb_CObject__tool_command,relative-source,source)
69 define gb_CObject__tool_command
70 $(call gb_Output_announce
,$(1).c
,$(true
),C
,3)
71 $(call gb_Helper_abbreviate_dirs
,\
72 ICECC
=no CCACHE_DISABLE
=1 \
75 $(T_CFLAGS
) $(T_CFLAGS_APPEND
) \
79 $(gb_COMPILER_PLUGINS
) \
85 # $(call gb_CxxObject__command,object,relative-source,source,dep-file)
86 define gb_CxxObject__command
87 $(call gb_Output_announce
,$(2).
cxx,$(true
),CXX
,3)
88 $(call gb_Helper_abbreviate_dirs
,\
89 mkdir
-p
$(dir $(1)) $(dir $(4)) && cd
$(SRCDIR
) && \
90 $(if
$(COMPILER_PLUGINS
),$(gb_COMPILER_PLUGINS_SETUP
)) \
94 $(if
$(VISIBILITY
),,$(gb_VISIBILITY_FLAGS
)) \
95 $(if
$(WARNINGS_NOT_ERRORS
),,$(gb_CXXFLAGS_WERROR
)) \
96 $(if
$(COMPILER_PLUGINS
),$(gb_COMPILER_PLUGINS
)) \
97 $(T_CXXFLAGS
) $(T_CXXFLAGS_APPEND
) \
100 $(call gb_cxx_dep_generation_options
,$(1),$(4)) \
104 $(call gb_cxx_dep_copy
,$(4)) \
108 # Used to run a compiler plugin tool.
109 # $(call gb_CxxObject__tool_command,relative-source,source)
110 define gb_CxxObject__tool_command
111 $(call gb_Output_announce
,$(1).
cxx,$(true
),CXX
,3)
112 $(call gb_Helper_abbreviate_dirs
,\
113 ICECC
=no CCACHE_DISABLE
=1 \
116 $(T_CXXFLAGS
) $(T_CXXFLAGS_APPEND
) \
120 $(gb_COMPILER_PLUGINS
) \
126 define gb_ObjCxxObject__command
127 $(call gb_Output_announce
,$(2).mm
,$(true
),OCX
,3)
128 $(call gb_Helper_abbreviate_dirs
,\
129 mkdir
-p
$(dir $(1)) $(dir $(4)) && \
132 $(if
$(VISIBILITY
),,$(gb_VISIBILITY_FLAGS
)) \
133 $(if
$(WARNINGS_NOT_ERRORS
),,$(gb_CXXFLAGS_WERROR
)) \
134 $(T_OBJCXXFLAGS
) $(T_OBJCXXFLAGS_APPEND
) \
145 define gb_ObjCObject__command
146 $(call gb_Output_announce
,$(2).m
,$(true
),OCC
,3)
147 $(call gb_Helper_abbreviate_dirs
,\
148 mkdir
-p
$(dir $(1)) $(dir $(4)) && \
151 $(if
$(VISIBILITY
),,$(gb_VISIBILITY_FLAGS
)) \
152 $(if
$(WARNINGS_NOT_ERRORS
),,$(gb_CFLAGS_WERROR
)) \
153 $(T_OBJCFLAGS
) $(T_OBJCFLAGS_APPEND
) \
162 define gb_SrsPartTarget__command_dep
163 $(call gb_Helper_abbreviate_dirs
,\
164 mkdir
-p
$(dir $(call gb_SrsPartTarget_get_dep_target
,$(1))) && cd
$(SRCDIR
) && \
166 -MM
-MT
$(call gb_SrsPartTarget_get_target
,$(1)) \
169 -c
-x c
++-header
$(2) \
170 -o
$(call gb_SrsPartTarget_get_dep_target
,$(1)))
173 # PrecompiledHeader class
175 ifeq ($(COM_GCC_IS_CLANG
),TRUE
)
176 gb_PrecompiledHeader_get_enableflags
= -include-pch
$(call gb_PrecompiledHeader_get_target
,$(1))
178 gb_PrecompiledHeader_get_enableflags
= -include $(notdir $(subst .gch
,,$(call gb_PrecompiledHeader_get_target
,$(1)))) \
179 -I
$(dir $(call gb_PrecompiledHeader_get_target
,$(1)))
182 # Clang and gcc do not need any extra .o file for PCH
183 gb_PrecompiledHeader_get_objectfile
=
185 define gb_PrecompiledHeader__command
186 $(call gb_Output_announce
,$(2),$(true
),PCH
,1)
187 $(call gb_Helper_abbreviate_dirs
,\
188 mkdir
-p
$(dir $(1)) $(dir $(call gb_PrecompiledHeader_get_dep_target
,$(2))) && \
192 $(gb_COMPILERDEPFLAGS
) \
193 $(if
$(VISIBILITY
),,$(gb_VISIBILITY_FLAGS
)) \
195 $(call gb_cxx_dep_generation_options
,$(1),$(call gb_PrecompiledHeader_get_dep_target
,$(2))) \
196 -c
$(patsubst %.
cxx,%.hxx
,$(3)) \
198 $(call gb_cxx_dep_copy
,$(call gb_PrecompiledHeader_get_dep_target
,$(2))) \
202 # NoexPrecompiledHeader class
204 ifeq ($(COM_GCC_IS_CLANG
),TRUE
)
205 gb_NoexPrecompiledHeader_get_enableflags
= -include-pch
$(call gb_NoexPrecompiledHeader_get_target
,$(1))
207 gb_NoexPrecompiledHeader_get_enableflags
= -include $(notdir $(subst .gch
,,$(call gb_NoexPrecompiledHeader_get_target
,$(1)))) \
208 -I
$(dir $(call gb_NoexPrecompiledHeader_get_target
,$(1)))
211 gb_NoexPrecompiledHeader_get_objectfile
=
213 define gb_NoexPrecompiledHeader__command
214 $(call gb_Output_announce
,$(2),$(true
),PCH
,1)
215 $(call gb_Helper_abbreviate_dirs
,\
216 mkdir
-p
$(dir $(1)) $(dir $(call gb_NoexPrecompiledHeader_get_dep_target
,$(2))) && \
220 $(gb_COMPILERDEPFLAGS
) \
221 $(if
$(VISIBILITY
),,$(gb_VISIBILITY_FLAGS
)) \
223 $(call gb_cxx_dep_generation_options
,$(1),$(call gb_NoexPrecompiledHeader_get_dep_target
,$(2))) \
224 -c
$(patsubst %.
cxx,%.hxx
,$(3)) \
226 $(call gb_cxx_dep_copy
,$(call gb_NoexPrecompiledHeader_get_dep_target
,$(2))) \
230 define gb_Library_get_exports_target
231 $(call gb_LinkTarget_get_target
,$(call gb_Library_get_linktargetname
,$(1))).exports
236 ifeq ($(ANCIENT_BISON
),YES
)
238 # There are ancient versions of bison out there, which do not handle
239 # well .cxx extensions, nor do they support --defines=<file>. The
240 # result is that the header is named <foo>.cxx.h instead of <foo>.hxx
241 # so we queue a mv to rename the header accordingly.
242 # One example is XCode versions 2.x, which are used on OSX ppc
245 define gb_YaccTarget__command
246 $(call gb_Output_announce
,$(2),$(true
),YAC
,3)
247 $(call gb_Helper_abbreviate_dirs
,\
248 mkdir
-p
$(dir $(3)) && \
249 $(gb_YACC
) $(T_YACCFLAGS
) -d
-o
$(5) $(1) && mv
$(5).h
$(4) && touch
$(3) )
254 define gb_YaccTarget__command
255 $(call gb_Output_announce
,$(2),$(true
),YAC
,3)
256 $(call gb_Helper_abbreviate_dirs
,\
257 mkdir
-p
$(dir $(3)) && \
258 $(gb_YACC
) $(T_YACCFLAGS
) --defines
=$(4) -o
$(5) $(1) && touch
$(3) )
263 # ExternalProject class
265 gb_ExternalProject_use_autoconf
:=
267 # vim: set noet sw=4 ts=4: