Skip to content

Commit

Permalink
Merge pull request serialport#35 from TooTallNate/gyp
Browse files Browse the repository at this point in the history
Added support for "node-gyp" build
  • Loading branch information
Chris Williams committed Feb 25, 2012
2 parents 74998a2 + 5c9e798 commit a71fe82
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 10 deletions.
12 changes: 9 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
serialport_native/.lock-wscript
.lock-wscript
*.node
.DS_Store
*lock-wscript
*build
build/
node_modules
npm-debug.log
Makefile.gyp
*.Makefile
*.target.gyp.mk
out
gyp-mac-tool
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
setup :
cd serialport_native;node-waf configure build;cd ..;
cp serialport_native/build/Release/serialport_native.node .
setup:
node-waf configure build
8 changes: 8 additions & 0 deletions bindings.gyp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
'targets': [
{
'target_name': 'serialport_native',
'sources': [ 'serialport_native/serialport_native.cc' ]
}
]
}
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
"type": "git",
"url": "git://github.com/voodootikigod/node-serialport.git"
},
"scripts": { "install": "cd serialport_native;node-waf configure build;cp build/Release/serialport_native.node ../" },

"scripts": {
"install": "node-waf configure build"
},
"dependencies": {
"bindings": "*"
},
"engines": { "node": "0.6" }
}
2 changes: 1 addition & 1 deletion serialport.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var Buffer = require('buffer').Buffer;
var stream = require('stream');
var fs = require('fs');
var net = require('net');
var serialport_native = require('./serialport_native');
var serialport_native = require('bindings')('serialport_native.node');
var IOWatcher = process.binding('io_watcher').IOWatcher;

var BAUDRATES = [115200, 57600, 38400, 19200, 9600, 4800, 2400, 1800, 1200, 600, 300, 200, 150, 134, 110, 75, 50];
Expand Down
2 changes: 1 addition & 1 deletion serialport_native/wscript → wscript
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ def configure(conf):
def build(bld):
obj = bld.new_task_gen('cxx', 'shlib', 'node_addon')
obj.target = 'serialport_native'
obj.source = 'serialport_native.cc'
obj.source = 'serialport_native/serialport_native.cc'

0 comments on commit a71fe82

Please sign in to comment.