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/.
9 $(eval
$(call gb_CustomTarget_CustomTarget
,ios
/LibreOffice_app
))
11 # We distinguish between builds for the simulator and device by
12 # looking for the "iarmv7" or "i386" in the -arch option that is part
15 ifneq ($(filter arm64
,$(CC
)),)
18 else ifneq ($(filter i386
,$(CC
)),)
19 xcode_sdk
=iphonesimulator
26 # If run from Xcode, check that its configuration (device or
27 # simulator) matches that of gbuild. We detect being run from Xcode by
28 # looking for $(SCRIPT_OUTPUT_FILE_0). The Run Script build phase in
29 # our project has as its (single) output file the location of the app
30 # executable in its app bundle.
32 ifneq ($(SCRIPT_OUTPUT_FILE_0
),)
36 ifneq ($(CURRENT_ARCH
),$(xcode_arch
))
37 $(error Xcode platform
($(CURRENT_ARCH
)) does not match that of this build tree
($(xcode_arch
)))
42 ifneq ($(SCRIPT_OUTPUT_FILE_0
),)
43 ifeq ($(EXECUTABLE_NAME
),LibreOffice
)
44 # When run from Xcode, we move the LibreOffice executable from solver into
45 # the LibreOffice.app directory that Xcode uses. We also set up/copy all
46 # the run-time configuration etc files that the app needs.
47 $(call gb_CustomTarget_get_target
,ios
/LibreOffice_app
) : $(SCRIPT_OUTPUT_FILE_0
)
49 appdir
=$(dir $(SCRIPT_OUTPUT_FILE_0
))
50 buildid
=$(shell cd
$(SRCDIR
) && git log
-1 --format
=%H
)
52 $(SCRIPT_OUTPUT_FILE_0
) : $(call gb_Executable_get_target
,LibreOffice
)
53 $(call gb_Output_announce
,$(subst $(WORKDIR
)/,,$@
),$(true
),APP
,2)
54 mkdir
-p
$(appdir
)/ure
55 mv
$(call gb_Executable_get_target
,LibreOffice
) $(SCRIPT_OUTPUT_FILE_0
)
59 cp
$(INSTDIR
)/ure
/share
/misc
/types.rdb
$(appdir
)
60 cp
$(INSTDIR
)/program
/types
/offapi.rdb
$(appdir
)
61 cp
$(INSTDIR
)/program
/types
/oovbaapi.rdb
$(appdir
)
62 cp
$(INSTDIR
)/program
/services
/services.rdb
$(appdir
)
63 cp
$(INSTDIR
)/ure
/share
/misc
/services.rdb
$(appdir
)/ure
67 # program/resource is hardcoded in tools/source/rc/resmgr.cxx. Sure,
68 # we could set STAR_RESOURCE_PATH instead. sigh...
70 mkdir
-p
$(appdir
)/program
/resource
71 cp
$(INSTDIR
)/$(LIBO_SHARE_RESOURCE_FOLDER
)/*en-US.res
$(appdir
)/program
/resource
75 mkdir
-p
$(appdir
)/share
/config
76 cp
-R
$(INSTDIR
)/$(LIBO_SHARE_FOLDER
)/config
/images_tango.zip
$(appdir
)/share
/config
/images.zip
80 cp
-R
$(INSTROOT
)/share
/config
/soffice.cfg
$(appdir
)/share
/config
84 cp
-R
$(INSTROOT
)/$(LIBO_SHARE_FOLDER
)/registry
$(appdir
)/share
86 # Set up rc, the "inifile". See getIniFileName_Impl().
89 echo
'[Bootstrap]' && \
90 echo
'URE_BOOTSTRAP=file://$$APP_DATA_DIR/fundamentalrc' && \
91 echo
'HOME=$$APP_DATA_DIR/tmp' && \
94 # Set up fundamentalrc, unorc, bootstraprc and versionrc.
96 # Do we really need all these?
99 echo
'[Bootstrap]' && \
100 echo
'BRAND_BASE_DIR=file://$$APP_DATA_DIR' && \
101 echo
'CONFIGURATION_LAYERS=xcsxcu:$${BRAND_BASE_DIR}/share/registry res:$${BRAND_BASE_DIR}/share/registry' && \
102 : ) > $(appdir
)/fundamentalrc
105 echo
'[Bootstrap]' && \
106 : UNO_TYPES and UNO_SERVICES are set up in lo-viewer.mm
, is that sane?
&& \
107 : ) > $(appdir
)/unorc
109 # bootstraprc must be in $BRAND_BASE_DIR/program
111 mkdir
-p
$(appdir
)/program
113 echo
'[Bootstrap]' && \
114 echo
'InstallMode=<installmode>' && \
115 echo
'ProductKey=LibreOffice $(PRODUCTVERSION)' && \
116 echo
'UserInstallation=file://$$APP_DATA_DIR/../Library/Application%20Support' && \
117 : ) > $(appdir
)/program
/bootstraprc
119 # Is this really needed?
122 echo
'[Version]' && \
123 echo
'AllLanguages=en-US' && \
124 echo
'BuildVersion=' && \
125 echo
'buildid=$(buildid)' && \
126 : ) > $(appdir
)/program
/versionrc
128 # Copy a sample document... good old test1.odt...
130 cp
$(SRC_ROOT
)/odk
/examples
/java
/DocumentHandling
/test/test1.odt
$(appdir
)
133 # When run just from the command line, we don't have any app bundle to
134 # copy or move the executable to. So do nothing. Except one trick:
135 # Copy the Xcode project to BUILDDIR if SRCDIR!=BUILDDIR, so that one
136 # can then open it from there in Xcode.
137 $(call gb_CustomTarget_get_target
,ios
/LibreOffice_app
) : $(gb_Helper_PHONY
)
138 if
test $(SRCDIR
) != $(BUILDDIR
); then \
139 (cd
$(SRCDIR
) && tar cf
- ios
/experimental
/LibreOffice
/LibreOffice.xcodeproj
/project.pbxproj
) |
(cd
$(BUILDDIR
) && tar xf
-); \
142 $(call gb_CustomTarget_get_clean_target
,ios
/LibreOffice_app
) :
143 $(call gb_Output_announce
,$(subst $(WORKDIR
)/Clean
/,,$@
),$(false
),APP
,2)
144 # Here we just assume that Xcode's settings are default, or something
145 rm -rf experimental
/LibreOffice
/build
149 # vim: set noet sw=4 ts=4: