[beast: 20/70] V8BSE: generate binding.gyp, needed to build v8bse.node with node-gyp



commit dfb7348c1a7076623c1ca3e84cc35411b7fc7079
Author: Tim Janik <timj gnu org>
Date:   Tue Feb 21 13:14:54 2017 +0100

    V8BSE: generate binding.gyp, needed to build v8bse.node with node-gyp
    
    Signed-off-by: Tim Janik <timj gnu org>

 ebeast/v8bse/.gitignore  |    1 +
 ebeast/v8bse/Makefile.am |   38 ++++++++++++++++++++++++++++++--------
 2 files changed, 31 insertions(+), 8 deletions(-)
---
diff --git a/ebeast/v8bse/.gitignore b/ebeast/v8bse/.gitignore
index ba4736f..d901ce0 100644
--- a/ebeast/v8bse/.gitignore
+++ b/ebeast/v8bse/.gitignore
@@ -1,3 +1,4 @@
+/binding.gyp
 /v8bse.cc
 /v8bse.node
 /node_modules/
diff --git a/ebeast/v8bse/Makefile.am b/ebeast/v8bse/Makefile.am
index 3746046..672b369 100644
--- a/ebeast/v8bse/Makefile.am
+++ b/ebeast/v8bse/Makefile.am
@@ -19,14 +19,12 @@ v8bse.cc: ../../bse/bseapi.idl ./V8Stub.py
 CLEANFILES += v8bse.cc *.pyc *.pyo
 
 # == v8bse.node ==
-NODE_GYP = $(strip \
-       HOME=../node_modules/.electron-gyp \
-       CXX="$(CXX)" CXXFLAGS="$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)" \
-       ../node_modules/.bin/node-gyp \
-       $(if $(findstring 1, $(V)) , --verbose) \
-       --target=$(shell ../node_modules/electron/dist/electron --version) \
-)
-v8bse.node: v8bse.cc ./nodemodule.cc ../node_modules/electron/dist/electron
+v8bse_sources = nodemodule.cc
+v8bse_deps    = v8bse.cc binding.gyp
+v8bse_rmflags = -fno-exceptions -fno-rtti
+v8bse_incdirs = ../../ ./v8pp/ $(patsubst -%, , $(patsubst -I%, %, $(LIBBSE_CFLAGS)))
+v8bse_libs    = $(LIBBSE_LIBS)
+v8bse.node: $(v8bse_sources) $(v8bse_deps) ../node_modules/electron/dist/electron
        $(AM_V_GEN)
        $(Q) rm -f v8bse.node build/Release/v8bse.node
        $(Q) $(NODE_GYP) rebuild --dist-url=https://atom.io/download/electron
@@ -34,3 +32,27 @@ v8bse.node: v8bse.cc ./nodemodule.cc ../node_modules/electron/dist/electron
 CLEANFILES += v8bse.node
 clean-local: clean-build
 clean-build: ; rm -rf build/
+NODE_GYP = $(strip \
+       HOME=../node_modules/.electron-gyp \
+       CXX="$(CXX)" CXXFLAGS="$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)" \
+       ../node_modules/.bin/node-gyp \
+       --target=$(shell ../node_modules/electron/dist/electron --version) \
+       $(if $(findstring 1, $(V)) , --verbose) \
+)
+
+# == binding.gyp ==
+cma = ,
+binding.gyp: Makefile # binding.gyp needs Makefile variables
+       $(AM_V_GEN)
+       @echo "{                                             # -*- mode: javascript -*-" >$@
+       @echo "  'targets': ["                                                          >>$@
+       @echo "    {"                                                                   >>$@
+       @echo "      'target_name': 'v8bse',"                                           >>$@
+       @echo "      'sources':      [ $(patsubst %, '%'$(cma), $(v8bse_sources)) ],"   >>$@
+       @echo "      'cflags!':      [ $(patsubst %, '%'$(cma), $(v8bse_rmflags)) ],"   >>$@
+       @echo "      'cflags_cc!':   [ $(patsubst %, '%'$(cma), $(v8bse_rmflags)) ],"   >>$@
+       @echo "      'include_dirs': [ $(patsubst %, '%'$(cma), $(v8bse_incdirs)) ],"   >>$@
+       @echo "      'libraries':    [ $(patsubst %, '%'$(cma), $(v8bse_libs)) ],"      >>$@
+       @echo "    }"                                                                   >>$@
+       @echo "  ]"                                                                     >>$@
+       @echo "}"                                                                       >>$@


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]