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 .
20 GBUILDDIR
:=$(SRCDIR
)/solenv
/gbuild
22 # vars needed from the env/calling makefile
31 # PTHREAD_CFLAGS (Linux)
33 # SYSTEM_LIBJPEG (Linux)
34 # SYSTEM_LIBXML (Linux)
38 # do not use built-in rules
39 # DO NOT TOUCH THIS LINE UNLESS YOU REALLY KNOW WHAT YOU ARE DOING
40 # REMOVING THIS MAKES e.g. MODULE SW ALONE SLOWER BY SOME 300%
41 # FOR TAIL_BUILD THE IMPACT IS HUGE!
42 # (unless you are doing make -r, which we should explicitly NOT require from
63 gb_VERBOSE
:= $(verbose
)
65 include $(GBUILDDIR
)/Helper.mk
67 # optional extensions that should never be essential
68 ifneq ($(wildcard $(GBUILDDIR
)/extensions
/pre_
*.mk
),)
69 include $(wildcard $(GBUILDDIR
)/extensions
/pre_
*.mk
)
72 include $(GBUILDDIR
)/Output.mk
75 ifneq ($(strip $(TIMELOG
)$(timelog
)),)
79 ifneq ($(ENABLE_DBGUTIL
),)
80 gb_ENABLE_DBGUTIL
:= $(true
)
82 gb_ENABLE_DBGUTIL
:= $(false
)
85 gb_ENABLE_SYMBOLS_FOR
:= $(ENABLE_SYMBOLS_FOR
)
87 # ENABLE_SYMBOLS (presumably from the command line)
88 ifneq ($(strip $(ENABLE_SYMBOLS
)),)
89 gb_ENABLE_SYMBOLS_FOR
:= $(ENABLE_SYMBOLS
)
91 ifneq ($(strip $(enable_symbols
)),)
92 gb_ENABLE_SYMBOLS_FOR
:= $(enable_symbols
)
95 # note: ENABLE_BREAKPAD turns on symbols
96 ifneq ($(strip $(ENABLE_BREAKPAD
)),)
97 gb_ENABLE_SYMBOLS_FOR
:= all
101 ifneq ($(strip $(DEBUG
)),)
103 # make DEBUG=true should force -g
104 ifeq ($(origin DEBUG
),command line
)
105 gb_ENABLE_SYMBOLS_FOR
:= all
108 ifneq ($(strip $(debug
)),)
110 ifeq ($(origin debug
),command line
)
111 gb_ENABLE_SYMBOLS_FOR
:= all
114 ifeq ($(gb_ENABLE_DBGUTIL
),$(true
))
118 ifneq ($(strip $(DBGLEVEL
)),)
119 gb_DEBUGLEVEL
:= $(strip $(DBGLEVEL
))
120 ifeq ($(origin DBGLEVEL
),command line
)
121 gb_ENABLE_SYMBOLS_FOR
:= all
124 ifneq ($(strip $(dbglevel
)),)
125 gb_DEBUGLEVEL
:= $(strip $(dbglevel
))
126 ifeq ($(origin dbglevel
),command line
)
127 gb_ENABLE_SYMBOLS_FOR
:= all
131 # handle special cases
132 ifeq ($(gb_ENABLE_SYMBOLS_FOR
),1)
133 gb_ENABLE_SYMBOLS_FOR
:= all
135 ifeq ($(gb_ENABLE_SYMBOLS_FOR
),0)
136 gb_ENABLE_SYMBOLS_FOR
:=
138 ifeq ($(gb_ENABLE_SYMBOLS_FOR
),yes
)
139 gb_ENABLE_SYMBOLS_FOR
:= all
141 ifeq ($(gb_ENABLE_SYMBOLS_FOR
),no
)
142 gb_ENABLE_SYMBOLS_FOR
:=
145 gb_ENABLE_PCH
:= $(ENABLE_PCH
)
147 ifneq ($(nodep
)$(ENABLE_PRINT_DEPS
),)
148 gb_FULLDEPS
:= $(false
)
150 gb_FULLDEPS
:= $(true
)
153 ifneq ($(strip $(patches
)$(PATCHES
)),)
154 gb_KEEP_PRISTINE
:= $(true
)
156 gb_KEEP_PRISTINE
:= $(false
)
159 ifeq ($(findstring s
,$(MAKEFLAGS
)),)
160 gb_QUIET_EXTERNAL
:= $(false
)
162 gb_QUIET_EXTERNAL
:= $(true
)
165 # save user-supplied flags for latter use
166 ifneq ($(strip $(ENVCFLAGS
)),)
167 gb__ENV_CFLAGS
:= $(ENVCFLAGS
)
169 ifneq ($(strip $(ENVCFLAGSCXX
)),)
170 gb__ENV_CXXFLAGS
:= $(ENVCFLAGSCXX
)
173 include $(GBUILDDIR
)/ExternalExecutable.mk
174 include $(GBUILDDIR
)/TargetLocations.mk
175 include $(GBUILDDIR
)/Tempfile.mk
176 include $(GBUILDDIR
)/TestHelpers.mk
178 $(eval
$(call gb_Helper_init_registries
))
179 include $(SRCDIR
)/Repository.mk
180 include $(SRCDIR
)/RepositoryExternal.mk
181 $(eval
$(call gb_Helper_collect_knownlibs
))
183 gb_Library_DLLPOSTFIX
:= lo
185 # Include platform/cpu/compiler specific config/definitions
187 include $(GBUILDDIR
)/platform
/$(OS
)_
$(CPUNAME
)_
$(COM
).mk
190 include $(SRCDIR
)/RepositoryFixes.mk
192 # after platform; at least currently python depends on variable set in platform
193 $(eval
$(call gb_ExternalExecutable_collect_registrations
))
195 # add user-supplied flags
196 ifneq ($(strip gb__ENV_CFLAGS
),)
197 gb_LinkTarget_CFLAGS
+= $(gb__ENV_CFLAGS
)
199 ifneq ($(strip gb__ENV_CXXFLAGS
),)
200 gb_LinkTarget_CXXFLAGS
+= $(gb__ENV_CXXFLAGS
)
203 gb_CPUDEFS
+= -D
$(CPUNAME
)
207 -DOSL_DEBUG_LEVEL
=$(gb_DEBUGLEVEL
) \
212 ifeq ($(gb_ENABLE_DBGUTIL
),$(true
))
213 gb_GLOBALDEFS
+= -DDBG_UTIL
215 ifneq ($(COM
)-$(MSVC_USE_DEBUG_RUNTIME
),MSC-
)
216 gb_GLOBALDEFS
+= -D_DEBUG
220 ifeq ($(gb_TIMELOG
),1)
221 gb_GLOBALDEFS
+= -DTIMELOG \
225 ifeq ($(strip $(ASSERT_ALWAYS_ABORT
)),FALSE
)
226 gb_GLOBALDEFS
+= -DNDEBUG \
230 ifeq ($(gb_DEBUGLEVEL
),0)
232 ifeq ($(ENABLE_SAL_LOG
),TRUE
)
233 gb_GLOBALDEFS
+= -DSAL_LOG_INFO \
239 gb_GLOBALDEFS
+= -DSAL_LOG_INFO \
242 ifneq ($(gb_DEBUGLEVEL
),1) # 2 or more
243 gb_GLOBALDEFS
+= -DDEBUG \
249 $(call gb_Helper_define_if_set
,\
254 gb_GLOBALDEFS
:= $(sort $(gb_GLOBALDEFS
))
256 # Common environment variables passed into all gb_*Test classes:
257 # * Cap the number of threads unittests use:
258 gb_TEST_ENV_VARS
:= MAX_CONCURRENCY
=4
259 # * Disable searching for certificates by default:
260 gb_TEST_ENV_VARS
+= MOZILLA_CERTIFICATE_FOLDER
=
261 # Avoid hanging if the cups daemon requests a password:
262 gb_TEST_ENV_VARS
+= SAL_DISABLE_SYNCHRONOUS_PRINTER_DETECTION
=1
263 ifeq (,$(SAL_USE_VCLPLUGIN
))
264 gb_TEST_ENV_VARS
+= SAL_USE_VCLPLUGIN
=svp
267 # This is used to detect whether LibreOffice is being built (as opposed to building
268 # 3rd-party code). Used for tag deprecation for API we want to
269 # ensure is not used at all externally while we clean
270 # out our internal usage, for code in sal/ that should be used only internally, etc.
271 gb_DEFS_INTERNAL
:= \
272 -DLIBO_INTERNAL_ONLY \
274 include $(GBUILDDIR
)/Deliver.mk
276 $(eval
$(call gb_Deliver_init
))
278 # We are using a set of scopes that we might as well call classes.
280 # TODO: to what extent is the following still true?
281 # It is important to include them in the right order as that is
282 # -- at least in part -- defining precedence. This is not an issue in the
283 # WORKDIR as there are no naming collisions there, but INSTDIR is a mess
284 # and precedence is important there. This is also platform dependent.
286 # This is less of an issue with GNU Make versions > 3.82 which matches for
287 # shortest stem instead of first match. However, upon introduction this version
288 # is not available everywhere by default.
290 include $(foreach class
, \
333 InstallModuleTarget \
340 ,$(GBUILDDIR
)/$(class
).mk
)
342 $(eval
$(call gb_Helper_process_executable_registrations
))
343 $(eval
$(call gb_Postprocess_make_targets
))
345 # optional extensions that should never be essential
346 ifneq ($(wildcard $(GBUILDDIR
)/extensions
/post_
*.mk
),)
347 include $(wildcard $(GBUILDDIR
)/extensions
/post_
*.mk
)
350 define gb_Extensions_final_hook
351 ifneq ($(wildcard $(GBUILDDIR
)/extensions
/final_
*.mk
),)
352 include $(wildcard $(GBUILDDIR
)/extensions
/final_
*.mk
)
357 # vim: set noet sw=4: