summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--Makefile4
-rw-r--r--platform/node/binding.gyp9
-rw-r--r--scripts/main.mk18
4 files changed, 27 insertions, 6 deletions
diff --git a/.gitignore b/.gitignore
index 3e46c0a0a3..7613490aa5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,6 +28,8 @@
/src/shader/shaders_gl.cpp
/src/shader/shaders_gles2.cpp
/bin/style.bin.js
+/platform/*.mk
+/platform/*.Makefile
*~
/ios/benchmark/assets/tiles/mapbox.mapbox-streets-v6/
diff --git a/Makefile b/Makefile
index 358b3c05c5..c901f645a8 100644
--- a/Makefile
+++ b/Makefile
@@ -80,6 +80,10 @@ android-all: android-lib-x86 android-lib-x86-64
android-all: android-lib-mips android-lib-mips-64
cd android/java && ./gradlew --parallel-threads=$(JOBS) assemble$(BUILDTYPE)
+# Builds the Node.js library
+.PHONY: node
+node: ; $(RUN) HTTP=none ASSET=none CACHE=none Makefile/node
+
.PHONY: test
test: ; $(RUN) Makefile/test
test-%: ; $(RUN) test-$*
diff --git a/platform/node/binding.gyp b/platform/node/binding.gyp
index a5fb583399..560d82c9c6 100644
--- a/platform/node/binding.gyp
+++ b/platform/node/binding.gyp
@@ -1,10 +1,13 @@
{
+ 'includes': [
+ '../../gyp/common.gypi',
+ ],
'targets': [
{ 'target_name': '<(module_name)',
'dependencies': [
- './<(mbgl)/mbgl.gyp:core',
- './<(mbgl)/mbgl.gyp:platform-<(platform_lib)',
- './<(mbgl)/mbgl.gyp:headless-<(headless_lib)',
+ '../../mbgl.gyp:core',
+ '../../mbgl.gyp:platform-<(platform_lib)',
+ '../../mbgl.gyp:headless-<(headless_lib)',
],
'include_dirs': [ "<!(node -e \"require('nan')\")" ],
diff --git a/scripts/main.mk b/scripts/main.mk
index d61a61e034..451f6a0d06 100644
--- a/scripts/main.mk
+++ b/scripts/main.mk
@@ -70,7 +70,6 @@ config/%.gypi: $(SUBMODULES) configure $(CONFIGURE_FILES)
#### Build files ###############################################################
GYP_FLAGS += -Dhost=$(HOST)
-GYP_FLAGS += -Iconfig/$(HOST_SLUG).gypi
GYP_FLAGS += -Dplatform_lib=$(PLATFORM)
GYP_FLAGS += -Dhttp_lib=$(HTTP)
GYP_FLAGS += -Dasset_lib=$(ASSET)
@@ -85,15 +84,28 @@ GYP_FLAGS += --generator-output=./build/$(HOST_SLUG)
.PHONY: Makefile/__project__
Makefile/__project__: print-env $(SUBMODULES) config/$(HOST_SLUG).gypi
@printf "$(TEXT_BOLD)$(COLOR_GREEN)* Recreating project...$(FORMAT_END)\n"
- $(QUIET)$(ENV) deps/run_gyp gyp/$(HOST).gyp $(GYP_FLAGS) -f make$(GYP_FLAVOR_SUFFIX)
+ $(QUIET)$(ENV) deps/run_gyp gyp/$(HOST).gyp $(GYP_FLAGS) \
+ -Iconfig/$(HOST_SLUG).gypi -f make$(GYP_FLAVOR_SUFFIX)
.PHONY: Xcode/__project__
Xcode/__project__: print-env $(SUBMODULES) config/$(HOST_SLUG).gypi
@printf "$(TEXT_BOLD)$(COLOR_GREEN)* Recreating project...$(FORMAT_END)\n"
- $(QUIET)$(ENV) deps/run_gyp gyp/$(HOST).gyp $(GYP_FLAGS) -f xcode$(GYP_FLAVOR_SUFFIX)
+ $(QUIET)$(ENV) deps/run_gyp gyp/$(HOST).gyp $(GYP_FLAGS) \
+ -Iconfig/$(HOST_SLUG).gypi -f xcode$(GYP_FLAVOR_SUFFIX)
#### Build individual targets ##################################################
+NODE_PRE_GYP = $(shell cd platform/node && npm bin)/node-pre-gyp
+node/configure:
+ cd platform/node && $(NODE_PRE_GYP) configure --clang -- \
+ $(GYP_FLAGS) -I../../config/$(HOST_SLUG).gypi \
+ -Dlibuv_ldflags= -Dlibuv_static_libs=
+
+Makefile/node: Makefile/__project__ node/configure
+ @printf "$(TEXT_BOLD)$(COLOR_GREEN)* Building target node...$(FORMAT_END)\n"
+ cd platform/node && $(NODE_PRE_GYP) build --clang -- \
+ -j$(JOBS)
+
Makefile/%: Makefile/__project__
@printf "$(TEXT_BOLD)$(COLOR_GREEN)* Building target $*...$(FORMAT_END)\n"
$(QUIET)$(ENV) $(MAKE) -C build/$(HOST_SLUG) BUILDTYPE=$(BUILDTYPE) $*