From d64fbe4a2b7f76825a23521d64f128a967a31ece Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingy=20d=C3=B6t=20Net?= Date: Sun, 12 Aug 2012 12:25:03 -0700 Subject: [PATCH] Makefile will replace Cakefile and Rakefile. But not yet. make test actually calls cake test right now. --- Makefile | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..41eb81572b --- /dev/null +++ b/Makefile @@ -0,0 +1,52 @@ +.PHONY: build test node clean purge help node + +ALL_LIB := $(shell find src -type d) +ALL_LIB := $(ALL_LIB:src/%=lib/coffee-script/%) + +ALL_CDENT := $(shell find src -name *.uni) +ALL_JS := $(ALL_CDENT:src/%.uni=lib/coffee-script/%.js) + +default: help + +help: + @echo '' + @echo 'Makefile targets:' + @echo '' + @echo ' make build - Compile stuff' + @echo ' make test - Run the tests' + @echo ' make install - Install into NPM' + @echo '' + @echo ' make node - Make a Node.js package' + @echo '' + @echo ' make clean - Clean up' + @echo ' make help - Get Help' + @echo '' + +build: $(ALL_LIB) $(ALL_JS) + @# make -C test $@ + +lib/coffee-script/%.js: src/%.uni + coffee --compile -p $< > $@ + +test xtest: build + cake test + # coffee -e '(require "./test/lib/Test/Harness").run()' $@ + +install: node + (cd $<; npm install) + +node: clean build + mkdir -p $@ + cp -r \ + LICENSE* \ + README* \ + lib \ + $@/ + ./bin/cdent-package-yaml-converter package.yaml > $@/package.json + +clean purge: + rm -fr node_modules lib node + @# make -C test $@ + +$(ALL_LIB): + mkdir -p $@