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
34 # PTHREAD_CFLAGS (Linux)
37 # SYSTEM_LIBXML (Linux)
41 # do not use built-in rules
42 # DO NOT TOUCH THIS LINE UNLESS YOU REALLY KNOW WHAT YOU ARE DOING
43 # REMOVING THIS MAKES e.g. MODULE SW ALONE SLOWER BY SOME 300%
44 # FOR TAIL_BUILD THE IMPACT IS HUGE!
45 # (unless you are doing make -r, which we should explicitly NOT require from
50 # by default gbuild use /bin/sh
51 # if you want to use a particular shell
52 # you can export gb_SHELL=<path_to_shell>
76 include $(GBUILDDIR
)/Helper.mk
78 # optional extensions that should never be essential
79 ifneq ($(wildcard $(GBUILDDIR
)/extensions
/pre_
*.mk
),)
80 include $(wildcard $(GBUILDDIR
)/extensions
/pre_
*.mk
)
83 include $(GBUILDDIR
)/Output.mk
86 ifneq ($(strip $(TIMELOG
)$(timelog
)),)
90 # This used to be PRODUCT="" (for the same meaning as ENABLE_DBGUTIL="TRUE"),
91 # but the product meaning is now only confusing.
92 ifneq ($(ENABLE_DBGUTIL
),)
93 gb_ENABLE_DBGUTIL
:= $(true
)
95 gb_ENABLE_DBGUTIL
:= $(false
)
99 ifneq ($(strip $(DEBUG
)),)
101 # make DEBUG=true should force -g
102 ifeq ($(origin DEBUG
),command line
)
103 ENABLE_DEBUGINFO_FOR
:= all
106 ifneq ($(strip $(debug
)),)
108 ifeq ($(origin debug
),command line
)
109 ENABLE_DEBUGINFO_FOR
:= all
112 ifeq ($(gb_ENABLE_DBGUTIL
),$(true
))
116 ifneq ($(strip $(DBGLEVEL
)),)
117 gb_DEBUGLEVEL
:= $(strip $(DBGLEVEL
))
118 ifeq ($(origin DBGLEVEL
),command line
)
119 ENABLE_DEBUGINFO_FOR
:= all
122 ifneq ($(strip $(dbglevel
)),)
123 gb_DEBUGLEVEL
:= $(strip $(dbglevel
))
124 ifeq ($(origin dbglevel
),command line
)
125 ENABLE_DEBUGINFO_FOR
:= all
129 ifeq ($(HARDLINKDELIVER
),TRUE
)
130 gb_Deliver_HARDLINK
:= $(true
)
133 ifeq ($(or
$(ENABLE_SYMBOLS
),$(enable_symbols
)),FALSE
)
134 gb_SYMBOL
:= $(false
)
136 ifneq ($(strip $(ENABLE_SYMBOLS
)$(enable_symbols
)),)
141 ifneq ($(strip $(ENABLE_PCH
)),)
142 gb_ENABLE_PCH
:= $(true
)
144 gb_ENABLE_PCH
:= $(false
)
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
177 $(eval
$(call gb_Helper_init_registries
))
178 include $(SRCDIR
)/Repository.mk
179 include $(SRCDIR
)/RepositoryExternal.mk
180 $(eval
$(call gb_Helper_collect_knownlibs
))
182 gb_Library_DLLPOSTFIX
:= lo
184 # Include platform/cpu/compiler specific config/definitions
185 include $(GBUILDDIR
)/platform
/$(OS
)_
$(CPUNAME
)_
$(COM
).mk
188 include $(SRCDIR
)/RepositoryFixes.mk
190 # after platform; at least currently python depends on variable set in platform
191 $(eval
$(call gb_ExternalExecutable_collect_registrations
))
193 # add user-supplied flags
194 ifneq ($(strip gb__ENV_CFLAGS
),)
195 gb_LinkTarget_CFLAGS
+= $(gb__ENV_CFLAGS
)
197 ifneq ($(strip gb__ENV_CXXFLAGS
),)
198 gb_LinkTarget_CXXFLAGS
+= $(gb__ENV_CXXFLAGS
)
201 gb_CPUDEFS
+= -D
$(CPUNAME
)
205 -DOSL_DEBUG_LEVEL
=$(gb_DEBUGLEVEL
) \
211 # This is used to detect whether LibreOffice is being built (as opposed to building
212 # 3rd-party code). Used for tag deprecation for API we want to
213 # ensure is not used at all externally while we clean
214 # out our internal usage, for code in sal/ that should be used only internally, etc.
216 -DLIBO_INTERNAL_ONLY \
218 ifeq ($(gb_ENABLE_DBGUTIL
),$(true
))
219 gb_GLOBALDEFS
+= -DDBG_UTIL
221 ifneq ($(COM
)-$(MSVC_USE_DEBUG_RUNTIME
),MSC-
)
222 gb_GLOBALDEFS
+= -D_DEBUG
226 ifneq ($(strip $(SOLAR_JAVA
)),)
227 gb_GLOBALDEFS
+= -DSOLAR_JAVA
230 ifeq ($(gb_TIMELOG
),1)
231 gb_GLOBALDEFS
+= -DTIMELOG \
235 ifeq ($(gb_DEBUGLEVEL
),0)
236 gb_GLOBALDEFS
+= -DOPTIMIZE \
238 ifeq ($(strip $(ASSERT_ALWAYS_ABORT
)),FALSE
)
239 gb_GLOBALDEFS
+= -DNDEBUG \
244 gb_GLOBALDEFS
+= -DSAL_LOG_INFO \
247 ifneq ($(gb_DEBUGLEVEL
),1) # 2 or more
248 gb_GLOBALDEFS
+= -DDEBUG \
253 ifeq ($(ENABLE_HEADLESS
),TRUE
)
254 gb_GLOBALDEFS
+= -DLIBO_HEADLESS \
259 $(call gb_Helper_define_if_set
,\
260 DISABLE_DBCONNECTIVITY \
264 ENABLE_MACOSX_SANDBOX \
265 ENABLE_READONLY_INSTALLSET \
268 gb_GLOBALDEFS
:= $(sort $(gb_GLOBALDEFS
))
270 ifeq ($(origin gb_RUNNABLE_INSTDIR
),undefined
)
271 gb_RUNNABLE_INSTDIR
:=
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 # It is important to include them in the right order as that is
281 # -- at least in part -- defining precedence. This is not an issue in the
282 # WORKDIR as there are no nameing collisions there, but OUTDIR is a mess
283 # and precedence is important there. This is also platform dependant.
285 # $(OUTDIR)/bin/% for executables collides
286 # with $(OUTDIR)/bin/%.res for resources on unix
287 # $(OUTDIR)/lib/%.lib collides
288 # on windows (static and dynamic libs)
289 # $(OUTDIR)/xml/% for packageparts collides
290 # with $(OUTDIR)/xml/component/%.component for components
291 # This is less of an issue with GNU Make versions > 3.82 which matches for
292 # shortest stem instead of first match. However, upon intoduction this version
293 # is not available everywhere by default.
295 include $(foreach class
, \
336 InstallModuleTarget \
343 ,$(GBUILDDIR
)/$(class
).mk
)
345 $(eval
$(call gb_Helper_process_executable_registrations
))
346 $(eval
$(call gb_Postprocess_make_targets
))
348 # optional extensions that should never be essential
349 ifneq ($(wildcard $(GBUILDDIR
)/extensions
/post_
*.mk
),)
350 include $(wildcard $(GBUILDDIR
)/extensions
/post_
*.mk
)
353 define gb_Extensions_final_hook
354 ifneq ($(wildcard $(GBUILDDIR
)/extensions
/final_
*.mk
),)
355 include $(wildcard $(GBUILDDIR
)/extensions
/final_
*.mk
)
360 # vim: set noet sw=4: