[Libreoffice-commits] core.git: ios/CustomTarget_iOS.mk ios/CustomTarget_LibreOfficeLight_app.mk ios/CustomTarget_setup.mk ios/Module_ios.mk

jan Iversen jani at libreoffice.org
Thu Sep 28 10:50:43 UTC 2017


 ios/CustomTarget_LibreOfficeLight_app.mk |   30 ------
 ios/CustomTarget_iOS.mk                  |  150 +++++++++++++++++++------------
 ios/Module_ios.mk                        |    2 
 3 files changed, 97 insertions(+), 85 deletions(-)

New commits:
commit e67f6acc303dc09c6f35ea6374a721266dedaabd
Author: jan Iversen <jani at libreoffice.org>
Date:   Thu Sep 28 11:56:42 2017 +0200

    iOS, WIP setup to build static lib and app.
    
    Cleaned up custom targets.
    
    Change-Id: I11ef1cb6d129722ac206b298c6ad15c00da5c433

diff --git a/ios/CustomTarget_LibreOfficeLight_app.mk b/ios/CustomTarget_LibreOfficeLight_app.mk
deleted file mode 100644
index ed61f279e2cf..000000000000
--- a/ios/CustomTarget_LibreOfficeLight_app.mk
+++ /dev/null
@@ -1,30 +0,0 @@
-# -*- 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/.
-
-#- Env ------------------------------------------------------------------------
-BUILDID			:=$(shell cd $(SRCDIR) && git log -1 --format=%H)
-
-#- Targets --------------------------------------------------------------------
-
-.PHONY: LibreOfficeLight_setup
-
-# Register target
-$(eval $(call gb_CustomTarget_CustomTarget,ios/LibreOfficeLight))
-
-# Build
-# Depend on the custom target that sets up lo.xcconfig
-$(call gb_CustomTarget_get_target,ios/LibreOfficeLight): $(call gb_CustomTarget_get_target,ios/Lo_Xcconfig)
-	$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),APP,2)
-	$(call IOSbuild,LibreOfficeLight, clean build)
-
-# Clean
-$(call gb_CustomTarget_get_clean_target,ios/LibreOfficeLight):
-	$(call gb_Output_announce,$(subst $(WORKDIR)/Clean/,,$@),$(false),APP,2)
-	$(call IOSbuild,LibreOfficeLight, clean)
-
-# vim: set noet sw=4 ts=4:
diff --git a/ios/CustomTarget_setup.mk b/ios/CustomTarget_iOS.mk
similarity index 58%
rename from ios/CustomTarget_setup.mk
rename to ios/CustomTarget_iOS.mk
index f526f23edab0..ff05a7b9bebc 100644
--- a/ios/CustomTarget_setup.mk
+++ b/ios/CustomTarget_iOS.mk
@@ -7,71 +7,80 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #- Env ------------------------------------------------------------------------
 IOSGEN := $(SRCDIR)/ios/generated
-IOSKIT := $(BUILDDIR)/ios/loKit.xcconfig
-IOSAPP := $(BUILDDIR)/ios/loApp.xcconfig
 IOSRES := $(IOSGEN)/resources
+IOSKITXC := $(BUILDDIR)/ios/loKit.xcconfig
+IOSAPPXC := $(BUILDDIR)/ios/loApp.xcconfig
+IOSKITPRJ := $(SRCDIR)/ios/LibreOfficeKit/LibreOfficeKit.xcodeproj/project.pbxproj
+IOSAPPPRJ := $(SRCDIR)/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
+IOSAPP := $(INSTDIR)/LibreOfficeLight.app
+ifeq ($(ENABLE_DEBUG),TRUE)
+IOSKIT := $(IOSGEN)/iOSkit_$(CPUNAME)_debug.a
+else
+IOSKIT := $(IOSGEN)/iOSkit_$(CPUNAME).a
+endif
 
 
 #- Top level  -----------------------------------------------------------------
-$(eval $(call gb_CustomTarget_CustomTarget,ios/setup))
+$(eval $(call gb_CustomTarget_CustomTarget,ios/ios))
 
-$(call gb_CustomTarget_get_target,ios/setup): $(IOSKIT) $(IOSAPP) iosCopySetup
+$(call gb_CustomTarget_get_target,ios/ios): $(IOSKIT)
 
 
 #- Generate xcconfig files  ---------------------------------------------------
-$(IOSKIT) : $(BUILDDIR)/config_host.mk
+$(IOSKITXC) : $(BUILDDIR)/config_host.mk
 	$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ENV,2)
-	@echo "// Xcode configuration properties" > $(IOSKIT)
-	@echo "// To avoid confusion, the LO-specific ones that aren't as such used" >> $(IOSKIT)
-	@echo "// Xcode (but only expanded in option values) are prefixed with" >> $(IOSKIT)
-	@echo "// LO_.\n" >> $(IOSKIT)
-	@echo "LO_BUILDDIR = $(BUILDDIR)" >> $(IOSKIT)
-	@echo "LO_INSTDIR = $(INSTDIR)" >> $(IOSKIT)
-	@echo "LO_SRCDIR = $(SRC_ROOT)" >> $(IOSKIT)
-	@echo "LO_WORKDIR = $(WORKDIR)" >> $(IOSKIT)
-	@echo "\n// These are actual Xcode-known settings. The corresponding autoconf" >> $(IOSKIT)
-	@echo "// variables are prefixed with XCODE_ to make it clear in configure.ac" >> $(IOSKIT)
-	@echo "// what they will be used for." >> $(IOSKIT)
-	@echo "ARCHS = $(XCODE_ARCHS)" >> $(IOSKIT)
-	@echo "VALID_ARCHS = $(XCODE_ARCHS)" >> $(IOSKIT)
-	@echo "CLANG_CXX_LIBRARY = $(XCODE_CLANG_CXX_LIBRARY)" >> $(IOSKIT)
-	@echo "DEBUG_INFORMATION_FORMAT=$(XCODE_DEBUG_INFORMATION_FORMAT)" >> $(IOSKIT)
-	@echo "\n// These settings are edited in CustomTarget_Lo_Xcconfig.mk." >> $(IOSKIT)
-
-	@echo "OTHER_CFLAGS = $(gb_GLOBALDEFS)" >> $(IOSKIT)
-	@echo "OTHER_CPLUSPLUSFLAGS = $(gb_GLOBALDEFS)" >> $(IOSKIT)
+	@echo "// Xcode configuration properties" > $(IOSKITXC)
+	@echo "// To avoid confusion, the LO-specific ones that aren't as such used" >> $(IOSKITXC)
+	@echo "// Xcode (but only expanded in option values) are prefixed with" >> $(IOSKITXC)
+	@echo "// LO_.\n" >> $(IOSKITXC)
+	@echo "LO_BUILDDIR = $(BUILDDIR)" >> $(IOSKITXC)
+	@echo "LO_INSTDIR = $(INSTDIR)" >> $(IOSKITXC)
+	@echo "LO_SRCDIR = $(SRC_ROOT)" >> $(IOSKITXC)
+	@echo "LO_WORKDIR = $(WORKDIR)" >> $(IOSKITXC)
+	@echo "\n// These are actual Xcode-known settings. The corresponding autoconf" >> $(IOSKITXC)
+	@echo "// variables are prefixed with XCODE_ to make it clear in configure.ac" >> $(IOSKITXC)
+	@echo "// what they will be used for." >> $(IOSKITXC)
+	@echo "ARCHS = $(XCODE_ARCHS)" >> $(IOSKITXC)
+	@echo "VALID_ARCHS = $(XCODE_ARCHS)" >> $(IOSKITXC)
+	@echo "CLANG_CXX_LIBRARY = $(XCODE_CLANG_CXX_LIBRARY)" >> $(IOSKITXC)
+	@echo "DEBUG_INFORMATION_FORMAT=$(XCODE_DEBUG_INFORMATION_FORMAT)" >> $(IOSKITXC)
+	@echo "\n// These settings are edited in CustomTarget_Lo_Xcconfig.mk." >> $(IOSKITXC)
+
+	@echo "OTHER_CFLAGS = $(gb_GLOBALDEFS)" >> $(IOSKITXC)
+	@echo "OTHER_CPLUSPLUSFLAGS = $(gb_GLOBALDEFS)" >> $(IOSKITXC)
 	@echo "LINK_LDFLAGS = -Wl,-lz,-liconv,-map,$(WORKDIR)/iosKit.map " \
-              "`$(SRCDIR)/bin/lo-all-static-libs`" >> $(IOSKIT)
-	@echo "SYMROOT = $(WORKDIR)/ios/build\n" >> $(IOSKIT)
+              "`$(SRCDIR)/bin/lo-all-static-libs`" >> $(IOSKITXC)
+	@echo "SYMROOT = $(WORKDIR)/ios/build\n" >> $(IOSKITXC)
 
-$(IOSAPP) : $(BUILDDIR)/config_host.mk
+$(IOSAPPXC) : $(BUILDDIR)/config_host.mk
 	$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ENV,2)
 	@mkdir -p $(IOSGEN);
-	@echo "// Xcode configuration properties" > $(IOSAPP)
-	@echo "// To avoid confusion, the LO-specific ones that aren't as such used" >> $(IOSAPP)
-	@echo "// Xcode (but only expanded in option values) are prefixed with" >> $(IOSAPP)
-	@echo "// LO_.\n" >> $(IOSAPP)
-	@echo "LO_BUILDDIR = $(BUILDDIR)" >> $(IOSAPP)
-	@echo "LO_INSTDIR = $(INSTDIR)" >> $(IOSAPP)
-	@echo "LO_SRCDIR = $(SRC_ROOT)" >> $(IOSAPP)
-	@echo "LO_WORKDIR = $(WORKDIR)" >> $(IOSAPP)
-	@echo "\n// These are actual Xcode-known settings. The corresponding autoconf" >> $(IOSAPP)
-	@echo "// variables are prefixed with XCODE_ to make it clear in configure.ac" >> $(IOSAPP)
-	@echo "// what they will be used for." >> $(IOSAPP)
-	@echo "ARCHS = $(XCODE_ARCHS)" >> $(IOSAPP)
-	@echo "VALID_ARCHS = $(XCODE_ARCHS)" >> $(IOSAPP)
-	@echo "CLANG_CXX_LIBRARY = $(XCODE_CLANG_CXX_LIBRARY)" >> $(IOSAPP)
-	@echo "DEBUG_INFORMATION_FORMAT=$(XCODE_DEBUG_INFORMATION_FORMAT)" >> $(IOSAPP)
-	@echo "\n// These settings are edited in CustomTarget_Lo_Xcconfig.mk." >> $(IOSAPP)
-
-	@echo "OTHER_CFLAGS = $(gb_GLOBALDEFS)" >> $(IOSAPP)
-	@echo "OTHER_CPLUSPLUSFLAGS = $(gb_GLOBALDEFS)" >> $(IOSAPP)
-	@echo "LINK_LDFLAGS = -Wl,-lz,-liconv,-map,$(WORKDIR)/iosApp.map " >> $(IOSAPP)
-	@echo "SYMROOT = $(WORKDIR)/ios/build\n" >> $(IOSAPP)
-
-#- Generate setup  ------------------------------------------------------------
+	@echo "// Xcode configuration properties" > $(IOSAPPXC)
+	@echo "// To avoid confusion, the LO-specific ones that aren't as such used" >> $(IOSAPPXC)
+	@echo "// Xcode (but only expanded in option values) are prefixed with" >> $(IOSAPPXC)
+	@echo "// LO_.\n" >> $(IOSAPPXC)
+	@echo "LO_BUILDDIR = $(BUILDDIR)" >> $(IOSAPPXC)
+	@echo "LO_INSTDIR = $(INSTDIR)" >> $(IOSAPPXC)
+	@echo "LO_SRCDIR = $(SRC_ROOT)" >> $(IOSAPPXC)
+	@echo "LO_WORKDIR = $(WORKDIR)" >> $(IOSAPPXC)
+	@echo "\n// These are actual Xcode-known settings. The corresponding autoconf" >> $(IOSAPPXC)
+	@echo "// variables are prefixed with XCODE_ to make it clear in configure.ac" >> $(IOSAPPXC)
+	@echo "// what they will be used for." >> $(IOSAPPXC)
+	@echo "ARCHS = $(XCODE_ARCHS)" >> $(IOSAPPXC)
+	@echo "VALID_ARCHS = $(XCODE_ARCHS)" >> $(IOSAPPXC)
+	@echo "CLANG_CXX_LIBRARY = $(XCODE_CLANG_CXX_LIBRARY)" >> $(IOSAPPXC)
+	@echo "DEBUG_INFORMATION_FORMAT=$(XCODE_DEBUG_INFORMATION_FORMAT)" >> $(IOSAPPXC)
+	@echo "\n// These settings are edited in CustomTarget_Lo_Xcconfig.mk." >> $(IOSAPPXC)
+
+	@echo "OTHER_CFLAGS = $(gb_GLOBALDEFS)" >> $(IOSAPPXC)
+	@echo "OTHER_CPLUSPLUSFLAGS = $(gb_GLOBALDEFS)" >> $(IOSAPPXC)
+	@echo "LINK_LDFLAGS = -Wl,-lz,-liconv,-map,$(WORKDIR)/iosApp.map " >> $(IOSAPPXC)
+	@echo "SYMROOT = $(WORKDIR)/ios/build\n" >> $(IOSAPPXC)
+
+
+#- Generate ios  ------------------------------------------------------------
 .PHONY : iosCopySetup
