From ac737d298b798d10faa7cb36c631b78b8cc4fbba Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Sun, 26 Nov 2017 15:12:16 +0900 Subject: [PATCH] build: install both addon and plugin during npm install --- .gitignore | 3 +-- Makefile | 11 +++++++++-- binding.gyp | 9 +++++++-- package.json | 3 ++- scripts/configure.js | 4 ++-- 5 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index a29fe374..a7493d6a 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,6 @@ build/ out/ npm-debug.log node_modules/ + # generated by scripts/configure.js options.gypi -.project -addon.node diff --git a/Makefile b/Makefile index 7eb85b2b..44fab19e 100644 --- a/Makefile +++ b/Makefile @@ -39,8 +39,7 @@ plugin: configure node scripts/cleanup.js .PHONY: addon -addon: - node scripts/configure.js +addon: configure node-gyp rebuild .PHONY: _travis @@ -50,6 +49,14 @@ _travis: LLNODE_DEBUG=true \ npm test +# `configure` is run during preinstall. +# This is run by `npm install`. +.PHONY: npm-build +npm-build: + ./gyp_llnode + $(MAKE) -C out/ + node-gyp rebuild + .PHONY: clean clean: $(RM) -r out diff --git a/binding.gyp b/binding.gyp index 4872ceb7..2e1ec4a8 100644 --- a/binding.gyp +++ b/binding.gyp @@ -13,6 +13,7 @@ "targets": [{ "target_name": "addon", + "type": "loadable_module", "sources": [ "src/addon.cc", "src/llnode_module.cc", @@ -26,8 +27,12 @@ "<(lldb_dir)/include", "