GPU-Calc: remove Alloc_Host_Ptr for clmem of NAN vector
[LibreOffice.git] / Makefile.in
blob6918e22184c426995cb23560c23b639289a007ae
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 .PHONY : all bootstrap gbuild build build-non-l10n-only build-l10n-only check clean clean-build clean-host test-install distclean distro-pack-install docs download fetch findunusedcode get-submodules id install install-strip subsequentcheck tags debugrun help slowcheck translations unitcheck
12 MAKECMDGOALS?=all
14 SHELL=/usr/bin/env bash
15 SRCDIR := @SRC_ROOT@
16 BUILDDIR := @BUILDDIR@
17 GIT_BUILD := $(if $(wildcard $(SRCDIR)/.git),T)
19 # Run autogen.sh if needed and force make to restart itself.
20 # ... but there are several cases where we do not want to run
21 # autogen.sh:
22 # 1. if we are building from tarballs, not git checkout (I do not
23 # think packagers would ever want that. I certainly do not.)
24 # 2. if we are making help, clean or distclean, because they do not
25 # need updated configuration
26 ifeq (,$(MAKE_RESTARTS)$(if $(GIT_BUILD),,T)$(if $(filter-out help clean distclean,$(MAKECMDGOALS)),,T))
28 .PHONY : force-restart
29 Makefile: $(BUILDDIR)/config_host.mk force-restart
30 @touch $@
32 # run configure in an environment not polluted by config_host.mk
33 $(BUILDDIR)/config_host.mk : $(wildcard \
34 $(SRCDIR)/config_host.mk.in \
35 $(SRCDIR)/Makefile.in \
36 $(SRCDIR)/instsetoo_native/util/openoffice.lst.in \
37 $(SRCDIR)/configure.ac \
38 $(SRCDIR)/config_host/*.h.in \
39 $(BUILDDIR)/autogen.input \
40 $(BUILDDIR)/autogen.lastrun \
42 $(SRCDIR)/autogen.sh
44 else # MAKE_RESTARTS
46 all: build
48 gb_Side ?= host
50 include $(BUILDDIR)/config_$(gb_Side).mk
52 export GMAKE_OPTIONS?=-r$(if $(verbose)$(VERBOSE),,s)$(value $(MAKEFLAGS))
55 # Partial Build
57 define gb_Top_GbuildModuleRules
58 .PHONY: $(1) $(1).all $(1).build $(1).check $(1).clean $(1).showdeliverables $(1).subsequentcheck
60 $(1): bootstrap fetch
61 cd $(SRCDIR)/$(2) && $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS)
63 $(1).build $(1).check $(1).clean $(1).showdeliverables $(1).subsequentcheck:
64 cd $(SRCDIR)/$(2) && $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) $$(patsubst $(1).%,%,$$@)
66 $(1).all: bootstrap fetch
67 $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $(WORKDIR)/Module/$(1) $(if $(CROSS_COMPILING),,$(WORKDIR)/Module/check/$(1) $(WORKDIR)/Module/slowcheck/$(1))
69 endef
71 define gb_Top_GbuildModulesRules
72 $(foreach m,$(1),$(call gb_Top_GbuildModuleRules,$(notdir $(m)),$(m)))
73 endef
75 gbuild_modules := $(patsubst $(SRCDIR)/%/,%,$(dir $(wildcard $(SRCDIR)/*/Module_*.mk $(SRCDIR)/external/*/Module_*.mk)))
77 $(eval $(call gb_Top_GbuildModulesRules,$(gbuild_modules)))
79 gbuild_TARGETS := AllLangHelp \
80 AllLangPackage \
81 AllLangResTarget \
82 AutoInstall \
83 CliLibrary \
84 CliNativeLibrary \
85 CliUnoApi \
86 Configuration \
87 CppunitTest \
88 CustomTarget \
89 Dictionary \
90 Executable \
91 Extension \
92 ExtensionPackage \
93 ExtensionPackageSet \
94 ExternalPackage \
95 ExternalProject \
96 GeneratedPackage \
97 InstallModule \
98 InstallScript \
99 InternalUnoApi \
100 Jar \
101 JunitTest \
102 Library \
103 Module \
104 Package \
105 PackageSet \
106 Pagein \
107 Postprocess \
108 Pyuno \
109 PythonTest \
110 Rdb \
111 StaticLibrary \
112 UIConfig \
113 UnoApi \
114 UnpackedTarball \
115 WinResTarget \
116 Zip \
118 # build a generic gbuild target
119 $(foreach target,$(gbuild_TARGETS),$(target)_% $(foreach module,$(gbuild_modules),$(target)_$(module)/%)):
120 $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $@
123 # Clean
125 clean: clean-host clean-build
127 clean-host:
128 rm -fr $(TESTINSTALLDIR)
129 rm -fr $(INSTDIR)
130 rm -fr $(WORKDIR)
131 rm -fr solver
132 rm -fr install
134 clean-build:
135 ifeq ($(CROSS_COMPILING),YES)
136 rm -fr $(INSTDIR_FOR_BUILD)
137 rm -fr $(WORKDIR_FOR_BUILD)
138 endif
140 include $(SRCDIR)/compilerplugins/Makefile.mk
143 # Distclean
145 distclean : clean compilerplugins-clean
146 rm -fr \
147 $(BUILDDIR)/Makefile \
148 $(BUILDDIR)/aclocal.m4 \
149 $(BUILDDIR)/autom4te.cache \
150 $(BUILDDIR)/config.log \
151 $(BUILDDIR)/config.status \
152 $(BUILDDIR)/config_build.mk \
153 $(BUILDDIR)/config_host.mk \
154 $(BUILDDIR)/config_host.mk.stamp \
155 $(BUILDDIR)/config_host/*.h \
156 $(BUILDDIR)/configure \
157 $(BUILDDIR)/instsetoo_native/util/openoffice.lst \
158 $(BUILDDIR)/ios/lo.xcconfig \
159 $(BUILDDIR)/lo.xcent \
160 $(BUILDDIR)/sysui/desktop/macosx/Info.plist
161 find $(SRCDIR)/solenv/gdb -name "*.pyc" -exec rm {} \;
164 # custom command
166 cmd:
167 echo "custom cmd" && ( $(cmd) )
170 # Fetch
172 ifneq ($(DO_FETCH_TARBALLS),NO)
173 include $(SRCDIR)/Makefile.fetch
174 fetch: download
175 fetch: get-submodules
177 ifneq (,$(wildcard $(SRCDIR)/.git))
178 get-submodules:
179 ifneq ($(foreach i,$(GIT_NEEDED_SUBMODULES),$(i)/.git),$(wildcard $(foreach i,$(GIT_NEEDED_SUBMODULES),$(i)/.git)))
180 cd $(SRCDIR) && ./g -f clone
181 endif
182 @cd $(SRCDIR) && ./g -z # make sure the git hooks are in place enen if no submodules are needed
184 else # these sources are from a tarball, so get the other source tarballs
185 gb_LO_VER := $(shell . $(SRCDIR)/sources.ver && echo $$lo_sources_ver)
186 $(if $(gb_LO_VER),,$(error Error while retrieving $$lo_sources_ver from $(SRCDIR)/sources.ver))
188 get-submodules: | download
189 ifneq ($(foreach i,$(subst helpcontent2,help,$(GIT_NEEDED_SUBMODULES)),$(SRCDIR)/src/libreoffice-$(i)-$(gb_LO_VER)),$(wildcard $(foreach i,$(subst helpcontent2,help,$(GIT_NEEDED_SUBMODULES)),$(SRCDIR)/src/libreoffice-$(i)-$(gb_LO_VER))))
190 $(foreach i,$(subst helpcontent2,help,$(GIT_NEEDED_SUBMODULES)),\
191 $(call fetch_Download_item,http://download.documentfoundation.org/libreoffice/src/$(shell echo $(gb_LO_VER) | sed -e "s/\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/"),libreoffice-$(i)-$(gb_LO_VER).tar.xz,no-check))
192 $(SRCDIR)/bin/unpack-sources $(SRCDIR) $(foreach i,$(subst helpcontent2,help,$(GIT_NEEDED_SUBMODULES)),\
193 $(TARFILE_LOCATION)/libreoffice-$(i)-$(gb_LO_VER).tar.xz)
194 endif
196 endif
198 else
199 fetch:
200 @echo "Automatic fetching of external tarballs is disabled."
202 endif
205 # Bootstap
207 bootstrap: compilerplugins
210 # Build
212 # Note: this will pipe through all gbuild targets to ... gbuild
213 # with some translations like "build"->"all" for historic reasons
215 build: bootstrap fetch $(if $(CROSS_COMPILING),cross-toolset)
216 ifneq ($(filter-out WNT MACOSX IOS ANDROID,$(OS)),)
217 mkdir -p $(INSTDIR) && install-gdb-printers -a $(INSTDIR) -c
218 endif
219 $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild \
220 $(if $(filter build check,$(MAKECMDGOALS)),all) \
221 $(if $(filter build-nocheck,$(MAKECMDGOALS)),build) \
222 $(if $(filter check,$(MAKECMDGOALS)),subsequentcheck) \
223 $(filter all build-l10n-only build-non-l10n-only debugrun help slowcheck translations unitcheck subsequentcheck check,$(MAKECMDGOALS))
224 ifeq ($(OS),IOS)
225 $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) ios
226 endif
228 build-nocheck check debugrun help slowcheck translations unitcheck subsequentcheck : build
230 cross-toolset: bootstrap fetch
231 $(GNUMAKE) gb_Side=build -j $(PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild build-tools
235 # Install
238 define gb_Top_DoInstall
239 echo "$(1) in $(INSTALLDIR) ..." && \
240 ooinstall $(2) "$(INSTALLDIR)"
242 endef
244 ifneq ($(OS),MACOSX)
245 define gb_Top_InstallFinished
246 echo && echo "If you want to edit the .ui files with glade first execute:" && \
247 echo && echo "export GLADE_CATALOG_SEARCH_PATH=$(2)/share/glade" && \
248 echo && echo "$(1) finished, you can now execute:" && \
249 echo "$(2)/program/soffice"
251 endef
252 else
253 define gb_Top_InstallFinished
254 echo && echo "$(1) finished, you can now run: " && \
255 echo "open $(2)/$(PRODUCTNAME).app" && \
256 echo "" && \
257 echo "To debug: gdb $(2)/$(PRODUCTNAME).app/Contents/MacOS/soffice"
259 endef
260 endif
262 ifneq ($(OS),MACOSX)
263 install:
264 @$(call gb_Top_DoInstall,Installing,)
265 @$(call gb_Top_InstallFinished,Installation,$(INSTALLDIR))
267 install-strip:
268 @$(call gb_Top_DoInstall,Installing and stripping binaries,--strip)
269 @$(call gb_Top_InstallFinished,Installation,$(INSTALLDIR))
270 endif # !MACOSX
272 dev-install:
273 @echo && echo "dev-install is obsolete! Just build with \"make check\" and run"
274 ifeq ($(OS),MACOSX)
275 @echo " open instdir/$(PRODUCTNAME).app"
276 @echo
277 @echo "To debug: gdb instdir/$(PRODUCTNAME).app/Contents/MacOS/soffice"
278 else
279 @echo " instdir/program/soffice"
280 endif
281 @echo
282 @echo "(only if you have good reason to test an actual installation: make test-install)"
283 @echo
284 @false
286 test-install: build
287 @rm -rf $(TESTINSTALLDIR)
288 @mkdir -p $(TESTINSTALLDIR)
289 ifeq ($(OS_FOR_BUILD),WNT)
290 cd $(SRCDIR)/instsetoo_native && $(GNUMAKE) LIBO_TEST_INSTALL=TRUE $(GMAKE_OPTIONS)
291 else
292 @ooinstall $(TESTINSTALLDIR)
293 ifneq ($(MACOSX_CODESIGNING_IDENTITY),)
294 @macosx-codesign-app-bundle $(TESTINSTALLDIR)/LibreOffice.app
295 endif
296 endif
297 @$(call gb_Top_InstallFinished,Test Installation,$(TESTINSTALLDIR))
299 distro-pack-install: install
300 $(SRCDIR)/bin/distro-install-clean-up
301 $(SRCDIR)/bin/distro-install-desktop-integration
302 $(SRCDIR)/bin/distro-install-sdk
303 $(SRCDIR)/bin/distro-install-file-lists
306 @create-ids
308 tags:
309 @create-tags
311 docs:
312 @mkdocs.sh $(SRCDIR)/docs $(SRCDIR)/solenv/inc/doxygen.cfg
314 findunusedcode:
315 @$(SRCDIR)/bin/findunusedcode $(SRCDIR) $(GNUMAKE)
317 findunusedheaders:
318 $(SRCDIR)/bin/find-unusedheaders.pl
321 dump-deps:
322 @$(SRCDIR)/bin/module-deps.pl $(GNUMAKE) $(SRCDIR)/Makefile.gbuild
324 dump-deps-png:
325 @$(SRCDIR)/bin/module-deps.pl $(GNUMAKE) $(SRCDIR)/Makefile.gbuild | dot -Tpng -o lo.png
327 define gb_Top_GbuildToIdeIntegration
328 $(1)-ide-integration:
329 cd $(SRCDIR) && (make cmd -npf Makefile.gbuild all || true) | $(SRCDIR)/bin/gbuild-to-ide --ide $(1)
331 endef
333 $(foreach ide,\
334 kdevelop, \
335 $(eval $(call gb_Top_GbuildToIdeIntegration,$(ide))))
337 endif # MAKE_RESTARTS
339 # vim: set noet sw=4 ts=4: