bump product version to 4.1.6.2
[LibreOffice.git] / solenv / gbuild / platform / com_GCC_class.mk
blob37e2b7bd11e8fb6397041124ce65fc6aa23acca2
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)_
13 endef
14 define gb_cxx_dep_copy
15 && mv $(1)_ $(1)
16 endef
17 else
18 define gb_cxx_dep_generation_options
19 endef
20 define gb_cxx_dep_copy
21 endef
22 endif
24 # AsmObject class
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) && \
33 $(gb_CC) \
34 -x assembler-with-cpp \
35 $(gb_LTOFLAGS) \
36 $(gb_AFLAGS) \
37 -c $(3) \
38 -o $(1)) \
39 $(INCLUDE) && \
40 echo "$(1) : $(3)" > $(4)
41 endef
43 # CObject class
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)) \
51 $(gb_CC) \
52 $(DEFS) \
53 $(gb_LTOFLAGS) \
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) \
58 -c $(3) \
59 -o $(1) \
60 $(call gb_cxx_dep_generation_options,$(1),$(4)) \
61 -I$(dir $(3)) \
62 $(INCLUDE) \
63 $(call gb_cxx_dep_copy,$(4)) \
65 endef
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 \
73 $(gb_CC) \
74 $(DEFS) \
75 $(T_CFLAGS) $(T_CFLAGS_APPEND) \
76 -c $(2) \
77 -I$(dir $(2)) \
78 $(INCLUDE) \
79 $(gb_COMPILER_PLUGINS) \
81 endef
83 # CxxObject class
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)) \
91 $(gb_CXX) \
92 $(DEFS) \
93 $(gb_LTOFLAGS) \
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) \
98 -c $(3) \
99 -o $(1) \
100 $(call gb_cxx_dep_generation_options,$(1),$(4)) \
101 -I$(dir $(3)) \
102 $(INCLUDE) \
103 $(PCHFLAGS) \
104 $(call gb_cxx_dep_copy,$(4)) \
106 endef
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 \
114 $(gb_CXX) \
115 $(DEFS) \
116 $(T_CXXFLAGS) $(T_CXXFLAGS_APPEND) \
117 -c $(2) \
118 -I$(dir $(2)) \
119 $(INCLUDE) \
120 $(gb_COMPILER_PLUGINS) \
122 endef
124 # ObjCxxObject class
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)) && \
130 $(gb_CXX) \
131 $(DEFS) \
132 $(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \
133 $(if $(WARNINGS_NOT_ERRORS),,$(gb_CXXFLAGS_WERROR)) \
134 $(T_OBJCXXFLAGS) $(T_OBJCXXFLAGS_APPEND) \
135 -c $(3) \
136 -o $(1) \
137 -MMD -MT $(1) \
138 -MP -MF $(4) \
139 -I$(dir $(3)) \
140 $(INCLUDE))
141 endef
143 # ObjCObject class
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)) && \
149 $(gb_CC) \
150 $(DEFS) \
151 $(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \
152 $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \
153 $(T_OBJCFLAGS) $(T_OBJCFLAGS_APPEND) \
154 -c $(3) \
155 -o $(1) \
156 -MMD -MT $(1) \
157 -MP -MF $(4) \
158 -I$(dir $(3)) \
159 $(INCLUDE))
160 endef
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) && \
165 $(gb_GCCP) \
166 -MM -MT $(call gb_SrsPartTarget_get_target,$(1)) \
167 $(INCLUDE) \
168 $(DEFS) \
169 -c -x c++-header $(2) \
170 -o $(call gb_SrsPartTarget_get_dep_target,$(1)))
171 endef
173 # PrecompiledHeader class
175 ifeq ($(COM_GCC_IS_CLANG),TRUE)
176 gb_PrecompiledHeader_get_enableflags = -include-pch $(call gb_PrecompiledHeader_get_target,$(1))
177 else
178 gb_PrecompiledHeader_get_enableflags = -include $(notdir $(subst .gch,,$(call gb_PrecompiledHeader_get_target,$(1)))) \
179 -I $(dir $(call gb_PrecompiledHeader_get_target,$(1)))
180 endif
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))) && \
189 $(gb_CXX) \
190 -x c++-header \
191 $(4) $(5) \
192 $(gb_COMPILERDEPFLAGS) \
193 $(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \
194 $(6) \
195 $(call gb_cxx_dep_generation_options,$(1),$(call gb_PrecompiledHeader_get_dep_target,$(2))) \
196 -c $(patsubst %.cxx,%.hxx,$(3)) \
197 -o$(1) \
198 $(call gb_cxx_dep_copy,$(call gb_PrecompiledHeader_get_dep_target,$(2))) \
200 endef
202 # NoexPrecompiledHeader class
204 ifeq ($(COM_GCC_IS_CLANG),TRUE)
205 gb_NoexPrecompiledHeader_get_enableflags = -include-pch $(call gb_NoexPrecompiledHeader_get_target,$(1))
206 else
207 gb_NoexPrecompiledHeader_get_enableflags = -include $(notdir $(subst .gch,,$(call gb_NoexPrecompiledHeader_get_target,$(1)))) \
208 -I $(dir $(call gb_NoexPrecompiledHeader_get_target,$(1)))
209 endif
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))) && \
217 $(gb_CXX) \
218 -x c++-header \
219 $(4) $(5) \
220 $(gb_COMPILERDEPFLAGS) \
221 $(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \
222 $(6) \
223 $(call gb_cxx_dep_generation_options,$(1),$(call gb_NoexPrecompiledHeader_get_dep_target,$(2))) \
224 -c $(patsubst %.cxx,%.hxx,$(3)) \
225 -o$(1) \
226 $(call gb_cxx_dep_copy,$(call gb_NoexPrecompiledHeader_get_dep_target,$(2))) \
228 endef
230 define gb_Library_get_exports_target
231 $(call gb_LinkTarget_get_target,$(call gb_Library_get_linktargetname,$(1))).exports
232 endef
234 # YaccTarget class
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
243 # machines.
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) )
251 endef
253 else
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) )
260 endef
261 endif
263 # ExternalProject class
265 gb_ExternalProject_use_autoconf :=
267 # vim: set noet sw=4 ts=4: