[ios, osx] Eliminate use of main.mk

This commit is contained in:
John Firebaugh
2016-04-18 17:38:51 -07:00
parent 24a9d47944
commit 2d33ae5ed7
4 changed files with 31 additions and 23 deletions

View File

@@ -9,6 +9,13 @@ else
$(error Cannot determine host platform)
endif
ifneq (,$(wildcard .git/.))
.mason:
git submodule update --init
else
.mason: ;
endif
RUN = +$(MAKE) -f scripts/main.mk
default:
@@ -16,12 +23,19 @@ default:
#### OS X targets ##############################################################
OSX_PROJ_PATH = build/osx-x86_64/platform/osx/platform.xcodeproj
OSX_OUTPUT_PATH = build/osx-x86_64
OSX_PROJ_PATH = $(OSX_OUTPUT_PATH)/platform/osx/platform.xcodeproj
OSX_WORK_PATH = platform/osx/osx.xcworkspace
OSX_DERIVED_DATA_PATH = build/DerivedData/osx
$(OSX_PROJ_PATH): platform/osx/platform.gyp platform/osx/scripts/configure.sh mbgl.gypi test/test.gypi bin/*.gypi
$(RUN) PLATFORM=osx Xcode/__project__
$(OSX_OUTPUT_PATH)/config.gypi: platform/osx/scripts/configure.sh .mason configure
MASON_PLATFORM=osx ./configure $< $@
$(OSX_OUTPUT_PATH)/mbgl.xcconfig: $(OSX_OUTPUT_PATH)/config.gypi
./scripts/export-xcconfig.py $< $@
$(OSX_PROJ_PATH): platform/osx/platform.gyp $(OSX_OUTPUT_PATH)/config.gypi $(OSX_OUTPUT_PATH)/mbgl.xcconfig mbgl.gypi test/test.gypi bin/*.gypi
./deps/run_gyp -f xcode --depth=. --generator-output=$(OSX_OUTPUT_PATH) $<
osx: $(OSX_PROJ_PATH)
set -o pipefail && xcodebuild \
@@ -42,12 +56,19 @@ test-osx: osx node_modules/express
#### iOS targets ##############################################################
IOS_PROJ_PATH = build/ios-all/platform/ios/platform.xcodeproj
IOS_OUTPUT_PATH = build/ios-all
IOS_PROJ_PATH = $(IOS_OUTPUT_PATH)/platform/ios/platform.xcodeproj
IOS_WORK_PATH = platform/ios/ios.xcworkspace
IOS_DERIVED_DATA_PATH = build/DerivedData/ios
$(IOS_PROJ_PATH): platform/ios/platform.gyp platform/ios/scripts/configure.sh mbgl.gypi test/test.gypi
$(RUN) PLATFORM=ios Xcode/__project__
$(IOS_OUTPUT_PATH)/config.gypi: platform/ios/scripts/configure.sh .mason configure
MASON_PLATFORM=ios ./configure $< $@
$(IOS_OUTPUT_PATH)/mbgl.xcconfig: $(IOS_OUTPUT_PATH)/config.gypi
./scripts/export-xcconfig.py $< $@
$(IOS_PROJ_PATH): platform/ios/platform.gyp $(IOS_OUTPUT_PATH)/config.gypi $(IOS_OUTPUT_PATH)/mbgl.xcconfig mbgl.gypi test/test.gypi
./deps/run_gyp -f xcode --depth=. --generator-output=$(IOS_OUTPUT_PATH) $<
ios: $(IOS_PROJ_PATH)
set -o pipefail && xcodebuild \

View File

@@ -2,8 +2,10 @@
'variables': {
'loop_lib': 'darwin',
'headless_lib': 'eagl',
'coverage': 0,
},
'includes': [
'../../build/ios-all/config.gypi',
'../../mbgl.gypi',
'../../test/test.gypi',
],

View File

@@ -2,8 +2,10 @@
'variables': {
'loop_lib': 'darwin',
'headless_lib': 'cgl',
'coverage': 0,
},
'includes': [
'../../build/osx-x86_64/config.gypi',
'../../mbgl.gypi',
'../../test/test.gypi',
'../../bin/glfw.gypi',

View File

@@ -77,13 +77,6 @@ Makefile/__project__: $(PLATFORM_CONFIG_OUTPUT)
@printf "$(TEXT_BOLD)$(COLOR_GREEN)* Recreating project...$(FORMAT_END)\n"
$(ENV) deps/run_gyp platform/$(PLATFORM)/platform.gyp $(GYP_FLAGS) -f make$(GYP_FLAVOR_SUFFIX)
.PHONY: Xcode/__project__
Xcode/__project__: $(PLATFORM_CONFIG_OUTPUT)
@printf "$(TEXT_BOLD)$(COLOR_GREEN)* Exporting gyp variables to xcconfig...$(FORMAT_END)\n"
$(ENV) ./scripts/export-xcconfig.py $(PLATFORM_CONFIG_OUTPUT) $(PLATFORM_OUTPUT)/mbgl.xcconfig
@printf "$(TEXT_BOLD)$(COLOR_GREEN)* Recreating project...$(FORMAT_END)\n"
$(ENV) deps/run_gyp platform/$(PLATFORM)/platform.gyp $(GYP_FLAGS) -f xcode$(GYP_FLAVOR_SUFFIX)
.PHONY: Ninja/__project__
Ninja/__project__: $(PLATFORM_CONFIG_OUTPUT)
@printf "$(TEXT_BOLD)$(COLOR_GREEN)* Recreating project...$(FORMAT_END)\n"
@@ -108,16 +101,6 @@ Makefile/%: Makefile/__project__
@printf "$(TEXT_BOLD)$(COLOR_GREEN)* Building target $*...$(FORMAT_END)\n"
$(ENV) $(MAKE) -j$(JOBS) -C $(PLATFORM_OUTPUT) BUILDTYPE=$(BUILDTYPE) $*
Xcode/%: Xcode/__project__
@printf "$(TEXT_BOLD)$(COLOR_GREEN)* Building target $*...$(FORMAT_END)\n"
set -o pipefail && xcodebuild \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGN_IDENTITY= \
-project $(PLATFORM_OUTPUT)/platform/$(PLATFORM)/platform.xcodeproj \
-configuration $(BUILDTYPE) \
-target $* \
-jobs $(JOBS) | xcpretty
Ninja/%: Ninja/__project__
@printf "$(TEXT_BOLD)$(COLOR_GREEN)* Building target $*...$(FORMAT_END)\n"
$(ENV) deps/ninja/ninja-$(PLATFORM) -C $(PLATFORM_OUTPUT)/$(BUILDTYPE) $*