1 | M4 := m4
|
2 | COFFEE := node_modules/.bin/coffee
|
3 | MOCHA := node_modules/.bin/mocha
|
4 | OPTS :=
|
5 |
|
6 | out := lib
|
7 | js_temp := $(patsubst %.coffee,$(out)/%.js,$(wildcard *.coffee))
|
8 |
|
9 | .PHONY: clobber clean compile
|
10 |
|
11 | all: test
|
12 |
|
13 | node_modules: package.json
|
14 | npm install
|
15 | touch $@
|
16 |
|
17 | test: compile
|
18 | $(MAKE) -C test/data compile
|
19 | $(MOCHA) --compilers coffee:coffee-script/register -u tdd test $(OPTS)
|
20 |
|
21 | lib/%.js: %.coffee
|
22 | $(COFFEE) -o $(out) -c $<
|
23 |
|
24 | README.html: README.md
|
25 | pandoc $< -o $@
|
26 |
|
27 | README.md: README.m4.md
|
28 | cd test/data/src ; \
|
29 | $(MAKE) clean; \
|
30 | $(M4) ../../../$< > ../../../$@
|
31 |
|
32 | compile: node_modules $(js_temp) README.md
|
33 |
|
34 | clean:
|
35 | $(MAKE) -C test/data clean
|
36 | # we include generated js with the npm package
|
37 | # rm $(js_temp)
|
38 |
|
39 | clobber: clean
|
40 | rm -rf node_modules
|
41 |
|
42 | # Debug. Use 'gmake p-obj' to print $(obj) variable.
|
43 | p-%:
|
44 | @echo $* = $($*)
|
45 | @echo $*\'s origin is $(origin $*)
|