2013-03-06 17:57:12 +00:00
|
|
|
.PHONY: app libs test
|
2013-03-05 23:25:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
app_sources:= $(wildcard src/*/*.coffee)
|
|
|
|
app_objects:= $(subst src/, app/, $(app_sources:%.coffee=%.js))
|
|
|
|
|
|
|
|
libs= $(shell cd src && find . -type f -name '*.js')
|
|
|
|
|
|
|
|
home_sources = src/index.haml
|
|
|
|
home_objects = app/index.html
|
|
|
|
|
|
|
|
default: build
|
|
|
|
|
|
|
|
build: app bootstrap $(app_objects) $(home_objects) libs
|
|
|
|
|
|
|
|
app:
|
|
|
|
mkdir -p $@
|
|
|
|
|
|
|
|
$(app_objects): app/%.js: src/%.coffee
|
|
|
|
coffee -o $(@D) -c $<
|
|
|
|
|
|
|
|
libs:
|
|
|
|
cd src && tar cf - $(libs) | ( cd ../app; tar xvf - )
|
|
|
|
|
|
|
|
$(home_objects): app/%.html: src/%.haml
|
|
|
|
haml --unix-newlines --no-escape-attrs --double-quote-attributes $< > $@
|
|
|
|
|
|
|
|
bootstrap: app
|
|
|
|
cp bootstrap-extras/variables.less vendor/bootstrap/less
|
|
|
|
cd vendor/bootstrap && make build
|
|
|
|
cd vendor/bootstrap/bootstrap && tar cf - .| (cd ../../../app && tar xvf - )
|
|
|
|
|
2013-03-06 17:57:12 +00:00
|
|
|
test: test/[0-9]*_mocha.coffee
|
|
|
|
./node_modules/.bin/mocha -C --compilers coffee:coffee-script -u tdd $<
|
|
|
|
|
2013-03-05 23:25:53 +00:00
|
|
|
clean:
|
|
|
|
rm -fr app
|
2013-03-06 17:57:12 +00:00
|
|
|
cd vendor/bootstrap && git reset --hard HEAD
|