[build] Inline main.mk node targets into Makefile

This commit is contained in:
John Firebaugh
2016-05-23 18:42:42 -07:00
parent c4ba219581
commit b611a6f5dc
2 changed files with 16 additions and 31 deletions

View File

@@ -2,8 +2,10 @@ export BUILDTYPE ?= Release
export ENABLE_COVERAGE ?= 0
ifeq ($(shell uname -s), Darwin)
HOST_PLATFORM = osx
export JOBS ?= $(shell sysctl -n hw.ncpu)
else ifeq ($(shell uname -s), Linux)
HOST_PLATFORM = linux
export JOBS ?= $(shell grep --count processor /proc/cpuinfo)
else
$(error Cannot determine host platform)
@@ -167,16 +169,24 @@ test-android:
#### Node targets #####################################################
NODE_PRE_GYP = $(shell npm bin)/node-pre-gyp
NODE_OUTPUT_PATH = build/node-$(HOST_PLATFORM)-$(shell uname -m)
node_modules: package.json
npm update # Install dependencies but don't run our own install script.
.PHONY: node
node: node_modules
$(RUN) PLATFORM=node Makefile/node
$(NODE_OUTPUT_PATH)/config.gypi: platform/$(HOST_PLATFORM)/scripts/configure.sh .mason configure
./configure $< $@ $(HOST_PLATFORM) $(shell uname -m)
.PHONY: xnode
xnode:
$(RUN) Xcode/node
node: $(NODE_OUTPUT_PATH)/config.gypi node_modules
$(NODE_PRE_GYP) configure --clang -- -I$< \
-Dcoverage= -Dlibuv_cflags= -Dlibuv_ldflags= -Dlibuv_static_libs=
$(NODE_PRE_GYP) build --clang
xnode: $(NODE_OUTPUT_PATH)/config.gypi
$(NODE_PRE_GYP) configure --clang -- -I$< \
-Dcoverage= -Dlibuv_cflags= -Dlibuv_ldflags= -Dlibuv_static_libs= \
-f xcode
./platform/node/scripts/create_node_scheme.sh "node test" "`npm bin tape`/tape platform/node/test/js/**/*.test.js"
./platform/node/scripts/create_node_scheme.sh "npm run test-suite" "platform/node/test/render.test.js"
open ./build/binding.xcodeproj

View File

@@ -24,12 +24,6 @@ else ifeq ($(PLATFORM),qt)
# Cross compilation support
ENV = $(shell MASON_PLATFORM_VERSION=$(CONFIGURE_SUBPLATFORM) ./platform/qt/scripts/toolchain.sh)
else ifeq ($(PLATFORM),node)
CONFIGURE_PLATFORM = $(HOST_PLATFORM)
CONFIGURE_SUBPLATFORM = $(shell uname -m)
CONFIGURE_INPUT = platform/$(HOST_PLATFORM)/scripts/configure.sh
PLATFORM_OUTPUT = ./build/node-$(HOST_PLATFORM)-$(CONFIGURE_SUBPLATFORM)
else
CONFIGURE_PLATFORM = $(PLATFORM)
CONFIGURE_SUBPLATFORM = $(shell uname -m)
@@ -37,12 +31,6 @@ else
PLATFORM_OUTPUT = ./build/$(PLATFORM)-$(CONFIGURE_SUBPLATFORM)
endif
ifneq (,$(findstring clang,$(CXX)))
CXX_HOST = "clang"
else ifneq (,$(findstring g++,$(CXX)))
CXX_HOST = "g++"
endif
# Text formatting
TEXT_BOLD = \033[1m
COLOR_GREEN = \033[32m
@@ -87,19 +75,6 @@ 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
#### Node targets ##############################################################
NODE_PRE_GYP = $(shell npm bin)/node-pre-gyp
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: $(CONFIGURE_OUTPUT)
$(NODE_PRE_GYP) configure --clang -- $(GYP_FLAGS) -f xcode \
-Dlibuv_cflags= -Dlibuv_ldflags= -Dlibuv_static_libs=
#### Build individual targets ##################################################
Makefile/%: Makefile/__project__