Update Makefile to auto-build *.js file before tests and such

This commit is contained in:
2012-04-16 08:41:17 +01:00
parent 450212f4b2
commit 174711a0bc

View File

@@ -8,17 +8,31 @@ REPORTER = spec
TEST_DIR = ./test TEST_DIR = ./test
TEST_FILES = *_test.coffee TEST_FILES = *_test.coffee
build: build: coffee-dep
coffee -o $(TARGET) -c $(SOURCE) coffee -b -o $(TARGET) -c $(SOURCE)
watch: watch: coffee-dep
coffee -o $(TARGET) -cw $(SOURCE) coffee -b -o $(TARGET) -cw $(SOURCE)
test: remove-js:
rm -fr lib/
publish: npm-dep build
npm publish
test: build
mocha --reporter $(REPORTER) \ mocha --reporter $(REPORTER) \
--compilers coffee:coffee-script \ --compilers coffee:coffee-script \
$(shell find $(TEST_DIR) -name $(TEST_FILES)) $(shell find $(TEST_DIR) -name $(TEST_FILES))
npm-dep:
test `which npm` || echo 'You need npm to do npm install... makes sense?'
coffee-dep:
test `which coffee` || echo 'You need to have CoffeeScript in your' \
'PATH.\nPlease install it using `brew install coffee-script` or' \
'`npm install coffee-script`.'
.SILENT: .SILENT:
.PHONY: build watch test .PHONY: build watch test