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 i386
,$(CC
)),)
16 xcode_sdk
=iphonesimulator
23 # If run from Xcode, check that its configuration (device or
24 # simulator) matches that of gbuild. We detect being run from Xcode by
25 # looking for $(SCRIPT_OUTPUT_FILE_0). The Run Script build phase in
26 # our project has as its (single) output file the location of the app
27 # executable in its app bundle.
29 ifneq ($(SCRIPT_OUTPUT_FILE_0
),)
33 ifneq ($(CURRENT_ARCH
),$(xcode_arch
))
34 $(error Xcode platform
($(CURRENT_ARCH
)) does not match that of this build tree
($(xcode_arch
)))
39 ifneq ($(SCRIPT_OUTPUT_FILE_0
),)
40 ifeq ($(EXECUTABLE_NAME
),LibreOffice
)
41 # When run from Xcode, we move the LibreOffice executable from solver into
42 # the LibreOffice.app directory that Xcode uses. We also set up/copy all
43 # the run-time configuration etc files that the app needs.
44 $(call gb_CustomTarget_get_target
,ios
/LibreOffice_app
) : $(SCRIPT_OUTPUT_FILE_0
)
46 appdir
=$(dir $(SCRIPT_OUTPUT_FILE_0
))
47 buildid
=$(shell git log
-1 --format
=%H
)
49 $(SCRIPT_OUTPUT_FILE_0
) : $(call gb_Executable_get_target
,LibreOffice
)
50 $(call gb_Output_announce
,$(subst $(WORKDIR
)/,,$@
),$(true
),APP
,2)
51 mkdir
-p
$(appdir
)/ure
52 mv
$(call gb_Executable_get_target
,LibreOffice
) $(SCRIPT_OUTPUT_FILE_0
)
56 cp
$(OUTDIR
)/bin
/offapi.rdb
$(appdir
)
57 cp
$(OUTDIR
)/bin
/udkapi.rdb
$(appdir
)
58 cp
$(OUTDIR
)/bin
/oovbaapi.rdb
$(appdir
)
59 cp
$(OUTDIR
)/xml
/services.rdb
$(appdir
)
60 cp
$(OUTDIR
)/xml
/ure
/services.rdb
$(appdir
)/ure
62 # Copy "registry" files
64 mkdir
-p
$(appdir
)/registry
/modules
$(appdir
)/registry
/res
65 cp
$(OUTDIR
)/xml
/*.xcd
$(appdir
)/registry
66 mv
$(appdir
)/registry
/fcfg_langpack_en-US.xcd
$(appdir
)/registry
/res
67 cp
-R
$(OUTDIR
)/xml
/registry
/* $(appdir
)/registry
71 # program/resource is hardcoded in tools/source/rc/resmgr.cxx. Sure,
72 # we could set STAR_RESOURCE_PATH instead. sigh...
74 mkdir
-p
$(appdir
)/program
/resource
75 cp
$(OUTDIR
)/bin
/*en-US.res
$(appdir
)/program
/resource
79 mkdir
-p
$(appdir
)/share
/config
80 cp
-R
$(OUTDIR
)/bin
/images_tango.zip
$(appdir
)/share
/config
/images.zip
84 cp
-R
$(INSTDIR
)/share
/config
/soffice.cfg
$(appdir
)/share
/config
88 mkdir
-p
$(appdir
)/share
/registry
/res
89 cp
$(OUTDIR
)/xml
/*.xcd
$(appdir
)/share
/registry
90 mv
$(appdir
)/share
/registry
/fcfg_langpack_en-US.xcd
$(appdir
)/share
/registry
/res
91 cp
-R
$(OUTDIR
)/xml
/registry
/* $(appdir
)/share
/registry
93 # Set up rc, the "inifile". See getIniFileName_Impl().
96 echo
'[Bootstrap]' && \
97 echo
'URE_BOOTSTRAP=file://$$APP_DATA_DIR/fundamentalrc' && \
98 echo
'HOME=$$APP_DATA_DIR/tmp' && \
101 # Set up fundamentalrc, unorc, bootstraprc and versionrc.
103 # Do we really need all these?
106 echo
'[Bootstrap]' && \
107 echo
'BRAND_BASE_DIR=file://$$APP_DATA_DIR' && \
108 echo
'CONFIGURATION_LAYERS=xcsxcu:$${BRAND_BASE_DIR}/registry module:$${BRAND_BASE_DIR}/registry/modules res:$${BRAND_BASE_DIR}/registry' && \
109 : ) > $(appdir
)/fundamentalrc
112 echo
'[Bootstrap]' && \
113 : UNO_TYPES and UNO_SERVICES are set up in lo-viewer.mm
, is that sane?
&& \
114 : ) > $(appdir
)/unorc
116 # bootstraprc must be in $BRAND_BASE_DIR/program
118 mkdir
-p
$(appdir
)/program
120 echo
'[Bootstrap]' && \
121 echo
'InstallMode=<installmode>' && \
122 echo
'ProductKey=LibreOffice $(PRODUCTVERSION)' && \
123 echo
'UserInstallation=file://$$APP_DATA_DIR/../Library/Application%20Support' && \
124 : ) > $(appdir
)/program
/bootstraprc
126 # Is this really needed?
129 echo
'[Version]' && \
130 echo
'AllLanguages=en-US' && \
131 echo
'BuildVersion=' && \
132 echo
'buildid=$(buildid)' && \
133 echo
'ProductMajor=360' && \
134 echo
'ProductMinor=1' && \
135 : ) > $(appdir
)/program
/versionrc
137 # Copy a sample document... good old test1.odt...
139 cp
$(SRC_ROOT
)/odk
/examples
/java
/DocumentHandling
/test/test1.odt
$(appdir
)
142 # When run just from the command line, we don't have any app bundle to
143 # copy or move the executable to. So do nothing. Except one trick:
144 # Copy the Xcode project to BUILDDIR if SRCDIR!=BUILDDIR, so that one
145 # can then open it from there in Xcode.
146 $(call gb_CustomTarget_get_target
,ios
/LibreOffice_app
) : $(gb_Helper_PHONY
)
147 if
test $(SRCDIR
) != $(BUILDDIR
); then \
148 (cd
$(SRCDIR
) && tar cf
- ios
/experimental
/LibreOffice
/LibreOffice.xcodeproj
/project.pbxproj
) |
(cd
$(BUILDDIR
) && tar xf
-); \
151 $(call gb_CustomTarget_get_clean_target
,ios
/LibreOffice_app
) :
152 $(call gb_Output_announce
,$(subst $(WORKDIR
)/Clean
/,,$@
),$(false
),APP
,2)
153 # Here we just assume that Xcode's settings are default, or something
154 rm -rf experimental
/LibreOffice
/build
158 # vim: set noet sw=4 ts=4: