2013-01-03 05:29:08 -06:00
|
|
|
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
|
|
|
|
#
|
|
|
|
# This file is part of the LibreOffice project.
|
|
|
|
#
|
|
|
|
# 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/.
|
|
|
|
|
2013-03-28 16:16:12 -05:00
|
|
|
$(eval $(call gb_CustomTarget_CustomTarget,ios/LibreOffice_app))
|
2013-01-03 05:29:08 -06:00
|
|
|
|
|
|
|
# We distinguish between builds for the simulator and device by
|
|
|
|
# looking for the "iarmv7" or "i386" in the -arch option that is part
|
|
|
|
# of $(CC)
|
|
|
|
|
2013-11-05 16:29:11 -06:00
|
|
|
ifneq ($(filter arm64,$(CC)),)
|
|
|
|
xcode_sdk=iphoneos
|
|
|
|
xcode_arch=arm64
|
|
|
|
else ifneq ($(filter i386,$(CC)),)
|
2013-01-03 05:29:08 -06:00
|
|
|
xcode_sdk=iphonesimulator
|
|
|
|
xcode_arch=i386
|
|
|
|
else
|
|
|
|
xcode_sdk=iphoneos
|
|
|
|
xcode_arch=armv7
|
|
|
|
endif
|
|
|
|
|
|
|
|
# If run from Xcode, check that its configuration (device or
|
|
|
|
# simulator) matches that of gbuild. We detect being run from Xcode by
|
2013-01-04 09:41:37 -06:00
|
|
|
# looking for $(SCRIPT_OUTPUT_FILE_0). The Run Script build phase in
|
|
|
|
# our project has as its (single) output file the location of the app
|
|
|
|
# executable in its app bundle.
|
2013-01-03 05:29:08 -06:00
|
|
|
|
2013-01-04 09:41:37 -06:00
|
|
|
ifneq ($(SCRIPT_OUTPUT_FILE_0),)
|
2013-01-03 05:29:08 -06:00
|
|
|
|
|
|
|
export CCACHE_CPP2=y
|
|
|
|
|
|
|
|
ifneq ($(CURRENT_ARCH),$(xcode_arch))
|
2013-03-28 16:16:12 -05:00
|
|
|
$(error Xcode platform ($(CURRENT_ARCH)) does not match that of this build tree ($(xcode_arch)))
|
2013-01-03 05:29:08 -06:00
|
|
|
endif
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
2013-01-04 09:41:37 -06:00
|
|
|
ifneq ($(SCRIPT_OUTPUT_FILE_0),)
|
2013-03-28 16:16:12 -05:00
|
|
|
ifeq ($(EXECUTABLE_NAME),LibreOffice)
|
|
|
|
# When run from Xcode, we move the LibreOffice executable from solver into
|
|
|
|
# the LibreOffice.app directory that Xcode uses. We also set up/copy all
|
2013-01-05 15:13:49 -06:00
|
|
|
# the run-time configuration etc files that the app needs.
|
2013-03-28 16:16:12 -05:00
|
|
|
$(call gb_CustomTarget_get_target,ios/LibreOffice_app) : $(SCRIPT_OUTPUT_FILE_0)
|
2013-01-03 05:29:08 -06:00
|
|
|
|
2013-01-05 15:13:49 -06:00
|
|
|
appdir=$(dir $(SCRIPT_OUTPUT_FILE_0))
|
2013-09-12 03:24:44 -05:00
|
|
|
buildid=$(shell cd $(SRCDIR) && git log -1 --format=%H)
|
2013-01-05 15:13:49 -06:00
|
|
|
|
2013-03-28 16:16:12 -05:00
|
|
|
$(SCRIPT_OUTPUT_FILE_0) : $(call gb_Executable_get_target,LibreOffice)
|
2013-03-01 02:55:34 -06:00
|
|
|
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),APP,2)
|
2013-01-05 15:13:49 -06:00
|
|
|
mkdir -p $(appdir)/ure
|
2013-03-28 16:16:12 -05:00
|
|
|
mv $(call gb_Executable_get_target,LibreOffice) $(SCRIPT_OUTPUT_FILE_0)
|
2013-01-05 15:13:49 -06:00
|
|
|
#
|
|
|
|
# Copy rdb files
|
|
|
|
#
|
2013-10-31 06:41:13 -05:00
|
|
|
cp $(INSTDIR)/ure/share/misc/types.rdb $(appdir)
|
|
|
|
cp $(INSTDIR)/program/types/offapi.rdb $(appdir)
|
|
|
|
cp $(INSTDIR)/program/types/oovbaapi.rdb $(appdir)
|
2013-09-12 06:21:39 -05:00
|
|
|
cp $(INSTDIR)/program/services/services.rdb $(appdir)
|
|
|
|
cp $(INSTDIR)/ure/share/misc/services.rdb $(appdir)/ure
|
2013-01-05 15:13:49 -06:00
|
|
|
#
|
|
|
|
# Copy .res files
|
|
|
|
#
|
|
|
|
# program/resource is hardcoded in tools/source/rc/resmgr.cxx. Sure,
|
|
|
|
# we could set STAR_RESOURCE_PATH instead. sigh...
|
|
|
|
#
|
|
|
|
mkdir -p $(appdir)/program/resource
|
2013-09-12 06:21:39 -05:00
|
|
|
cp $(INSTDIR)/$(LIBO_SHARE_RESOURCE_FOLDER)/*en-US.res $(appdir)/program/resource
|
2013-01-05 15:13:49 -06:00
|
|
|
#
|
2013-03-23 06:32:24 -05:00
|
|
|
# Artwork
|
|
|
|
#
|
|
|
|
mkdir -p $(appdir)/share/config
|
2013-09-12 06:21:39 -05:00
|
|
|
cp -R $(INSTDIR)/$(LIBO_SHARE_FOLDER)/config/images_tango.zip $(appdir)/share/config/images.zip
|
2013-03-23 06:32:24 -05:00
|
|
|
#
|
2013-03-25 10:37:04 -05:00
|
|
|
# soffice.cfg
|
|
|
|
#
|
2013-09-22 11:59:37 -05:00
|
|
|
cp -R $(INSTROOT)/share/config/soffice.cfg $(appdir)/share/config
|
2013-03-25 10:37:04 -05:00
|
|
|
#
|
|
|
|
# "registry"
|
|
|
|
#
|
2013-09-27 03:58:28 -05:00
|
|
|
cp -R $(INSTROOT)/$(LIBO_SHARE_FOLDER)/registry $(appdir)/share
|
2013-03-25 10:37:04 -05:00
|
|
|
#
|
2013-03-28 16:16:12 -05:00
|
|
|
# Set up rc, the "inifile". See getIniFileName_Impl().
|
2013-01-05 15:13:49 -06:00
|
|
|
#
|
|
|
|
( \
|
|
|
|
echo '[Bootstrap]' && \
|
|
|
|
echo 'URE_BOOTSTRAP=file://$$APP_DATA_DIR/fundamentalrc' && \
|
|
|
|
echo 'HOME=$$APP_DATA_DIR/tmp' && \
|
|
|
|
: ) > $(appdir)/rc
|
|
|
|
#
|
|
|
|
# Set up fundamentalrc, unorc, bootstraprc and versionrc.
|
|
|
|
#
|
|
|
|
# Do we really need all these?
|
|
|
|
#
|
|
|
|
( \
|
|
|
|
echo '[Bootstrap]' && \
|
|
|
|
echo 'BRAND_BASE_DIR=file://$$APP_DATA_DIR' && \
|
2013-10-08 09:19:41 -05:00
|
|
|
echo 'CONFIGURATION_LAYERS=xcsxcu:$${BRAND_BASE_DIR}/share/registry res:$${BRAND_BASE_DIR}/share/registry' && \
|
2013-01-05 15:13:49 -06:00
|
|
|
: ) > $(appdir)/fundamentalrc
|
|
|
|
#
|
|
|
|
( \
|
|
|
|
echo '[Bootstrap]' && \
|
|
|
|
: UNO_TYPES and UNO_SERVICES are set up in lo-viewer.mm, is that sane? && \
|
|
|
|
: ) > $(appdir)/unorc
|
|
|
|
#
|
|
|
|
# bootstraprc must be in $BRAND_BASE_DIR/program
|
|
|
|
#
|
|
|
|
mkdir -p $(appdir)/program
|
|
|
|
( \
|
|
|
|
echo '[Bootstrap]' && \
|
|
|
|
echo 'InstallMode=<installmode>' && \
|
2013-03-28 16:16:12 -05:00
|
|
|
echo 'ProductKey=LibreOffice $(PRODUCTVERSION)' && \
|
2013-03-20 02:07:52 -05:00
|
|
|
echo 'UserInstallation=file://$$APP_DATA_DIR/../Library/Application%20Support' && \
|
2013-01-05 15:13:49 -06:00
|
|
|
: ) > $(appdir)/program/bootstraprc
|
|
|
|
#
|
|
|
|
# Is this really needed?
|
|
|
|
#
|
|
|
|
( \
|
|
|
|
echo '[Version]' && \
|
|
|
|
echo 'AllLanguages=en-US' && \
|
|
|
|
echo 'BuildVersion=' && \
|
|
|
|
echo 'buildid=$(buildid)' && \
|
|
|
|
echo 'ProductMajor=360' && \
|
|
|
|
echo 'ProductMinor=1' && \
|
|
|
|
: ) > $(appdir)/program/versionrc
|
2013-01-06 16:42:06 -06:00
|
|
|
#
|
|
|
|
# Copy a sample document... good old test1.odt...
|
|
|
|
#
|
|
|
|
cp $(SRC_ROOT)/odk/examples/java/DocumentHandling/test/test1.odt $(appdir)
|
2013-03-15 15:55:33 -05:00
|
|
|
endif
|
2013-01-04 09:41:37 -06:00
|
|
|
else
|
|
|
|
# When run just from the command line, we don't have any app bundle to
|
2013-03-15 15:55:33 -05:00
|
|
|
# copy or move the executable to. So do nothing. Except one trick:
|
|
|
|
# Copy the Xcode project to BUILDDIR if SRCDIR!=BUILDDIR, so that one
|
|
|
|
# can then open it from there in Xcode.
|
2013-03-28 16:16:12 -05:00
|
|
|
$(call gb_CustomTarget_get_target,ios/LibreOffice_app) : $(gb_Helper_PHONY)
|
2013-03-15 15:55:33 -05:00
|
|
|
if test $(SRCDIR) != $(BUILDDIR); then \
|
2013-03-28 16:16:12 -05:00
|
|
|
(cd $(SRCDIR) && tar cf - ios/experimental/LibreOffice/LibreOffice.xcodeproj/project.pbxproj) | (cd $(BUILDDIR) && tar xf -); \
|
2013-03-15 15:55:33 -05:00
|
|
|
fi
|
2013-01-03 05:29:08 -06:00
|
|
|
|
2013-03-28 16:16:12 -05:00
|
|
|
$(call gb_CustomTarget_get_clean_target,ios/LibreOffice_app) :
|
2013-03-01 02:55:34 -06:00
|
|
|
$(call gb_Output_announce,$(subst $(WORKDIR)/Clean/,,$@),$(false),APP,2)
|
2013-01-04 09:41:37 -06:00
|
|
|
# Here we just assume that Xcode's settings are default, or something
|
2013-03-28 16:16:12 -05:00
|
|
|
rm -rf experimental/LibreOffice/build
|
2013-01-03 05:29:08 -06:00
|
|
|
|
2013-01-04 09:41:37 -06:00
|
|
|
endif
|
2013-01-03 05:29:08 -06:00
|
|
|
|
|
|
|
# vim: set noet sw=4 ts=4:
|