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
)
86 ifneq ($(strip $(DEBUG
)),)
88 # make DEBUG=true should force -g
89 ifeq ($(origin DEBUG
),command line
)
90 ENABLE_DEBUGINFO_FOR
:= all
91 ENABLE_SYMBOLS
:= TRUE
94 ifneq ($(strip $(debug
)),)
96 ifeq ($(origin debug
),command line
)
97 ENABLE_DEBUGINFO_FOR
:= all
98 ENABLE_SYMBOLS
:= TRUE
101 ifeq ($(gb_ENABLE_DBGUTIL
),$(true
))
105 ifneq ($(strip $(DBGLEVEL
)),)
106 gb_DEBUGLEVEL
:= $(strip $(DBGLEVEL
))
107 ifeq ($(origin DBGLEVEL
),command line
)
108 ENABLE_DEBUGINFO_FOR
:= all
111 ifneq ($(strip $(dbglevel
)),)
112 gb_DEBUGLEVEL
:= $(strip $(dbglevel
))
113 ifeq ($(origin dbglevel
),command line
)
114 ENABLE_DEBUGINFO_FOR
:= all
118 # note: ENABLE_BREAKPAD turns on gb_SYMBOL
119 ifneq ($(strip $(ENABLE_SYMBOLS
)$(enable_symbols
)$(ENABLE_BREAKPAD
)),)
122 gb_SYMBOL
:= $(false
)
125 ifneq ($(strip $(ENABLE_PCH
)),)
126 gb_ENABLE_PCH
:= $(true
)
128 gb_ENABLE_PCH
:= $(false
)
131 ifneq ($(nodep
)$(ENABLE_PRINT_DEPS
),)
132 gb_FULLDEPS
:= $(false
)
134 gb_FULLDEPS
:= $(true
)
137 ifneq ($(strip $(patches
)$(PATCHES
)),)
138 gb_KEEP_PRISTINE
:= $(true
)
140 gb_KEEP_PRISTINE
:= $(false
)
143 ifeq ($(findstring s
,$(MAKEFLAGS
)),)
144 gb_QUIET_EXTERNAL
:= $(false
)
146 gb_QUIET_EXTERNAL
:= $(true
)
149 # save user-supplied flags for latter use
150 ifneq ($(strip $(ENVCFLAGS
)),)
151 gb__ENV_CFLAGS
:= $(ENVCFLAGS
)
153 ifneq ($(strip $(ENVCFLAGSCXX
)),)
154 gb__ENV_CXXFLAGS
:= $(ENVCFLAGSCXX
)
157 include $(GBUILDDIR
)/ExternalExecutable.mk
158 include $(GBUILDDIR
)/TargetLocations.mk
159 include $(GBUILDDIR
)/Tempfile.mk
161 $(eval
$(call gb_Helper_init_registries
))
162 include $(SRCDIR
)/Repository.mk
163 include $(SRCDIR
)/RepositoryExternal.mk
164 $(eval
$(call gb_Helper_collect_knownlibs
))
166 gb_Library_DLLPOSTFIX
:= lo
168 # Include platform/cpu/compiler specific config/definitions
170 include $(GBUILDDIR
)/platform
/$(OS
)_
$(CPUNAME
)_
$(COM
).mk
173 include $(SRCDIR
)/RepositoryFixes.mk
175 # after platform; at least currently python depends on variable set in platform
176 $(eval
$(call gb_ExternalExecutable_collect_registrations
))
178 # add user-supplied flags
179 ifneq ($(strip gb__ENV_CFLAGS
),)
180 gb_LinkTarget_CFLAGS
+= $(gb__ENV_CFLAGS
)
182 ifneq ($(strip gb__ENV_CXXFLAGS
),)
183 gb_LinkTarget_CXXFLAGS
+= $(gb__ENV_CXXFLAGS
)
186 gb_CPUDEFS
+= -D
$(CPUNAME
)
190 -DOSL_DEBUG_LEVEL
=$(gb_DEBUGLEVEL
) \
195 ifeq ($(gb_ENABLE_DBGUTIL
),$(true
))
196 gb_GLOBALDEFS
+= -DDBG_UTIL
198 ifneq ($(COM
)-$(MSVC_USE_DEBUG_RUNTIME
),MSC-
)
199 gb_GLOBALDEFS
+= -D_DEBUG
203 ifeq ($(gb_TIMELOG
),1)
204 gb_GLOBALDEFS
+= -DTIMELOG \
208 ifeq ($(strip $(ASSERT_ALWAYS_ABORT
)),FALSE
)
209 gb_GLOBALDEFS
+= -DNDEBUG \
213 ifeq ($(gb_DEBUGLEVEL
),0)
215 ifeq ($(ENABLE_SAL_LOG
),TRUE
)
216 gb_GLOBALDEFS
+= -DSAL_LOG_INFO \
222 gb_GLOBALDEFS
+= -DSAL_LOG_INFO \
225 ifneq ($(gb_DEBUGLEVEL
),1) # 2 or more
226 gb_GLOBALDEFS
+= -DDEBUG \
232 $(call gb_Helper_define_if_set
,\
237 gb_GLOBALDEFS
:= $(sort $(gb_GLOBALDEFS
))
239 # This is used to detect whether LibreOffice is being built (as opposed to building
240 # 3rd-party code). Used for tag deprecation for API we want to
241 # ensure is not used at all externally while we clean
242 # out our internal usage, for code in sal/ that should be used only internally, etc.
243 gb_DEFS_INTERNAL
:= \
244 -DLIBO_INTERNAL_ONLY \
246 include $(GBUILDDIR
)/Deliver.mk
248 $(eval
$(call gb_Deliver_init
))
250 # We are using a set of scopes that we might as well call classes.
252 # TODO: to what extent is the following still true?
253 # It is important to include them in the right order as that is
254 # -- at least in part -- defining precedence. This is not an issue in the
255 # WORKDIR as there are no naming collisions there, but INSTDIR is a mess
256 # and precedence is important there. This is also platform dependent.
258 # This is less of an issue with GNU Make versions > 3.82 which matches for
259 # shortest stem instead of first match. However, upon introduction this version
260 # is not available everywhere by default.
262 include $(foreach class
, \
305 InstallModuleTarget \
312 ,$(GBUILDDIR
)/$(class
).mk
)
314 $(eval
$(call gb_Helper_process_executable_registrations
))
315 $(eval
$(call gb_Postprocess_make_targets
))
317 # optional extensions that should never be essential
318 ifneq ($(wildcard $(GBUILDDIR
)/extensions
/post_
*.mk
),)
319 include $(wildcard $(GBUILDDIR
)/extensions
/post_
*.mk
)
322 define gb_Extensions_final_hook
323 ifneq ($(wildcard $(GBUILDDIR
)/extensions
/final_
*.mk
),)
324 include $(wildcard $(GBUILDDIR
)/extensions
/final_
*.mk
)
329 # vim: set noet sw=4: