remove BluetoothOperator wrapper
[LibreOffice.git] / Makefile.in
blob4ac5c4696789cb929b7d31facd7146c7d18a3cd5
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 packageinfo
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.Build.log \
152 $(BUILDDIR)/config.status \
153 $(BUILDDIR)/config_build.mk \
154 $(BUILDDIR)/config_host.mk \
155 $(BUILDDIR)/config_host.mk.stamp \
156 $(BUILDDIR)/config_host/*.h \
157 $(BUILDDIR)/configure \
158 $(BUILDDIR)/instsetoo_native/util/openoffice.lst \
159 $(BUILDDIR)/ios/lo.xcconfig \
160 $(BUILDDIR)/lo.xcent \
161 $(BUILDDIR)/sysui/desktop/macosx/Info.plist
162 find $(SRCDIR)/solenv/gdb -name "*.pyc" -exec rm {} \;
165 # custom command
167 cmd:
168 echo "custom cmd" && ( $(cmd) )
171 # Fetch
173 ifneq ($(DO_FETCH_TARBALLS),NO)
174 include $(SRCDIR)/Makefile.fetch
175 fetch: download
176 fetch: get-submodules
178 ifneq (,$(wildcard $(SRCDIR)/.git))
179 get-submodules:
180 ifneq ($(foreach i,$(GIT_NEEDED_SUBMODULES),$(i)/.git),$(wildcard $(foreach i,$(GIT_NEEDED_SUBMODULES),$(i)/.git)))
181 cd $(SRCDIR) && ./g -f clone
182 endif
183 @cd $(SRCDIR) && ./g -z # make sure the git hooks are in place enen if no submodules are needed
185 else # these sources are from a tarball, so get the other source tarballs
186 gb_LO_VER := $(shell . $(SRCDIR)/sources.ver && echo $$lo_sources_ver)
187 $(if $(gb_LO_VER),,$(error Error while retrieving $$lo_sources_ver from $(SRCDIR)/sources.ver))
189 get-submodules: | download
190 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))))
191 $(foreach i,$(subst helpcontent2,help,$(GIT_NEEDED_SUBMODULES)),\
192 $(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))
193 $(SRCDIR)/bin/unpack-sources $(SRCDIR) $(foreach i,$(subst helpcontent2,help,$(GIT_NEEDED_SUBMODULES)),\
194 $(TARFILE_LOCATION)/libreoffice-$(i)-$(gb_LO_VER).tar.xz)
195 endif
197 endif
199 else
200 fetch:
201 @echo "Automatic fetching of external tarballs is disabled."
203 endif
206 # Bootstap
208 bootstrap: compilerplugins
211 # Build
213 # Note: this will pipe through all gbuild targets to ... gbuild
214 # with some translations like "build"->"all" for historic reasons
216 build: bootstrap fetch $(if $(CROSS_COMPILING),cross-toolset)
217 ifneq ($(filter-out WNT MACOSX IOS ANDROID,$(OS)),)
218 mkdir -p $(INSTDIR) && install-gdb-printers -a $(INSTDIR) -c
219 endif
220 $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild \
221 $(if $(filter build check,$(MAKECMDGOALS)),all) \
222 $(if $(filter build-nocheck,$(MAKECMDGOALS)),build) \
223 $(if $(filter check,$(MAKECMDGOALS)),subsequentcheck) \
224 $(filter all build-l10n-only build-non-l10n-only debugrun help slowcheck translations unitcheck subsequentcheck check packageinfo,$(MAKECMDGOALS))
225 ifeq ($(OS),IOS)
226 $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) ios
227 endif
229 build-non-l10n-only build-l10n-only build-nocheck check debugrun help slowcheck translations unitcheck subsequentcheck packageinfo: build
231 cross-toolset: bootstrap fetch
232 $(GNUMAKE) gb_Side=build -j $(PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild build-tools
236 # Install
239 define gb_Top_DoInstall
240 echo "$(1) in $(INSTALLDIR) ..." && \
241 ooinstall $(2) "$(INSTALLDIR)"
243 endef
245 ifneq ($(OS),MACOSX)
246 define gb_Top_InstallFinished
247 echo && echo "If you want to edit the .ui files with glade first execute:" && \
248 echo && echo "export GLADE_CATALOG_SEARCH_PATH=$(2)/share/glade" && \
249 echo && echo "$(1) finished, you can now execute:" && \
250 echo "$(2)/program/soffice"
252 endef
253 else
254 define gb_Top_InstallFinished
255 echo && echo "$(1) finished, you can now run: " && \
256 echo "open $(2)/$(PRODUCTNAME).app" && \
257 echo "" && \
258 echo "To debug: gdb $(2)/$(PRODUCTNAME).app/Contents/MacOS/soffice"
260 endef
261 endif
263 ifneq ($(OS),MACOSX)
264 install:
265 @$(call gb_Top_DoInstall,Installing,)
266 @$(call gb_Top_InstallFinished,Installation,$(INSTALLDIR))
268 install-strip:
269 @$(call gb_Top_DoInstall,Installing and stripping binaries,--strip)
270 @$(call gb_Top_InstallFinished,Installation,$(INSTALLDIR))
271 endif # !MACOSX
273 dev-install:
274 @echo && echo "dev-install is obsolete! Just build with \"make check\" and run"
275 ifeq ($(OS),MACOSX)
276 @echo " open instdir/$(PRODUCTNAME).app"
277 @echo
278 @echo "To debug: gdb instdir/$(PRODUCTNAME).app/Contents/MacOS/soffice"
279 else
280 @echo " instdir/program/soffice"
281 endif
282 @echo
283 @echo "(only if you have good reason to test an actual installation: make test-install)"
284 @echo
285 @false
287 test-install: build
288 @rm -rf $(TESTINSTALLDIR)
289 @mkdir -p $(TESTINSTALLDIR)
290 ifeq ($(OS_FOR_BUILD),WNT)
291 cd $(SRCDIR)/instsetoo_native && $(GNUMAKE) LIBO_TEST_INSTALL=TRUE $(GMAKE_OPTIONS)
292 else
293 @ooinstall $(TESTINSTALLDIR)
294 ifneq ($(MACOSX_CODESIGNING_IDENTITY),)
295 @macosx-codesign-app-bundle $(TESTINSTALLDIR)/LibreOffice.app
296 endif
297 endif
298 @$(call gb_Top_InstallFinished,Test Installation,$(TESTINSTALLDIR))
300 distro-pack-install: install
301 $(SRCDIR)/bin/distro-install-clean-up
302 $(SRCDIR)/bin/distro-install-desktop-integration
303 $(SRCDIR)/bin/distro-install-sdk
304 $(SRCDIR)/bin/distro-install-file-lists
306 install-package-%:
307 $(GNUMAKE) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $@
310 @create-ids
312 tags:
313 @create-tags
315 docs:
316 @mkdocs.sh $(SRCDIR)/docs $(SRCDIR)/solenv/inc/doxygen.cfg
318 findunusedcode:
319 @$(SRCDIR)/bin/findunusedcode $(SRCDIR) $(GNUMAKE)
321 findunusedheaders:
322 $(SRCDIR)/bin/find-unusedheaders.pl
325 dump-deps:
326 @$(SRCDIR)/bin/module-deps.pl $(GNUMAKE) $(SRCDIR)/Makefile.gbuild
328 dump-deps-png:
329 @$(SRCDIR)/bin/module-deps.pl $(GNUMAKE) $(SRCDIR)/Makefile.gbuild | dot -Tpng -o lo.png
331 define gb_Top_GbuildToIdeIntegration
332 $(1)-ide-integration:
333 cd $(SRCDIR) && (make cmd="make -npf Makefile.gbuild all" cmd || true) | $(SRCDIR)/bin/gbuild-to-ide --ide $(1)
335 endef
337 $(foreach ide,\
338 kdevelop \
339 xcode, \
340 $(eval $(call gb_Top_GbuildToIdeIntegration,$(ide))))
342 endif # MAKE_RESTARTS
344 # vim: set noet sw=4 ts=4: