bump product version to 4.1.6.2
[LibreOffice.git] / Makefile.in
blobac9d1b4e2a35df0ed6e26de68c3267543d541abf
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 build check clean clean-build clean-host dev-install distclean distro-pack-install docs download fetch findunusedcode get-submodules id install install-strip install-tb subsequentcheck tags
12 ifeq ($(MAKECMDGOALS),)
13 MAKECMDGOALS:=all
14 endif
16 SHELL=/usr/bin/env bash
17 SRCDIR := @SRC_ROOT@
18 BUILDDIR := @BUILDDIR@
19 GIT_BUILD := $(if $(wildcard $(SRCDIR)/.git),T)
21 # Run autogen.sh if needed and force make to restart itself.
22 # ... but there are several cases where we do not want to run
23 # autogen.sh:
24 # 1. if we are building from tarballs, not git checkout (I do not
25 # think packagers would ever want that. I certainly do not.)
26 # 2. if we are making help, clean or distclean, because they do not
27 # need updated configuration
28 ifeq (,$(MAKE_RESTARTS)$(if $(GIT_BUILD),,T)$(if $(filter-out help clean distclean,$(MAKECMDGOALS)),,T))
30 .PHONY : force-restart
31 Makefile: $(BUILDDIR)/config_host.mk force-restart
32 @touch $@
34 # run configure in an environment not polluted by config_host.mk
35 $(BUILDDIR)/config_host.mk : \
36 $(SRCDIR)/config_host.mk.in \
37 $(SRCDIR)/Makefile.in \
38 $(SRCDIR)/instsetoo_native/util/openoffice.lst.in \
39 $(SRCDIR)/configure.ac \
40 $(if $(wildcard $(BUILDDIR)/autogen.input),$(BUILDDIR)/autogen.input,$(if $(wildcard $(BUILDDIR)/autogen.lastrun),$(BUILDDIR)/autogen.lastrun))
41 $(SRCDIR)/autogen.sh
43 # dummy rule in case any of the above prerequisites are removed, so
44 # that a stale Makefile still triggers autogen.sh, or in case
45 # autogen.input does not exist, or autogen.lastrun does not yet exist
46 $(SRCDIR)/config_host.mk.in \
47 $(SRCDIR)/Makefile.in \
48 $(SRCDIR)/instsetoo_native/util/openoffice.lst.in \
49 $(SRCDIR)/configure.ac \
50 $(BUILDDIR)/autogen.input \
51 $(BUILDDIR)/autogen.lastrun:
52 @true
54 else # MAKE_RESTARTS
56 all: build
58 ifeq ($(gb_Side),)
59 gb_Side := host
60 endif
62 include $(BUILDDIR)/config_$(gb_Side).mk
64 ifeq ($(GMAKE_OPTIONS),)
65 ifeq ($(verbose)$(VERBOSE),)
66 export GMAKE_OPTIONS:=-rs$(MAKEFLAGS)
67 else
68 export GMAKE_OPTIONS:=-r$(MAKEFLAGS)
69 endif
70 endif
73 # Partial Build
75 define gbuild_module_rules
76 .PHONY: $(1) $(1).all $(1).build $(1).check $(1).clean $(1).showdeliverables $(1).subsequentcheck
78 $(1): bootstrap fetch
79 cd $(SRCDIR)/$(1) && $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS)
81 $(1).build $(1).check $(1).clean $(1).showdeliverables:
82 cd $(SRCDIR)/$(1) && $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) $$(patsubst $(1).%,%,$$@)
84 $(1).subsequentcheck:
85 cd $(SRCDIR)/$(1) && $(GNUMAKE) -j $(CHECK_PARALLELISM) $(GMAKE_OPTIONS) subsequentcheck
87 $(1).all: bootstrap fetch
88 $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $(WORKDIR)/Module/$(1) $(if $(CROSS_COMPILING),,$(WORKDIR)/Module/check/$(1) $(WORKDIR)/Module/slowcheck/$(1))
90 endef
92 define gbuild_modules_rules
93 $(foreach m,$(1),$(call gbuild_module_rules,$(m)))
94 endef
96 gbuild_modules := $(filter-out Module%,$(subst /, ,$(subst $(SRCDIR)/,,$(wildcard $(SRCDIR)/*/Module_*.mk))))
98 $(eval $(call gbuild_modules_rules,$(gbuild_modules)))
100 gbuild_TARGETS := AllLangHelp \
101 AllLangPackage \
102 AllLangResTarget \
103 AutoInstallLibs \
104 CliLibrary \
105 CliNativeLibrary \
106 CliUnoApiTarget \
107 Configuration \
108 CppunitTest \
109 CustomTarget \
110 Dictionary \
111 Executable \
112 Extension \
113 ExternalPackage \
114 ExternalProject \
115 GeneratedPackage \
116 InstallModule \
117 InstallScript \
118 InternalUnoApi \
119 Jar \
120 JunitTest \
121 Library \
122 Module \
123 Package \
124 PackageSet \
125 Pagein \
126 Pyuno \
127 PythonTest \
128 Rdb \
129 StaticLibrary \
130 UIConfig \
131 UnoApi \
132 UnpackedTarball \
133 WinResTarget \
134 Zip \
136 # build a generic gbuild target
137 $(foreach target,$(gbuild_TARGETS),$(target)_% $(foreach module,$(gbuild_modules),$(target)_$(module)/%)):
138 $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $@
141 # Clean
143 clean: clean-host clean-build
145 clean-host:
146 rm -fr $(DEVINSTALLDIR)
147 rm -fr $(INSTDIR)
148 rm -fr $(OUTDIR)
149 rm -fr $(WORKDIR)
150 rm -fr install
152 clean-build:
153 ifeq ($(CROSS_COMPILING),YES)
154 rm -fr $(OUTDIR_FOR_BUILD)
155 rm -fr $(WORKDIR_FOR_BUILD)
156 endif
158 include $(SRCDIR)/compilerplugins/Makefile.mk
161 # Distclean
163 distclean : clean compilerplugins-clean
164 rm -fr \
165 $(BUILDDIR)/Makefile \
166 $(BUILDDIR)/aclocal.m4 \
167 $(BUILDDIR)/autom4te.cache \
168 $(BUILDDIR)/config.log \
169 $(BUILDDIR)/config.status \
170 $(BUILDDIR)/config_build.mk \
171 $(BUILDDIR)/config_host.mk \
172 $(BUILDDIR)/config_host.mk.stamp \
173 $(BUILDDIR)/config_host/*.h \
174 $(BUILDDIR)/config_host/*.mk \
175 $(BUILDDIR)/configure \
176 $(BUILDDIR)/instsetoo_native/util/openoffice.lst \
177 $(BUILDDIR)/lo.xcent
178 find $(SOLARENV)/gdb -name "*.pyc" -exec rm {} \;
181 # custom command
183 cmd:
184 echo "custom cmd" && ( $(cmd) )
187 # Fetch
189 ifneq ($(DO_FETCH_TARBALLS),NO)
190 include $(SRCDIR)/Makefile.fetch
191 fetch: download
192 fetch: get-submodules
194 ifneq (,$(wildcard $(SRCDIR)/.git))
195 get-submodules:
196 ifneq ($(foreach i,$(GIT_NEEDED_SUBMODULES),$(i)/.git),$(wildcard $(foreach i,$(GIT_NEEDED_SUBMODULES),$(i)/.git)))
197 cd $(SRCDIR) && ./g -f clone
198 endif
199 @cd $(SRCDIR) && ./g -z # make sure the git hooks are in place enen if no submodules are needed
201 else # these sources are from a tarball, so get the other source tarballs
202 gb_LO_VER := $(shell . $(SRCDIR)/sources.ver && echo $$lo_sources_ver)
203 $(if $(gb_LO_VER),,$(error Error while retrieving $$lo_sources_ver from $(SRCDIR)/sources.ver))
205 get-submodules: | download
206 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))))
207 $(foreach i,$(subst helpcontent2,help,$(GIT_NEEDED_SUBMODULES)),\
208 $(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))
209 $(SRCDIR)/bin/unpack-sources $(SRCDIR) $(foreach i,$(subst helpcontent2,help,$(GIT_NEEDED_SUBMODULES)),\
210 $(TARFILE_LOCATION)/libreoffice-$(i)-$(gb_LO_VER).tar.xz)
211 endif
213 endif
215 else
216 fetch:
217 @echo "Automatic fetching of external tarballs is disabled."
219 endif
222 # Bootstap
224 bootstrap: compilerplugins
227 # Build
229 build: bootstrap fetch $(if $(filter $(INPATH),$(INPATH_FOR_BUILD)),,cross-toolset)
230 $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild
231 ifeq ($(OS),IOS)
232 $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) ios
233 endif
235 build-nocheck: bootstrap fetch $(if $(filter $(INPATH),$(INPATH_FOR_BUILD)),,cross-toolset)
236 $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild build
238 cross-toolset: bootstrap fetch
239 $(GNUMAKE) gb_Side=build -j $(PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild build-tools
242 # Install
245 install:
246 echo "Installing in $(INSTALLDIR)..." && \
247 ooinstall "$(INSTALLDIR)" && \
248 echo "" && \
249 echo "Installation finished, you can now execute:" && \
250 echo "$(INSTALLDIR)/program/soffice"
252 install-strip:
253 echo "Installing and stripping binaries in $(INSTALLDIR)..." && \
254 ooinstall --strip "$(INSTALLDIR)" && \
255 echo "" && \
256 echo "Installation finished, you can now execute:" && \
257 echo "$(INSTALLDIR)/program/soffice"
259 ifeq ($(ENABLE_MACOSX_SANDBOX),YES)
260 entitlements:=--entitlements $(SRC_ROOT)/lo.xcent
261 endif
263 dev-install: build
264 @rm -rf $(DEVINSTALLDIR)
265 @mkdir $(DEVINSTALLDIR)
266 ifeq ($(OS_FOR_BUILD),WNT)
267 cd $(SRCDIR)/instsetoo_native && $(GNUMAKE) LIBO_DEV_INSTALL=TRUE $(GMAKE_OPTIONS)
268 else
269 ifeq ($(DISABLE_LINKOO),TRUE)
270 @ooinstall $(DEVINSTALLDIR)/opt
271 ifneq ($(MACOSX_CODESIGNING_IDENTITY),)
273 # Sign dylibs
275 # Executables get signed right after linking, see
276 # solenv/gbuild/platform/macosx.mk. But many of our dylibs are built
277 # by ad-hoc or 3rd-party mechanisms, so we can't easily sign them
278 # right after linking. So do it here.
280 # The dylibs in the Python framework are called *.so. Go figure
282 find $(DEVINSTALLDIR)/opt/LibreOffice.app \( -name '*.dylib' -or -name '*.dylib.*' -or -name '*.so' \) ! -type l | \
283 while read dylib; do \
284 id=`basename "$$dylib"`; \
285 case $$id in \
286 *.dylib|*.so) \
287 ;; \
288 *.dylib.*) \
289 id=`echo $$id | sed -e 's/dylib.*/dylib/'`; \
290 ;; \
291 esac; \
292 codesign --verbose --identifier=$(MACOSX_BUNDLE_IDENTIFIER).$$id --sign $(MACOSX_CODESIGNING_IDENTITY) "$$dylib"; \
293 done
295 # Sign frameworks.
297 # Yeah, we don't bundle any other framework than our Python one, and
298 # it has just one version, so this generic search is mostly for
299 # completeness.
301 for framework in `find $(DEVINSTALLDIR)/opt/LibreOffice.app -name '*.framework' -type d`; do \
302 for version in $$framework/Versions/*; do \
303 test -d $$version && codesign --force --verbose --prefix=$(MACOSX_BUNDLE_IDENTIFIER). --sign $(MACOSX_CODESIGNING_IDENTITY) $$version; \
304 done; \
305 done
307 # Sign the app bundle as a whole (will sign the soffice binary)
309 # The soffice binary will have been signed after linking but it needs
310 # to be re-signed as it has been renamed, or modified, or something
311 # after linking.
313 # At this stage we also attach the entitlements in the sandboxing case
315 codesign --force --verbose --sign $(MACOSX_CODESIGNING_IDENTITY) $(entitlements) $(DEVINSTALLDIR)/opt/LibreOffice.app
317 endif
318 @install-gdb-printers -L
319 else
320 @ooinstall -l $(DEVINSTALLDIR)/opt
321 endif
322 endif
323 @rm -f $(BUILDDIR)/install && ln -s $(DEVINSTALLDIR)/opt/ $(BUILDDIR)/install
324 @echo
325 @echo "If you want to edit the .ui files with glade first execute:"
326 @echo
327 @echo "export GLADE_CATALOG_SEARCH_PATH=$(SRCDIR)/install/share/glade"
328 ifeq ($(OS),LINUX)
329 @echo
330 @echo "Developer installation finished, you can now execute:"
331 @echo
332 @echo "$(BUILDDIR)/install/program/soffice"
333 else ifeq ($(OS),MACOSX)
334 @echo
335 @echo "Developer installation finished, you can now run:"
336 @echo
337 @echo " open $(BUILDDIR)/install/LibreOffice.app"
338 @echo
339 @echo "To debug: gdb install/LibreOffice.app/Contents/MacOS/soffice"
340 endif
342 dev-install-nocheck: build-nocheck
343 $(MAKE) dev-install -o build
345 # FIXME: shouldn't linkoo be BUILDDIR vs SRCDIR aware ?
346 dev-update:
347 ifeq ($(DISABLE_LINKOO),TRUE)
348 @linkoo --copy $(DEVINSTALLDIR)/opt $(SRCDIR)
349 else
350 @linkoo $(DEVINSTALLDIR)/opt $(SRCDIR)
351 endif
353 install-tb:
354 @rm -rf $(DEVINSTALLDIR)
355 @mkdir $(DEVINSTALLDIR)
356 ifeq ($(OS_FOR_BUILD),WNT)
357 cd $(SRCDIR)/instsetoo_native && $(GNUMAKE) LIBO_DEV_INSTALL=TRUE $(GMAKE_OPTIONS)
358 else
359 @ooinstall $(DEVINSTALLDIR)/opt
360 @install-gdb-printers
361 endif
362 @rm -f $(BUILDDIR)/install && ln -s $(DEVINSTALLDIR)/opt/ $(BUILDDIR)/install
364 distro-pack-install: install
365 $(SRCDIR)/bin/distro-install-clean-up
366 $(SRCDIR)/bin/distro-install-desktop-integration
367 $(SRCDIR)/bin/distro-install-sdk
368 $(SRCDIR)/bin/distro-install-file-lists
371 @create-ids
373 tags:
374 @create-tags
376 docs:
377 @mkdocs.sh $(SRCDIR)/docs $(SOLARENV)/inc/doxygen.cfg
379 findunusedcode:
380 @which callcatcher > /dev/null 2>&1 || \
381 (echo "callcatcher not installed" && false)
382 @sed -e s,$$INPATH,callcatcher,g config_host.mk | sed -e s,"export OOO_JUNIT_JAR=.*","export OOO_JUNIT_JAR=",g > $(SRCDIR)/config_host_callcatcher.mk
383 @echo unexport ARCH_FLAGS >> $(SRCDIR)/config_host_callcatcher.mk
384 @echo unexport CFLAGS >> $(SRCDIR)/config_host_callcatcher.mk
385 @echo unexport CXXFLAGS >> $(SRCDIR)/config_host_callcatcher.mk
386 @mkdir -p $(SRCDIR)/solenv/callcatcher/bin && \
387 $(GNUMAKE) -f $(SOLARENV)/bin/callcatcher.Makefile findunusedcode
388 @grep ::.*\( unusedcode.all \
389 | grep -v ^Atom \
390 | grep -v ^atom:: \
391 | grep -v ^boost:: \
392 | grep -v ^CIcc \
393 | grep -v ^CLuceneError:: \
394 | grep -v ^cppu:: \
395 | grep -v ^CppUnit:: \
396 | grep -v ^Dde \
397 | grep -v ^graphite2:: \
398 | grep -v ^jvmaccess:: \
399 | grep -v ^libcdr:: \
400 | grep -v ^libcmis:: \
401 | grep -v ^libmspub:: \
402 | grep -v ^libvisio:: \
403 | grep -v ^libwpg:: \
404 | grep -v ^libwps_tools_win:: \
405 | grep -v ^lucene:: \
406 | grep -v ^Matrix3d:: \
407 | grep -v ^RelatedMultipart:: \
408 | grep -v ^salhelper:: \
409 | grep -v ^VSDInternalStream:: \
410 | grep -v ^WP1 \
411 | grep -v ^WP3 \
412 | grep -v ^WP42 \
413 | grep -v ^WP6 \
414 | grep -v ^WPG \
415 | grep -v ^WPS \
416 | grep -v WPX \
417 | grep -v ^WSObject \
418 > unusedcode.easy
420 check: dev-install subsequentcheck
422 dump-deps:
423 @$(SRCDIR)/bin/module-deps.pl $(GNUMAKE) $(SRCDIR)/Makefile.gbuild
425 dump-deps-png:
426 @$(SRCDIR)/bin/module-deps.pl $(GNUMAKE) $(SRCDIR)/Makefile.gbuild | dot -Tpng -o lo.png
428 subsequentcheck :| $(if $(filter-out subsequentcheck,$(MAKECMDGOALS)),dev-install)
429 $(GNUMAKE) -j $(CHECK_PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $@
431 .PHONY : debugrun help slowcheck translations unitcheck
432 debugrun help slowcheck translations unitcheck :
433 $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.gbuild $@
435 endif # MAKE_RESTARTS
437 # vim: set noet sw=4 ts=4: