-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (47 loc) · 1.46 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
TEST_DIR = test
LIB_SOURCES = $(wildcard *.coffee)
LIB_TARGETS = $(LIB_SOURCES:.coffee=.js)
TEST_SOURCES_COFFEE = $(wildcard $(TEST_DIR)/*.coffee)
TEST_TARGETS_JS = $(TEST_SOURCES_COFFEE:.coffee=.js)
TEST_SOURCES_JADE = $(wildcard $(TEST_DIR)/*.jade)
TEST_TARGETS_HTML = $(TEST_SOURCES_JADE:.jade=.html)
COFFEE := node_modules/.bin/coffee
ifeq ($(OS), Windows_NT)
COFFEE := $(subst /,\,$(COFFEE))
endif
MOCHA := node_modules/.bin/mocha
ifeq ($(OS), Windows_NT)
MOCHA := $(subst /,\,$(MOCHA))
endif
MOCHA_PHANTOMJS := node_modules/.bin/mocha-phantomjs
ifeq ($(OS), Windows_NT)
MOCHA_PHANTOMJS := $(subst /,\,$(MOCHA_PHANTOMJS))
endif
ISTANBUL := node_modules/.bin/istanbul
ifeq ($(OS), Windows_NT)
ISTANBUL := $(subst /,\,$(ISTANBUL))
endif
JADE := node_modules/.bin/jade
ifeq ($(OS), Windows_NT)
JADE := $(subst /,\,$(JADE))
endif
all: $(LIB_TARGETS)
clean :
ifeq ($(OS), Windows_NT)
rm $(subst /,\,$(LIB_TARGETS) $(TEST_TARGETS_JS) $(TEST_TARGETS_HTML))
else
rm $(LIB_TARGETS) $(TEST_TARGETS_JS) $(TEST_TARGETS_HTML)
endif
test: $(LIB_TARGETS) test_node test_browser
test_node: $(TEST_TARGETS_JS)
$(MOCHA) $(TEST_DIR)
test_browser: $(TEST_TARGETS_HTML) $(TEST_TARGETS_JS)
$(MOCHA_PHANTOMJS) -R spec $(TEST_TARGETS_HTML)
cov: $(LIB_TARGETS) $(TEST_TARGETS_JS)
$(ISTANBUL) cover node_modules/mocha/bin/_mocha
.PHONY: test doc
.SUFFIXES: .coffee .js .jade .html
.coffee.js:
$(COFFEE) -c $^
.jade.html:
$(JADE) -P $^