UNPKG

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