Normally, you don't use a Makefile
with a node-gyp
since gyp
is a full-blown make in itself.
To build this you should call
npx node-gyp build
or just node-gyp build
if node_modules/.bin
is in your path
You should also install it as a project dependency: npm i --save node-gyp
If you used yeoman
to get this far, it already built it once for you automagically without requiring node-gyp
- because it contains it in its package. You can call its copy from /usr/lib/node_modules/yo/node_modules/node-gyp/bin/node-gyp.js
but normally you should install it as a dependency of your project.
If you want to build this module from a Makefile
, simply add this:
project/lib/binding/addon.node: project/src/*.cc project/src/*.h
project/node_modules/.bin/node-gyp configure
project/node_modules/.bin/node-gyp build -j max
In this case all your users will have to build it after installing from npm
.
If you want to distribute it as a binary via npm
, I also suggest you take a look at @mapbox/node-pre-gyp
which is a replacement for node-gyp
and automatically downloads prebuilt binaries from Amazon S3. If you prefer using Github Actions / Packages, you should take a look at @mmomtchev/node-pre-gyp-github
of which I am the current maintainer.