Skip to content

Commit

Permalink
Using make for better installation process
Browse files Browse the repository at this point in the history
  • Loading branch information
indutny committed Aug 11, 2010
1 parent a119ee7 commit 19058b8
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 20 deletions.
6 changes: 3 additions & 3 deletions .gitignore
@@ -1,5 +1,5 @@
*.zip
nTPL.native/build
nTPL.native/build/*
nTPL.native/.lock-wscript
build
build/*
.lock-wscript
lib/nTPL.native.node
24 changes: 24 additions & 0 deletions Makefile
@@ -0,0 +1,24 @@
LIB_PREFIX = $(HOME)/.node_libraries
NODE = node

build:
@echo "Building nTPL ..."
@rm -rf build/ && node-waf configure && node-waf build
@rm .lock-wscript
@rm -rf build/

install:
@echo "Installing nTPL ..."
@cp -fr lib/ $(LIB_PREFIX)/

uninstall:
@echo "Uninstalling nTPL ..."
@rm -f $(LIB_PREFIX)/nTPL.js
@rm -f $(LIB_PREFIX)/nTPL.native.node
@rm -f $(LIB_PREFIX)/nTPL.block.js
@rm -f $(LIB_PREFIX)/nTPL.filter.js

test:
@cd ./tests && $(NODE) run.js && cd ..

.PHONY : build install uninstall test
7 changes: 3 additions & 4 deletions README.rdoc
Expand Up @@ -24,10 +24,9 @@ After that all nTPL module will be stored in lib folder:

git clone git@github.com:donnerjack13589/nTPL.git
cd nTPL
cd nTPL.native
./build.sh
cd ../tests/
node run.js
make
make install
make test

==Basic examples:

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/million_complex.js
@@ -1,4 +1,4 @@
require("../lib/nTPL");
require("nTPL");

var tpl = nTPL({
template: "./complex.html",
Expand Down
6 changes: 3 additions & 3 deletions example.js
@@ -1,6 +1,6 @@
require("./lib/nTPL");
require("./lib/nTPL.block");
require("./lib/nTPL.filter");
require("nTPL");
require("nTPL.block");
require("nTPL.filter");

var base = nTPL({
template: "./tpl/base.html",
Expand Down
2 changes: 1 addition & 1 deletion lib/nTPL.js
Expand Up @@ -31,7 +31,7 @@ this.nTPL = nTPL = (function() {

var fs = require('fs');
var path = require('path');
var nTPL_native = require('./nTPL.native');
var nTPL_native = require('nTPL.native');

var compile = process.compile;

Expand Down
1 change: 0 additions & 1 deletion nTPL.native/build.sh

This file was deleted.

6 changes: 3 additions & 3 deletions tests/run.js
Expand Up @@ -2,9 +2,9 @@ var fs = require("fs");
var path = require("path");
var test = require("assert");

require("../lib/nTPL");
require("../lib/nTPL.block");
require("../lib/nTPL.filter");
require("nTPL");
require("nTPL.block");
require("nTPL.filter");

var tests = [];

Expand Down
8 changes: 4 additions & 4 deletions nTPL.native/wscript → wscript
Expand Up @@ -17,10 +17,10 @@ def build(bld):
cargo = bld.new_task_gen('cxx', 'shlib', 'node_addon')
cargo.cxxflags = ["-g",]
cargo.target = 'nTPL.native'
cargo.source = 'nTPL.native.cc'
cargo.source = 'nTPL.native/nTPL.native.cc'

def shutdown():
if exists('../lib/nTPL.native.node'):
unlink('../lib/nTPL.native.node');
if exists('./lib/nTPL.native.node'):
unlink('./lib/nTPL.native.node');
if exists('./build/default/nTPL.native.node'):
copy('./build/default/nTPL.native.node', '../lib/nTPL.native.node')
copy('./build/default/nTPL.native.node', './lib/nTPL.native.node')

0 comments on commit 19058b8

Please sign in to comment.