-iosCopySetup:
+iosCopySetup: $(IOSKITXC) $(IOSAPPXC)
 ifeq ("$(wildcard $(IOSRES))","")
 	$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ENV,2)
 
@@ -122,7 +131,6 @@ ifeq ("$(wildcard $(IOSRES))","")
 	echo "ProductKey=LibreOffice $(PRODUCTVERSION)"        >> $(IOSRES)/program/bootstraprc
 	echo 'UserInstallation=$$SYSUSERHOME/userinstallation' >> $(IOSRES)/program/bootstraprc
 
-	# Is this really needed?
 	echo '[Version]'            >  $(IOSRES)/program/versionrc
 	echo 'AllLanguages=en-US'   >> $(IOSRES)/program/versionrc
 	echo 'BuildVersion='        >> $(IOSRES)/program/versionrc
@@ -130,10 +138,44 @@ ifeq ("$(wildcard $(IOSRES))","")
 endif
 
 
+#- build  ---------------------------------------------------------------------
+$(IOSKIT): $(IOSKITPRJ) iosCopySetup
+	$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),APP,2)
+	CC=; \
+	$(call gb_Helper_print_on_error, \
+	    xcodebuild \
+	        -xcconfig $(IOSKITXC) \
+	        -project $(IOSKITPRJ) \
+	        -target $(IOSKIT) \
+	        -sdk $(XCODEBUILD_SDK) \
+	        -arch $(XCODE_ARCHS) \
+	        -configuration $(if $(ENABLE_DEBUG),Debug,Release) \
+	        build \
+	        , $(WORKDIR)/ios/build.log \
+	)
+
+
+
+$(IOSAPP): $(IOSAPPPRJ) $(IOSKIT)
+	$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),APP,2)
+	CC=; \
+	$(call gb_Helper_print_on_error, \
+	    xcodebuild \
+	        -xcconfig $(IOSAPPXC) \
+	        -project $(IOSAPPPRJ) \
+	        -target $(IOSAPP) \
+	        -sdk $(XCODEBUILD_SDK) \
+	        -arch $(XCODE_ARCHS) \
+	        -configuration $(if $(ENABLE_DEBUG),Debug,Release) \
+	        build \
+	        , $(WORKDIR)/ios/build.log \
+	)
+
+
 #- clean ios  -----------------------------------------------------------------
-$(call gb_CustomTarget_get_clean_target,ios/setup):
+$(call gb_CustomTarget_get_clean_target,ios/ios):
 	$(call gb_Output_announce,$(subst $(WORKDIR)/Clean/,,$@),$(false),ENV,2)
-	rm -rf $(IOSGEN) $(IOSKIT) $(IOSAPP)
+	rm -rf $(IOSGEN) $(IOSKITXC) $(IOSAPPXC)
 
 
 # vim: set noet sw=4 ts=4:
diff --git a/ios/Module_ios.mk b/ios/Module_ios.mk
index 6cce1200b69c..2a8e248670ba 100644
--- a/ios/Module_ios.mk
+++ b/ios/Module_ios.mk
@@ -11,7 +11,7 @@ $(eval $(call gb_Module_Module,ios))
 ifeq ($(OS),IOS)
 
 $(eval $(call gb_Module_add_targets,ios,\
-	CustomTarget_setup \
+	CustomTarget_iOS \
 ))
 
 endif


More information about the Libreoffice-commits mailing list