diff options
-rw-r--r-- | Makefile | 4 | ||||
-rwxr-xr-x | configure | 2 | ||||
-rw-r--r-- | platform/qt/scripts/configure.sh | 2 | ||||
-rw-r--r-- | scripts/main.mk | 52 |
4 files changed, 30 insertions, 30 deletions
@@ -39,7 +39,7 @@ OSX_WORK_PATH = platform/osx/osx.xcworkspace OSX_USER_DATA_PATH = $(OSX_WORK_PATH)/xcuserdata/$(USER).xcuserdatad $(OSX_OUTPUT_PATH)/config.gypi: platform/osx/scripts/configure.sh .mason configure - MASON_PLATFORM=osx ./configure $< $@ + ./configure $< $@ osx $(OSX_OUTPUT_PATH)/mbgl.xcconfig: $(OSX_OUTPUT_PATH)/config.gypi ./scripts/export-xcconfig.py $< $@ @@ -88,7 +88,7 @@ IOS_WORK_PATH = platform/ios/ios.xcworkspace IOS_USER_DATA_PATH = $(IOS_WORK_PATH)/xcuserdata/$(USER).xcuserdatad $(IOS_OUTPUT_PATH)/config.gypi: platform/ios/scripts/configure.sh .mason configure - MASON_PLATFORM=ios ./configure $< $@ + ./configure $< $@ ios $(IOS_OUTPUT_PATH)/mbgl.xcconfig: $(IOS_OUTPUT_PATH)/config.gypi ./scripts/export-xcconfig.py $< $@ @@ -4,6 +4,8 @@ set -euo pipefail INPUT_FILE=$1 OUTPUT_FILE=$2 +export MASON_PLATFORM=$3 +export MASON_PLATFORM_VERSION=${4:-} if [ -z ${INPUT_FILE} ]; then abort 'You need to specify an input path for the configure.sh file' diff --git a/platform/qt/scripts/configure.sh b/platform/qt/scripts/configure.sh index bf8ea049b6..bb9df18038 100644 --- a/platform/qt/scripts/configure.sh +++ b/platform/qt/scripts/configure.sh @@ -73,7 +73,7 @@ function print_qt_flags { fi } -CONFIGURE_SUPLATFORM=platform/qt/scripts/configure-${SUBPLATFORM}.sh +CONFIGURE_SUPLATFORM=platform/qt/scripts/configure-${MASON_PLATFORM_VERSION}.sh if [ -f $CONFIGURE_SUPLATFORM ]; then source $CONFIGURE_SUPLATFORM diff --git a/scripts/main.mk b/scripts/main.mk index fd73867f2f..dca4ec4b5b 100644 --- a/scripts/main.mk +++ b/scripts/main.mk @@ -18,42 +18,40 @@ endif ifeq ($(PLATFORM),node) ifeq ($(shell uname -s), Darwin) - export MASON_PLATFORM ?= osx - export MASON_PLATFORM_VERSION = $(SUBPLATFORM) + CONFIGURE_PLATFORM ?= osx + CONFIGURE_SUBPLATFORM = $(SUBPLATFORM) export PLATFORM_SLUG = node-osx-$(SUBPLATFORM) else ifeq ($(shell uname -s), Linux) - export MASON_PLATFORM ?= linux - export MASON_PLATFORM_VERSION = $(SUBPLATFORM) + CONFIGURE_PLATFORM ?= linux + CONFIGURE_SUBPLATFORM = $(SUBPLATFORM) export PLATFORM_SLUG = node-linux-$(SUBPLATFORM) endif endif ifeq ($(PLATFORM),qt) ifeq ($(shell uname -s), Darwin) - export MASON_PLATFORM ?= osx - - ifneq ($(MASON_PLATFORM), osx) - export GYP_FLAVOR_SUFFIX = -$(MASON_PLATFORM) - endif + CONFIGURE_PLATFORM ?= osx + CONFIGURE_SUBPLATFORM = $(SUBPLATFORM) + PLATFORM_SLUG = qt-osx-$(SUBPLATFORM) else ifeq ($(shell uname -s), Linux) - export MASON_PLATFORM ?= linux + CONFIGURE_PLATFORM ?= linux + CONFIGURE_SUBPLATFORM = $(SUBPLATFORM) + PLATFORM_SLUG = qt-linux-$(SUBPLATFORM) endif - export MASON_PLATFORM_VERSION = $(SUBPLATFORM) - export PLATFORM_SLUG = qt-$(MASON_PLATFORM)-$(SUBPLATFORM) - export PLATFORM_CONFIG_INPUT = platform/qt/scripts/configure.sh + CONFIGURE_INPUT = platform/qt/scripts/configure.sh # Cross compilation support ENV = $(shell MASON_PLATFORM_VERSION=$(SUBPLATFORM) ./platform/qt/scripts/toolchain.sh) endif # Defaults if not set -export PLATFORM_OUTPUT ?= ./build/$(PLATFORM_SLUG) -export PLATFORM_CONFIG_INPUT ?= platform/$(MASON_PLATFORM)/scripts/configure.sh -export PLATFORM_CONFIG_OUTPUT ?= $(PLATFORM_OUTPUT)/config.gypi -export MASON_PLATFORM ?= $(PLATFORM) -export MASON_PLATFORM_VERSION ?= $(SUBPLATFORM) -export PLATFORM_SLUG ?= $(PLATFORM)-$(SUBPLATFORM) +PLATFORM_SLUG ?= $(PLATFORM)-$(SUBPLATFORM) +PLATFORM_OUTPUT ?= ./build/$(PLATFORM_SLUG) +CONFIGURE_PLATFORM ?= $(PLATFORM) +CONFIGURE_SUBPLATFORM ?= $(SUBPLATFORM) +CONFIGURE_INPUT ?= platform/$(CONFIGURE_PLATFORM)/scripts/configure.sh +CONFIGURE_OUTPUT ?= $(PLATFORM_OUTPUT)/config.gypi ifneq (,$(findstring clang,$(CXX))) CXX_HOST = "clang" @@ -80,14 +78,14 @@ else .mason: ; endif -.NOTPARALLEL: $(PLATFORM_CONFIG_OUTPUT) -$(PLATFORM_CONFIG_OUTPUT): .mason configure $(PLATFORM_CONFIG_INPUT) +.NOTPARALLEL: $(CONFIGURE_OUTPUT) +$(CONFIGURE_OUTPUT): $(CONFIGURE_INPUT) .mason configure @printf "$(TEXT_BOLD)$(COLOR_GREEN)* Running configure...$(FORMAT_END)\n" - $(ENV) ./configure $(PLATFORM_CONFIG_INPUT) $(PLATFORM_CONFIG_OUTPUT) + $(ENV) ./configure $< $@ $(CONFIGURE_PLATFORM) $(CONFIGURE_SUBPLATFORM) #### Build files ############################################################### -GYP_FLAGS += -I$(PLATFORM_CONFIG_OUTPUT) +GYP_FLAGS += -I$(CONFIGURE_OUTPUT) GYP_FLAGS += -Dcoverage=$(ENABLE_COVERAGE) GYP_FLAGS += -Dcxx_host=$(CXX_HOST) GYP_FLAGS += -Goutput_dir=. @@ -95,12 +93,12 @@ GYP_FLAGS += --depth=. GYP_FLAGS += --generator-output=$(PLATFORM_OUTPUT) .PHONY: Makefile/__project__ -Makefile/__project__: $(PLATFORM_CONFIG_OUTPUT) +Makefile/__project__: $(CONFIGURE_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: Ninja/__project__ -Ninja/__project__: $(PLATFORM_CONFIG_OUTPUT) +Ninja/__project__: $(CONFIGURE_OUTPUT) @printf "$(TEXT_BOLD)$(COLOR_GREEN)* Recreating project...$(FORMAT_END)\n" $(ENV) deps/run_gyp platform/$(PLATFORM)/platform.gyp $(GYP_FLAGS) -f ninja @@ -108,12 +106,12 @@ Ninja/__project__: $(PLATFORM_CONFIG_OUTPUT) NODE_PRE_GYP = $(shell npm bin)/node-pre-gyp -Makefile/node: $(PLATFORM_CONFIG_OUTPUT) +Makefile/node: $(CONFIGURE_OUTPUT) $(NODE_PRE_GYP) configure --clang -- $(GYP_FLAGS) \ -Dlibuv_cflags= -Dlibuv_ldflags= -Dlibuv_static_libs= $(NODE_PRE_GYP) build --clang -Xcode/node: $(PLATFORM_CONFIG_OUTPUT) +Xcode/node: $(CONFIGURE_OUTPUT) $(NODE_PRE_GYP) configure --clang -- $(GYP_FLAGS) -f xcode \ -Dlibuv_cflags= -Dlibuv_ldflags= -Dlibuv_static_libs= |