Files
odfstudio/ios/CustomTarget_Viewer_app.mk
T
Tor Lillqvist 13eca8620a More hacking on an iOS "Viewer" app that doesn't do much anything yet
The Viewer app is intended to eventually resemble the experimental
Android DocumentLoader app.

Build using the gbuild mechanism, which is also invoked from an Xcode
project. This seems to work out fine, the resulting app installs at
least on the simulator, and you can debug all the LO code involved
even if Xcode (obviously) has no knowledge of the LO source
files/classes/etc.

Change-Id: Ic96178d80b8d6467cac969b29e37f0d39513acf9
2013-01-03 20:21:51 +02:00

60 lines
1.6 KiB
Makefile

# -*- 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/.
$(eval $(call gb_CustomTarget_CustomTarget,ios/Viewer_app))
# 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)
ifneq ($(filter i386,$(CC)),)
xcode_sdk=iphonesimulator
xcode_arch=i386
else
xcode_sdk=iphoneos
xcode_arch=armv7
endif
ifeq ($(debug),)
xcode_config := Release
else
xcode_config := Debug
endif
# If run from Xcode, check that its configuration (device or
# simulator) matches that of gbuild. We detect being run from Xcode by
# looking for $(XCODE_VERSION_ACTUAL)
ifneq ($(XCODE_VERSION_ACTUAL),)
export CCACHE_CPP2=y
ifneq ($(CURRENT_ARCH),$(xcode_arch))
$(error Xcode platform (device or simulator) does not match that of this build tree)
endif
ifneq ($(CONFIGURATION),$(xcode_config))
$(error Xcode configuration (release or debug) does not match that of this build tree)
endif
endif
APP := Viewer
ios_Viewer_app_DIR := $(SRC_ROOT)/ios/experimental/Viewer/DerivedData/$(APP)/Build/Products/$(xcode_config)-$(xcode_sdk)/$(APP).app
ios_Viewer_app_EXE := $(ios_Viewer_app_DIR)/Viewer
$(call gb_CustomTarget_get_target,ios/Viewer_app) : $(ios_Viewer_app_EXE)
$(ios_Viewer_app_EXE): $(call gb_Executable_get_target,Viewer)
mkdir -p $(ios_Viewer_app_DIR)
cp $(call gb_Executable_get_target,Viewer) $(ios_Viewer_app_DIR)
# vim: set noet sw=4 ts=4: