diff options
author | tv <tv@xso> | 2011-08-13 14:29:23 +0200 |
---|---|---|
committer | tv <tv@xso> | 2011-08-13 14:29:23 +0200 |
commit | df6c500d626358f6f7d6fa231ec21b85b0a42319 (patch) | |
tree | 1b1aa759d337d5200f4e046f94d0d98e1e8bffad /node/Makefile | |
parent | 994d24e5614e5c5dac16cd9b9cc6c2f5a7206321 (diff) |
node: do the right thing when make [install]
Diffstat (limited to 'node/Makefile')
-rw-r--r-- | node/Makefile | 42 |
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 $@ |