1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
3 .PHONY : all bootstrap build check clean clean-build clean-host dev-install distclean distro-pack-install docs fetch findunusedcode id install install-strip subsequentcheck tags
5 ifeq ($(MAKECMDGOALS),)
11 SHELL=/usr/bin/env bash
12 SRCDIR:=$(patsubst %/,%,$(dir $(realpath $(firstword $(MAKEFILE_LIST)))))
18 include $(SRCDIR)/config_$(gb_Side).mk
20 ifeq ($(GMAKE_OPTIONS),)
22 export GMAKE_OPTIONS:=-rs
24 export GMAKE_OPTIONS:=-r
245 gb_TAILBUILDMODULES := $(shell $(GNUMAKE) -r -f $(SRCDIR)/tail_build/Makefile showmodules)
246 export gb_TAILBUILDTARGET=all slowcheck
248 define gbuild_module_rules
249 .PHONY: $(1) $(1).all $(1).clean $(1).deliver
251 $(1): bootstrap fetch
252 cd $(1) && $(GNUMAKE) -j $(GMAKE_PARALLELISM) $(GMAKE_OPTIONS) gb_PARTIALBUILD=T
254 ifeq ($(filter $(1),$(gb_TAILBUILDMODULES)),)
255 $(1).all: bootstrap fetch
256 cd $(1) && unset MAKEFLAGS && \
257 $(SOLARENV)/bin/build.pl -P$(BUILD_NCPUS) --all -- -P$(GMAKE_PARALLELISM)
259 $(1).all: bootstrap fetch
260 cd tail_build && unset MAKEFLAGS && \
261 export gb_TAILBUILDTARGET="$(WORKDIR)/Module/$(1) $(WORKDIR)/Module/check/$(1) $(WORKDIR)/Module/slowcheck/$(1)" && \
262 $(SOLARENV)/bin/build.pl -P$(BUILD_NCPUS) --all -- -P$(GMAKE_PARALLELISM)
266 cd $(1) && $(GNUMAKE) -j $(GMAKE_PARALLELISM) $(GMAKE_OPTIONS) clean gb_PARTIALBUILD=T
268 $(1).subsequentcheck:
269 cd $(1) && $(GNUMAKE) -j $(GMAKE_PARALLELISM) $(GMAKE_OPTIONS) subsequentcheck gb_PARTIALBUILD=T
276 define gbuild_modules_rules
277 $(foreach m,$(1),$(call gbuild_module_rules,$(m)))
280 define dmake_module_rules
281 .PHONY: $(1) $(1).all $(1).deliver $(1).clean
283 $(1): bootstrap fetch
284 cd $(1) && unset MAKEFLAGS && \
285 $(SOLARENV)/bin/build.pl -P$(BUILD_NCPUS) -- -P$(GMAKE_PARALLELISM)
287 $(1).all: bootstrap fetch
288 cd $(1) && unset MAKEFLAGS && \
289 $(SOLARENV)/bin/build.pl -P$(BUILD_NCPUS) --all -- -P$(GMAKE_PARALLELISM)
292 cd $(1) && $(SOLARENV)/bin/deliver.pl
295 cd $(1) && $(SOLARENV)/bin/deliver.pl -delete
296 rm -fr $(1)/$(INPATH)
300 define dmake_modules_rules
301 $(foreach m,$(1),$(call dmake_module_rules,$(m)))
307 $(eval $(call gbuild_modules_rules,$(gbuild_modules)))
309 $(eval $(call dmake_modules_rules,$(dmake_modules)))
314 clean: clean-host clean-build
317 rm -fr $(DEVINSTALLDIR)
318 rm -fr $(SOLARVER)/$(INPATH) # not necessarily below SRCDIR
319 rm -fr $(SRCDIR)/*/$(INPATH)
323 ifeq ($(CROSS_COMPILING),YES)
324 rm -rf $(SOLARVER)/$(INPATH_FOR_BUILD) # not necessarily below SRCDIR
325 rm -rf $(SRCDIR)/*/$(INPATH_FOR_BUILD)
332 ifeq ($(BUILD_DMAKE),YES)
333 (if [ -f dmake/Makefile ] ; then $(GNUMAKE) -j $(GMAKE_PARALLELISM) -C dmake distclean; fi) && \
334 rm -f solenv/*/bin/dmake*
336 rm -fr config_host.mk config_build.mk aclocal.m4 autom4te.cache \
337 bin/repo-list config.log config.status configure \
338 ooo.lst post_download post_download.log \
339 config_host.mk.last set_soenv.stamp src.downloaded warn
340 find $(SOLARENV)/gdb -name "*.pyc" -exec rm {} \;
345 ifneq ( $(MAKECMDGOALS),cmd)
347 echo "custom cmd" && ( $(cmd) )
351 ifneq ($(filter-out clean distclean,$(MAKECMDGOALS)),)
355 fetch: src.downloaded
357 src.downloaded : Makefile.top download ooo.lst bin/repo-list
358 ifeq ($(DO_FETCH_TARBALLS),YES)
359 @./download $(SRCDIR)/ooo.lst && touch $@
361 @echo "Automatic fetching of external tarballs is disabled."
367 bootstrap: $(WORKDIR)/bootstrap
369 $(WORKDIR)/bootstrap:
370 @cd $(SRCDIR) && ./bootstrap
371 @mkdir -p $(dir $@) && touch $@
376 build-packimages: bootstrap fetch $(if $(filter $(INPATH),$(INPATH_FOR_BUILD)),,cross-toolset)
377 ifeq ($(DISABLE_SCRIPTING),TRUE)
378 # We must get the headers from vbahelper "delivered" because
379 # as we don't link to any libs from there they won't otherwise be, or
380 # something. And we still do include those headers always even if the
381 # libs aren't built in the --disable-scripting case. (Ifdefs for
382 # DISABLE_SCRIPTING will be added to the code later as necessary.)
385 ifeq ($(DISABLE_DBCONNECTIVITY),TRUE)
386 # Ditto for dbconnectivity in the --disable-database-connectivity case
387 cd connectivity && sed -e 's/^\(export [A-Z0-9_]*=\)\(.*\)$$/\1"\2"/' <../config_host.mk >conftmp.sh && . conftmp.sh && rm conftmp.sh && $(SOLARENV)/bin/deliver.pl
389 cd packimages && unset MAKEFLAGS && \
390 $(SOLARENV)/bin/build.pl -P$(BUILD_NCPUS) --all -- -P$(GMAKE_PARALLELISM) && \
391 $(GNUMAKE) -j $(GMAKE_PARALLELISM) $(GMAKE_OPTIONS)
393 build: build-packimages
394 ifeq ($(OS_FOR_BUILD),WNT)
395 cd instsetoo_native && unset MAKEFLAGS && $(SOLARENV)/bin/build.pl
397 cd instsetoo_native && unset MAKEFLAGS && \
398 $(SOLARENV)/bin/build.pl -P$(BUILD_NCPUS) -- -P$(GMAKE_PARALLELISM)
401 cross-toolset: bootstrap fetch
402 cd cross_toolset && $(GNUMAKE) -j $(GMAKE_PARALLELISM) $(GMAKE_OPTIONS)
410 echo "Installing in $(INSTALLDIR)..." && \
411 ooinstall "$(INSTALLDIR)" && \
413 echo "Installation finished, you can now execute:" && \
414 echo "$(INSTALLDIR)/program/soffice"
417 echo "Installing and stripping binaries in $(INSTALLDIR)..." && \
418 ooinstall --strip "$(INSTALLDIR)" && \
420 echo "Installation finished, you can now execute:" && \
421 echo "$(INSTALLDIR)/program/soffice"
424 @rm -rf $(DEVINSTALLDIR)
425 @mkdir $(DEVINSTALLDIR)
426 ifeq ($(DISABLE_LINKOO),TRUE)
427 @ooinstall $(DEVINSTALLDIR)/opt
428 @install-gdb-printers -L
430 @ooinstall -l $(DEVINSTALLDIR)/opt
432 @rm -f $(SRCDIR)/install && ln -s $(DEVINSTALLDIR)/opt/ $(SRCDIR)/install
434 distro-pack-install: install
435 $(SRCDIR)/bin/distro-install-clean-up
436 $(SRCDIR)/bin/distro-install-desktop-integration
437 $(SRCDIR)/bin/distro-install-sdk
438 $(SRCDIR)/bin/distro-install-file-lists
447 @mkdocs.sh $(SRCDIR)/docs $(SOLARENV)/inc/doxygen.cfg
450 @which callcatcher > /dev/null 2>&1 || \
451 (echo "callcatcher not installed" && false)
452 @sed -e s,$$INPATH,callcatcher,g $(SRCDIR)/config_host.mk | sed -e s,"export OOO_JUNIT_JAR=.*","export OOO_JUNIT_JAR=",g > $(SRCDIR)/config_host_callcatcher.mk
453 @mkdir -p $(SRCDIR)/solenv/callcatcher/bin && \
454 ln -sf $(SRCDIR)/solenv/$(INPATH)/bin/dmake \
455 $(SRCDIR)/solenv/callcatcher/bin/dmake
456 @$(GNUMAKE) -f $(SOLARENV)/bin/callcatcher.Makefile findunusedcode
457 @grep ::.*\( unusedcode.all \
461 | grep -v ^CLuceneError:: \
464 | grep -v ^graphite2:: \
465 | grep -v ^jvmaccess:: \
466 | grep -v ^libcdr:: \
467 | grep -v ^libcmis:: \
468 | grep -v ^libvisio:: \
469 | grep -v ^libwpg:: \
470 | grep -v ^libwps_tools_win:: \
471 | grep -v ^lucene:: \
472 | grep -v ^Matrix3d:: \
473 | grep -v ^salhelper:: \
483 check: dev-install subsequentcheck
485 subsequentcheck :| $(if $(filter-out subsequentcheck,$(MAKECMDGOALS)),dev-install)
486 $(GNUMAKE) -j $(GMAKE_PARALLELISM) $(GMAKE_OPTIONS) -f Makefile.post $@
489 $(GNUMAKE) -j $(GMAKE_PARALLELISM) $(GMAKE_OPTIONS) -f Makefile.post $@
491 endif # not clean or distclean
494 #########################
499 @cat $(SRCDIR)/solenv/gbuild/gbuild.help.txt
503 # vim: set noet sw=4 ts=4: