2013-06-07 23:11:43 +00:00
|
|
|
.PHONY: lib test library docs
|
2013-03-05 23:25:53 +00:00
|
|
|
|
2013-06-07 23:11:43 +00:00
|
|
|
COFFEE= ./node_modules/.bin/coffee
|
|
|
|
PEGJS= ./node_modules/.bin/pegjs
|
|
|
|
DOCCO= ./node_modules/.bin/docco
|
|
|
|
MOCHA= ./node_modules/.bin/mocha
|
|
|
|
|
|
|
|
cof_sources:= $(wildcard src/*.coffee)
|
|
|
|
cof_objects:= $(subst src/, lib/, $(cof_sources:%.coffee=%.js))
|
|
|
|
|
|
|
|
peg_sources:= $(wildcard src/*.peg)
|
|
|
|
peg_objects:= $(subst src/, lib/, $(peg_sources:%.peg=%.js))
|
|
|
|
|
|
|
|
library: $(cof_objects) $(peg_objects)
|
2013-03-05 23:25:53 +00:00
|
|
|
|
|
|
|
default: build
|
|
|
|
|
2013-06-07 23:11:43 +00:00
|
|
|
build: $(lib_objects)
|
2013-03-31 03:30:58 +00:00
|
|
|
|
2013-04-17 17:10:06 +00:00
|
|
|
lib:
|
|
|
|
mkdir -p lib
|
2013-03-05 23:25:53 +00:00
|
|
|
|
2013-06-07 23:11:43 +00:00
|
|
|
$(cof_objects): $(cof_sources)
|
|
|
|
@mkdir -p $(@D)
|
2013-06-10 22:54:42 +00:00
|
|
|
$(foreach source, $(cof_sources), $(COFFEE) -o $(@D) -c $(source); )
|
2013-04-17 17:10:06 +00:00
|
|
|
|
2013-06-07 23:11:43 +00:00
|
|
|
$(peg_objects): $(peg_sources)
|
2013-03-06 18:56:04 +00:00
|
|
|
@mkdir -p $(@D)
|
2013-06-07 23:11:43 +00:00
|
|
|
$(PEGJS) $< $@
|
|
|
|
|
|
|
|
docs:
|
|
|
|
$(DOCCO) $(cof_sources)
|
|
|
|
|
|
|
|
echo:
|
|
|
|
echo $(cof_sources)
|
|
|
|
echo $(cof_objects)
|
2013-03-05 23:25:53 +00:00
|
|
|
|
2013-04-27 20:53:31 +00:00
|
|
|
test: test/[0-9]*_mocha.coffee lib/tumble.js lib/parser.js
|
2013-03-31 03:45:12 +00:00
|
|
|
./node_modules/.bin/mocha -R tap -C --compilers coffee:coffee-script -u tdd $<
|
2013-03-06 17:57:12 +00:00
|
|
|
|
2013-03-31 03:30:58 +00:00
|
|
|
|
2013-03-05 23:25:53 +00:00
|
|
|
clean:
|
2013-03-06 18:56:04 +00:00
|
|
|
rm -fr lib
|