#!/bin/bash
DIR=`pwd`/`dirname $0`
TARGET=0.18.4
ARCH=x64

#find . -name binding.gyp
#npm install -g nw-gyp

# For Linux
cd $DIR/node_modules/websocket
nw-gyp rebuild --target=$TARGET --arch=$ARCH || exit 1
cd $DIR/node_modules/usb
nw-gyp rebuild --target=$TARGET --arch=$ARCH || exit 1
cd $DIR/node_modules/bluetooth-hci-socket
nw-gyp rebuild --target=$TARGET --arch=$ARCH || exit 1

# Don't care about serial now - nw.js handles this
#cd $DIR/node_modules/serialport
# serialport is 'special'
#nw-gyp configure --target=$TARGET --arch=$ARCH || exit 1
#nw-gyp rebuild --target=$TARGET --arch=$ARCH || exit 1
#node-pre-gyp build --runtime=node-webkit --target=$TARGET
