summaryrefslogtreecommitdiffstats
path: root/node
diff options
context:
space:
mode:
authorroot <root@filebitch>2011-08-16 19:10:17 +0200
committerroot <root@filebitch>2011-08-16 19:10:17 +0200
commit460982f036bdc4815ea5e9447392bdb049ff2a87 (patch)
treeb27e2e3cb28b8b4ecbb3e9ba2004966241262c85 /node
parent9a9ff1d97fa5072109a4381484f5daf5a4bfb0c1 (diff)
parent84f25017f61d87c592bcc4519bee56e49fe66083 (diff)
Merge branch 'master' of https://github.com/krebscode/painload
Diffstat (limited to 'node')
-rw-r--r--node/Makefile42
1 files changed, 32 insertions, 10 deletions
diff --git a/node/Makefile b/node/Makefile
index 20e15c70..0b7775ed 100644
--- a/node/Makefile
+++ b/node/Makefile
@@ -1,24 +1,46 @@
+ifndef version
+ version := $(shell \
+ curl -sS http://nodejs.org/ | \
+ ../util/bin/hrefs | \
+ sed -rn 's:.*node-(v[0-9.]+)\.tar\.gz:\1:p' | \
+ sort | \
+ tail -n 1)
+endif
+
+export CPPFLAGS := -Wno-unused-but-set-variable
.PHONY: all build install
all:
@echo "You are made of stupid!"; exit 23
-build: node node/build/default/node
- cd node && ./configure && make
+build: out/node-$(version)
+
+install: out/node-$(version)
+ ln -vsnf ../node/$</bin/node ../bin/node
-install: build
- cd node && make install
+out/node-%: src/node-%
+ cd $< && ./configure --prefix=$(PWD)/$@
+ make -C $<
+ make -C $< install
-node: node-git
- ln -vsnf $< $@
+../bin/node: out/
-node-git:
- git clone https://github.com/joyent/node node-git
+src/node-git: src
+ cd src && \
+ git clone https://github.com/joyent/node node-git
-node-%: /usr/bin/curl
- curl http://nodejs.org/dist/$@.tar.gz | tar zx
+src/node-%: src/node-%.tar.gz
+ cd src && tar xf node-$*.tar.gz
+
+.PRECIOUS: src/node-%.tar.gz
+src/node-%.tar.gz: /usr/bin/curl src
+ { curl -o $@ http://nodejs.org/dist/node-$*.tar.gz && gzip -t $@; } || \
+ { curl -o $@ http://nodejs.org/dist/$*/node-$*.tar.gz && gzip -t $@; }
/usr/bin/curl:
apt-get install --yes curl
+
+src:
+ mkdir -v -p $@