office-gobmx/Makefile.in

428 lines
13 KiB
Makefile
Raw Normal View History

# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# Copyright 2012 LibreOffice contributors.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
.PHONY : all bootstrap build check clean clean-build clean-host dev-install distclean distro-pack-install docs download fetch findunusedcode get-submodules help id install install-strip install-tb subsequentcheck tags
ifeq ($(MAKECMDGOALS),)
MAKECMDGOALS:=all
endif
SHELL=/usr/bin/env bash
SRCDIR := @SRC_ROOT@
BUILDDIR := @BUILDDIR@
# Next 'if' means:
# If you want to make something more than help clean distclean,
# and make has not yet restarted itself..
# ..run autogen.sh if needed and force make to restart itself.
ifeq (,$(MAKE_RESTARTS)$(if $(filter-out help clean distclean,$(MAKECMDGOALS)),,T))
2012-03-06 16:43:07 -06:00
.PHONY : force-restart
Makefile: $(BUILDDIR)/config_host.mk force-restart
@touch $@
# run configure in an environment not polluted by config_host.mk
$(BUILDDIR)/config_host.mk : \
$(SRCDIR)/config_host.mk.in \
$(SRCDIR)/Makefile.in \
$(SRCDIR)/solenv/inc/minor.mk.in \
$(SRCDIR)/instsetoo_native/util/openoffice.lst.in \
$(SRCDIR)/configure.ac \
$(BUILDDIR)/autogen.lastrun
$(SRCDIR)/autogen.sh
# dummy rule in case autogen.lastrun does not exist
$(BUILDDIR)/autogen.lastrun:
@true
else # MAKE_RESTARTS
all: build
ifeq ($(gb_Side),)
export gb_Side:=host
endif
include $(BUILDDIR)/config_$(gb_Side).mk
SRCDIR:=$(SRC_ROOT)
ifeq ($(GMAKE_OPTIONS),)
ifeq ($(verbose)$(VERBOSE),)
export GMAKE_OPTIONS:=-rs
else
export GMAKE_OPTIONS:=-r
endif
endif
# This list tells which modules are gbuild ones. It does *not* tell which modules to build. That is directed
# by the module being mentioned in postprocess/prj/build.lst, etc, recursively.
$(WORKDIR)/modules.mk: $(wildcard */Module_*.mk) $(BUILDDIR)/config_host.mk
mkdir -p $(dir $@)
echo "gbuild_modules:= tail_build \\" > $@
for m in `cd $(SRCDIR) && ls */Module_*.mk`; do echo $$m | sed -e 's/\/.*$$/ \\/'; done >> $@
echo >> $@
-include $(WORKDIR)/modules.mk
include $(SRCDIR)/solenv/gbuild/Output.mk
define gbuild_module_rules
.PHONY: $(1) $(1).all $(1).build $(1).check $(1).clean $(1).showdeliverables $(1).subsequentcheck
$(1): bootstrap fetch
cd $(1) && $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS)
$(1).build $(1).check $(1).clean $(1).showdeliverables:
cd $(1) && $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) $$(patsubst $(1).%,%,$$@)
$(1).subsequentcheck:
cd $(1) && $(GNUMAKE) -j $(CHECK_PARALLELISM) $(GMAKE_OPTIONS) subsequentcheck
$(1).all: bootstrap fetch
$(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.build $(WORKDIR)/Module/$(1) $(WORKDIR)/Module/check/$(1) $(WORKDIR)/Module/slowcheck/$(1)
endef
define gbuild_modules_rules
$(foreach m,$(1),$(call gbuild_module_rules,$(m)))
endef
#
# Partial Build
#
$(eval $(call gbuild_modules_rules,$(gbuild_modules)))
# run a JunitTest - relies on naming convention (module prefix)
$(WORKDIR)/JunitTest/%/done :
cd $(firstword $(subst _, ,$*)) && $(GNUMAKE) $(GMAKE_OPTIONS) $@
# run a CppunitTest - relies on naming convention (module prefix)
$(WORKDIR)/CppunitTest/%.test :
cd $(firstword $(subst _, ,$*)) && $(GNUMAKE) $(GMAKE_OPTIONS) $@
#
# Help
#
help:
@cat $(SRCDIR)/solenv/gbuild/gbuild.help.txt
#
# Clean
#
clean: clean-host clean-build
clean-host:
rm -fr $(DEVINSTALLDIR)
rm -fr $(OUTDIR)
rm -fr $(WORKDIR)
rm -fr $(SRCDIR)/*/$(INPATH)
rm -fr $(SRCDIR)/solenv/$(OUTPATH)
rm -fr install
clean-build:
ifeq ($(CROSS_COMPILING),YES)
rm -rf $(SOLARVER)/$(INPATH_FOR_BUILD) # not necessarily below SRCDIR
rm -rf $(SRCDIR)/*/$(INPATH_FOR_BUILD)
endif
include $(SRCDIR)/compilerplugins/Makefile.mk
#
# Distclean
#
distclean : clean compilerplugins-clean
rm -fr \
$(BUILDDIR)/Makefile \
$(BUILDDIR)/aclocal.m4 \
$(BUILDDIR)/autom4te.cache \
$(BUILDDIR)/config.log \
$(BUILDDIR)/config.status \
$(BUILDDIR)/config_build.mk \
$(BUILDDIR)/config_host.mk \
$(BUILDDIR)/config_host.mk.stamp \
$(BUILDDIR)/config_host/*.h \
$(BUILDDIR)/configure \
$(BUILDDIR)/instsetoo_native/util/openoffice.lst \
$(BUILDDIR)/lo.xcent \
$(BUILDDIR)/solenv/inc/minor.mk \
$(BUILDDIR)/warn
find $(SOLARENV)/gdb -name "*.pyc" -exec rm {} \;
#
# custom command
#
ifneq ( $(MAKECMDGOALS),cmd)
cmd:
echo "custom cmd" && ( $(cmd) )
endif
ifneq ($(filter-out clean distclean,$(MAKECMDGOALS)),)
#
# Fetch
#
ifneq ($(DO_FETCH_TARBALLS),NO)
include $(SRCDIR)/Makefile.fetch
fetch: download
fetch: get-submodules
ifneq (,$(wildcard $(SRCDIR)/.git))
get-submodules:
ifneq ($(foreach i,$(GIT_NEEDED_SUBMODULES),$(i)/.git),$(wildcard $(foreach i,$(GIT_NEEDED_SUBMODULES),$(i)/.git)))
cd $(SRCDIR) && ./g -f clone
endif
@cd $(SRCDIR) && ./g -z # make sure the git hooks are in place enen if no submodules are needed
else # these sources are from a tarball, so get the other source tarballs
gb_LO_VER := $(shell . $(SRCDIR)/sources.ver && echo $$lo_sources_ver)
$(if $(gb_LO_VER),,$(error Error while retrieving $$lo_sources_ver from $(SRCDIR)/sources.ver))
get-submodules: | download
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))))
$(foreach i,$(subst helpcontent2,help,$(GIT_NEEDED_SUBMODULES)),\
$(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))
$(SRCDIR)/bin/unpack-sources $(SRCDIR) $(foreach i,$(subst helpcontent2,help,$(GIT_NEEDED_SUBMODULES)),\
$(TARFILE_LOCATION)/libreoffice-$(i)-$(gb_LO_VER).tar.xz)
endif
endif
else
fetch:
@echo "Automatic fetching of external tarballs is disabled."
endif
#
# Bootstap
#
bootstrap: compilerplugins
#
# Build
#
build: bootstrap fetch $(if $(filter $(INPATH),$(INPATH_FOR_BUILD)),,cross-toolset)
ifeq ($(DISABLE_SCRIPTING),TRUE)
# We must get the headers from vbahelper "delivered" because
# as we don't link to any libs from there they won't otherwise be, or
# something. And we still do include those headers always even if the
# libs aren't built in the --disable-scripting case. (Ifdefs for
# DISABLE_SCRIPTING will be added to the code later as necessary.)
$(GNUMAKE) vbahelper
endif
ifeq ($(DISABLE_DBCONNECTIVITY),TRUE)
# Ditto for dbconnectivity in the --disable-database-connectivity case
$(GNUMAKE) connectivity
endif
$(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.build all slowcheck
ifeq ($(OS),ANDROID)
cd android && $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS)
endif
ifeq ($(OS),IOS)
cd ios && $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS)
endif
build-nocheck : export SKIP_TESTS := YES
build-nocheck : build
cross-toolset: bootstrap fetch
$(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.cross
#
# Install
#
install:
echo "Installing in $(INSTALLDIR)..." && \
ooinstall "$(INSTALLDIR)" && \
echo "" && \
echo "Installation finished, you can now execute:" && \
echo "$(INSTALLDIR)/program/soffice"
install-strip:
echo "Installing and stripping binaries in $(INSTALLDIR)..." && \
ooinstall --strip "$(INSTALLDIR)" && \
echo "" && \
echo "Installation finished, you can now execute:" && \
echo "$(INSTALLDIR)/program/soffice"
ifeq ($(ENABLE_MACOSX_SANDBOX),YES)
entitlements:=--entitlements $(SRC_ROOT)/lo.xcent
endif
dev-install: build
@rm -rf $(DEVINSTALLDIR)
@mkdir $(DEVINSTALLDIR)
ifeq ($(OS_FOR_BUILD),WNT)
cd $(SRCDIR)/instsetoo_native && $(GNUMAKE) LIBO_DEV_INSTALL=TRUE $(GMAKE_OPTIONS)
else
ifeq ($(DISABLE_LINKOO),TRUE)
@ooinstall $(DEVINSTALLDIR)/opt
ifneq ($(MACOSX_CODESIGNING_IDENTITY),)
#
# Sign dylibs
#
# Executables get signed right after linking, see
# solenv/gbuild/platform/macosx.mk. But many of our dylibs are built
# by ad-hoc or 3rd-party mechanisms, so we can't easily sign them
# right after linking. So do it here.
#
# The dylibs in the Python framework are called *.so. Go figure
#
find $(DEVINSTALLDIR)/opt/LibreOffice.app \( -name '*.dylib' -or -name '*.dylib.*' -or -name '*.so' \) ! -type l | \
while read dylib; do \
id=`basename "$$dylib"`; \
case $$id in \
*.dylib|*.so) \
;; \
*.dylib.*) \
id=`echo $$id | sed -e 's/dylib.*/dylib/'`; \
;; \
esac; \
codesign --verbose --identifier=$(MACOSX_BUNDLE_IDENTIFIER).$$id --sign $(MACOSX_CODESIGNING_IDENTITY) "$$dylib"; \
done
#
# Sign frameworks.
#
# Yeah, we don't bundle any other framework than our Python one, and
# it has just one version, so this generic search is mostly for
# completeness.
#
for framework in `find $(DEVINSTALLDIR)/opt/LibreOffice.app -name '*.framework' -type d`; do \
for version in $$framework/Versions/*; do \
test -d $$version && codesign --force --verbose --prefix=$(MACOSX_BUNDLE_IDENTIFIER). --sign $(MACOSX_CODESIGNING_IDENTITY) $$version; \
done; \
done
#
# Sign the app bundle as a whole (will sign the soffice binary)
#
# The soffice binary will have been signed after linking but it needs
# to be re-signed as it has been renamed, or modified, or something
# after linking.
#
# At this stage we also attach the entitlements in the sandboxing case
#
codesign --force --verbose --sign $(MACOSX_CODESIGNING_IDENTITY) $(entitlements) $(DEVINSTALLDIR)/opt/LibreOffice.app
#
endif
@install-gdb-printers -L
else
@ooinstall -l $(DEVINSTALLDIR)/opt
endif
endif
@rm -f $(SRCDIR)/install && ln -s $(DEVINSTALLDIR)/opt/ $(SRCDIR)/install
@echo
@echo "If you want to edit the .ui files with glade first execute:"
@echo
@echo "export GLADE_CATALOG_SEARCH_PATH=$(SRCDIR)/install/share/glade"
ifeq ($(OS),LINUX)
@echo
@echo "Developer installation finished, you can now execute:"
@echo
@echo "$(SRCDIR)/install/program/soffice"
else ifeq ($(OS),MACOSX)
@echo
@echo "Developer installation finished, you can now run:"
@echo
@echo " open $(SRCDIR)/install/LibreOffice.app"
@echo
@echo "To debug: gdb install/LibreOffice.app/Contents/MacOS/soffice"
endif
dev-install-nocheck : export SKIP_TESTS := YES
dev-install-nocheck : dev-install
dev-update:
ifeq ($(DISABLE_LINKOO),TRUE)
@linkoo --copy $(DEVINSTALLDIR)/opt $(SRCDIR)
else
@linkoo $(DEVINSTALLDIR)/opt $(SRCDIR)
endif
install-tb:
@rm -rf $(DEVINSTALLDIR)
@mkdir $(DEVINSTALLDIR)
ifeq ($(OS_FOR_BUILD),WNT)
cd $(SRCDIR)/instsetoo_native && $(GNUMAKE) LIBO_DEV_INSTALL=TRUE $(GMAKE_OPTIONS)
else
@ooinstall $(DEVINSTALLDIR)/opt
@install-gdb-printers
endif
@rm -f $(SRCDIR)/install && ln -s $(DEVINSTALLDIR)/opt/ $(SRCDIR)/install
distro-pack-install: install
$(SRCDIR)/bin/distro-install-clean-up
$(SRCDIR)/bin/distro-install-desktop-integration
$(SRCDIR)/bin/distro-install-sdk
$(SRCDIR)/bin/distro-install-file-lists
id:
@create-ids
tags:
@create-tags
docs:
@mkdocs.sh $(SRCDIR)/docs $(SOLARENV)/inc/doxygen.cfg
findunusedcode:
@which callcatcher > /dev/null 2>&1 || \
(echo "callcatcher not installed" && false)
@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
@echo unexport ARCH_FLAGS >> $(SRCDIR)/config_host_callcatcher.mk
@echo unexport CFLAGS >> $(SRCDIR)/config_host_callcatcher.mk
@echo unexport CXXFLAGS >> $(SRCDIR)/config_host_callcatcher.mk
@mkdir -p $(SRCDIR)/solenv/callcatcher/bin && \
@$(GNUMAKE) -f $(SOLARENV)/bin/callcatcher.Makefile findunusedcode
@grep ::.*\( unusedcode.all \
| grep -v ^Atom \
| grep -v ^atom:: \
| grep -v ^boost:: \
| grep -v ^CIcc \
| grep -v ^CLuceneError:: \
| grep -v ^cppu:: \
| grep -v ^Dde \
| grep -v ^graphite2:: \
| grep -v ^jvmaccess:: \
| grep -v ^libcdr:: \
| grep -v ^libcmis:: \
| grep -v ^libmspub:: \
| grep -v ^libvisio:: \
| grep -v ^libwpg:: \
| grep -v ^libwps_tools_win:: \
| grep -v ^lucene:: \
| grep -v ^Matrix3d:: \
| grep -v ^RelatedMultipart:: \
| grep -v ^salhelper:: \
| grep -v ^VSDInternalStream:: \
| grep -v ^WP1 \
| grep -v ^WP3 \
| grep -v ^WP42 \
| grep -v ^WP6 \
| grep -v ^WPG \
| grep -v ^WPS \
| grep -v WPX \
| grep -v ^WSObject \
> unusedcode.easy
check: dev-install subsequentcheck
subsequentcheck :| $(if $(filter-out subsequentcheck,$(MAKECMDGOALS)),dev-install)
$(GNUMAKE) -j $(CHECK_PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.build $@
.PHONY : unitcheck slowcheck debugrun translations
unitcheck slowcheck debugrun translations:
$(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS) -f $(SRCDIR)/Makefile.build $@
endif # not clean or distclean
endif # MAKE_RESTARTS
# vim: set noet sw=4 ts=4: