From 174711a0bc4da657522739a7db667df93c4a5d6f Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Mon, 16 Apr 2012 08:41:17 +0100 Subject: [PATCH] Update Makefile to auto-build *.js file before tests and such --- Makefile | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index abd581b..882a425 100644 --- a/Makefile +++ b/Makefile @@ -8,17 +8,31 @@ REPORTER = spec TEST_DIR = ./test TEST_FILES = *_test.coffee -build: - coffee -o $(TARGET) -c $(SOURCE) +build: coffee-dep + coffee -b -o $(TARGET) -c $(SOURCE) -watch: - coffee -o $(TARGET) -cw $(SOURCE) +watch: coffee-dep + coffee -b -o $(TARGET) -cw $(SOURCE) -test: +remove-js: + rm -fr lib/ + +publish: npm-dep build + npm publish + +test: build mocha --reporter $(REPORTER) \ --compilers coffee:coffee-script \ $(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: .PHONY: build watch test