diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-05-23 17:31:44 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-05-23 17:38:11 -0700 |
commit | d378d1f8237078596e0333204f36049b542f4681 (patch) | |
tree | 25fd1ae1810e5390739381821c1249101eadf2cc /scripts | |
parent | 58cd5cae12ede01f8cc8d837ecb1870419e7967a (diff) | |
download | qtlocation-mapboxgl-d378d1f8237078596e0333204f36049b542f4681.tar.gz |
[build] Avoid variable name coupling between main.mk and configure
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/main.mk | 52 |
1 files changed, 25 insertions, 27 deletions
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= |