diff --git a/Makefile b/Makefile index 52ce7db88..d66f6ad1c 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,11 @@ JOBS = $(shell nproc) endif endif +NODE_PRE_GYP = $(shell which node-pre-gyp) +ifeq ($(NODE_PRE_GYP),) +NODE_PRE_GYP = $(shell npm bin)/node-pre-gyp +endif + # Explicitly disable the default FileSource implementation ASSET = none HTTP = none @@ -30,20 +35,28 @@ global: build .PHONY: build build: build/Makefile - @node-pre-gyp build $(DEBUG_FLAG) --clang -- -j$(JOBS) + @$(NODE_PRE_GYP) build $(DEBUG_FLAG) --clang -- -j$(JOBS) vendor/mbgl: git submodule update --init +GYP_SETTINGS = -Dmbgl=$(MBGL) \ + -Dhost=$(HOST) \ + -I$(MBGL)/config/$(HOST).gypi \ + $(LIBS_$(HOST)) \ + -Duv_static_libs= -Duv_ldflags= + .PHONY: build/Makefile build/Makefile: $(MBGL)/config/$(HOST).gypi - @node-pre-gyp configure --clang -- \ - -Dmbgl=$(MBGL) \ - -Dhost=$(HOST) \ - -I$(MBGL)/config/$(HOST).gypi \ - $(LIBS_$(HOST)) \ - -Duv_static_libs= -Duv_ldflags= \ - -Goutput_dir=. + @$(NODE_PRE_GYP) configure --clang -- $(GYP_SETTINGS) -f make + +.PHONY: build/binding.xcodeproj +build/binding.xcodeproj: $(MBGL)/config/$(HOST).gypi + @$(NODE_PRE_GYP) configure --clang -- $(GYP_SETTINGS) -f xcode + +.PHONY: xproj +xproj: build/binding.xcodeproj + open build/binding.xcodeproj $(MBGL)/config/%.gypi: $(MBGL) $(MBGL)/configure make -C $(MBGL) config/$*.gypi diff --git a/examples/load-from-fs.js b/examples/load-from-fs.js old mode 100644 new mode 100755 diff --git a/src/node_file_source.cpp b/src/node_file_source.cpp index 9621132a8..e50237f48 100644 --- a/src/node_file_source.cpp +++ b/src/node_file_source.cpp @@ -1,7 +1,7 @@ #include "node_file_source.hpp" #include "node_request.hpp" -#include +#include #include namespace node_mbgl { diff --git a/src/node_request.cpp b/src/node_request.cpp index 415d27d82..b67fd2097 100644 --- a/src/node_request.cpp +++ b/src/node_request.cpp @@ -1,6 +1,6 @@ #include "node_request.hpp" #include "node_file_source.hpp" -#include +#include #include #include diff --git a/vendor/mbgl b/vendor/mbgl index f221fc7af..7827d4954 160000 --- a/vendor/mbgl +++ b/vendor/mbgl @@ -1 +1 @@ -Subproject commit f221fc7af5b29edf87cf670acdfc9e7b775a34e1 +Subproject commit 7827d4954cea5b4fcfce3f245aae2e8c66e0ccb2