diff options
author | jan Iversen <jani@libreoffice.org> | 2018-01-25 15:14:36 +0100 |
---|---|---|
committer | jan Iversen <jani@libreoffice.org> | 2018-01-25 17:30:32 +0100 |
commit | bf0117cce987dd92f6e658de0e186a282677b17f (patch) | |
tree | 961fcd37b6f57bf3a994e89f83b9267ae72349c4 /ios | |
parent | 376ba90ee29bb6da5c3c079575333577aea4fee0 (diff) |
iOS, simplified dylib build
Change-Id: Icea9a5e4796dda288fafcd478a769fa7087baab2
Diffstat (limited to 'ios')
-rw-r--r-- | ios/CustomTarget_iOS_link.mk (renamed from ios/CustomTarget_iOS_prelink.mk) | 71 | ||||
-rw-r--r-- | ios/Module_ios.mk | 5 | ||||
-rw-r--r-- | ios/StaticLibrary_iOSkit.mk | 28 |
3 files changed, 33 insertions, 71 deletions
diff --git a/ios/CustomTarget_iOS_prelink.mk b/ios/CustomTarget_iOS_link.mk index 0534264d416c..ab5ad721d8d7 100644 --- a/ios/CustomTarget_iOS_prelink.mk +++ b/ios/CustomTarget_iOS_link.mk @@ -5,60 +5,50 @@ # 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 ------------------------------------------------------------------------ -IOSLIB = '' -IOSLD = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld -IOSCLANG = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -IOSOBJ = $(WORKDIR)/CObject/ios/Kit.o +IOSGEN = $(SRCDIR)/ios/generated +IOSLIBS := $(shell \ + (export INSTDIR=$(INSTDIR);export OS=$(OS); \ + export WORKDIR=$(WORKDIR);export LIBO_LIB_FOLDER=$(LIBO_LIB_FOLDER); \ + $(SRCDIR)/bin/lo-all-static-libs)) +IOSOBJ = $(WORKDIR)/ios/Kit.o +IOSSRC = $(SRCDIR)/ios/source/LibreOfficeKit.c ifeq ($(ENABLE_DEBUG),TRUE) ifeq ($(CPUNAME),X86_64) -IOSKIT = $(IOSGEN)/simulator/libKit +IOSKIT = $(IOSGEN)/simulator/libKit.dylib else -IOSKIT = $(IOSGEN)/debug/libKit +IOSKIT = $(IOSGEN)/debug/libKit.dylib endif else ifeq ($(CPUNAME),ARM64) -IOSKIT = $(IOSGEN)/release/libKit +IOSKIT = $(IOSGEN)/release/libKit.dylib endif endif #- Top level ----------------------------------------------------------------- -$(eval $(call gb_CustomTarget_CustomTarget,ios/iOS_prelink)) - -$(call gb_CustomTarget_get_target,ios/iOS_prelink): $(IOSKIT).dylib +$(eval $(call gb_CustomTarget_CustomTarget,ios/iOS_link)) +$(call gb_CustomTarget_get_target,ios/iOS_link): $(IOSKIT) #- build --------------------------------------------------------------------- -.PHONY: FORCE -FORCE: - - -IOSPREBUILD: FORCE - $(eval IOSLIBS = `$(SRCDIR)/bin/lo-all-static-libs`) - - - -$(IOSKIT).a: IOSPREBUILD $(WORKDIR)/ios $(call gb_StaticLibrary_get_target,iOS_kitBridge) \ - $(IOSLIBS) - $(call gb_Output_announce,iOS prelink object,$(true),LNK,2) - $(IOSLD) -r -ios_version_min $(IOS_DEPLOYMENT_VERSION) \ - -syslibroot $(MACOSX_SDK_PATH) \ - -arch `echo $(CPUNAME) | tr '[:upper:]' '[:lower:]'` \ - -o $(IOSOBJ) \ - $(WORKDIR)/CObject/ios/source/LibreOfficeKit.o \ - $(IOSLIBS) - $(AR) -r $(IOSKIT).a $(IOSOBJ) - - -$(IOSKIT).dylib: $(IOSKIT).a +$(IOSOBJ): $(IOSSRC) $(call gb_CustomTarget_get_target,ios/iOS_setup) + $(call gb_Output_announce,iOS compile interface,$(true),C,2) + $(gb_CC) $(gb_COMPILERDEFS) $(gb_OSDEFS) $(gb_CFLAGS) \ + -DDISABLE_DYNLOADING -DLIBO_INTERNAL_ONLY \ + -fvisibility=hidden -Werror -O0 -fstrict-overflow \ + $(if $(ENABLE_DEBUG),$(gb_DEBUG_CFLAGS) -g) \ + -c $(IOSSRC) -o $(IOSOBJ) \ + -I$(SRCDIR)/include -I$(BUILDDIR)/config_host \ + +$(IOSKIT): $(IOSOBJ) $(IOSLIBS) $(call gb_Output_announce,iOS dylib,$(true),LNK,2) - $(IOSCLANG) -dynamiclib -mios-simulator-version-min=$(IOS_DEPLOYMENT_VERSION) \ - -arch `echo $(CPUNAME) | tr '[:upper:]' '[:lower:]'` \ - -isysroot $(MACOSX_SDK_PATH) \ + $(gb_CC) -dynamiclib \ -Xlinker -rpath -Xlinker @executable_path/Frameworks \ -Xlinker -rpath -Xlinker @loader_path/Frameworks \ -dead_strip \ @@ -76,22 +66,21 @@ $(IOSKIT).dylib: $(IOSKIT).a -single_module \ -compatibility_version 1 \ -current_version 1 \ + $(IOSLIBS) \ $(IOSOBJ) \ - -o $(IOSKIT).dylib + -o $(IOSKIT) ifeq ($(origin IOS_CODEID),undefined) @echo "please define environment variable IOS_CODEID as\n" \ "export IOS_CODEID=<your apple code identifier>" @exit -1 else - codesign -s "$(IOS_CODEID)" $(IOSKIT).dylib + codesign -s "$(IOS_CODEID)" $(IOSKIT) endif - - #- clean ios ----------------------------------------------------------------- -$(call gb_CustomTarget_get_clean_target,ios/iOS_prelink): - rm -f $(IOSKIT).a $(IOSKIT).dylib +$(call gb_CustomTarget_get_clean_target,ios/iOS_link): + rm -f $(IOSKIT).dylib diff --git a/ios/Module_ios.mk b/ios/Module_ios.mk index c280713cc198..111391b31bee 100644 --- a/ios/Module_ios.mk +++ b/ios/Module_ios.mk @@ -12,11 +12,12 @@ ifeq ($(OS),IOS) $(eval $(call gb_Module_add_targets,ios,\ CustomTarget_iOS_setup \ - StaticLibrary_iOSkit \ - CustomTarget_iOS_prelink \ + CustomTarget_iOS_link \ )) + + endif # vim: set noet sw=4 ts=4: diff --git a/ios/StaticLibrary_iOSkit.mk b/ios/StaticLibrary_iOSkit.mk deleted file mode 100644 index a543e494a344..000000000000 --- a/ios/StaticLibrary_iOSkit.mk +++ /dev/null @@ -1,28 +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/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# - -$(eval $(call gb_StaticLibrary_StaticLibrary,iOS_kitBridge)) - -$(eval $(call gb_StaticLibrary_add_cobjects,iOS_kitBridge,\ - ios/source/LibreOfficeKit \ -)) - -$(call gb_StaticLibrary_get_target,ios/iOS_kitBridge): $(call gb_CustomTarget_get_target,ios/iOS_setup) - -# vim: set noet sw=4 ts=4: |