-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
104 lines (81 loc) · 2.39 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#
# File: makefile
# Author: Juan Pedro Bolívar Puente <[email protected]>
#
NODE_BIN = node_modules/.bin
NODEJS = node
NPM = npm
COFFEE = $(NODE_BIN)/coffee
DOCCO = $(NODE_BIN)/docco
MOCHA = $(NODE_BIN)/mocha
MOCHA_PHANTOM = $(NODE_BIN)/mocha-phantomjs
ISTANBUL = $(NODE_BIN)/istanbul
COFFEELINT = $(NODE_BIN)/coffeelint
PHANTOM_JS = `which phantomjs`
SCRIPTS = \
lib/heterarchy.js \
DOCS = \
doc/index.html \
doc/heterarchy.html \
doc/test/heterarchy.spec.html
all: $(SCRIPTS)
framework: $(FRAMEWORK)
doc: $(DOCS)
cp -r ./pic ./doc/
.SECONDARY:
.PHONY: test
lib/%.js: %.litcoffee
@mkdir -p $(@D)
$(COFFEE) --compile --print $< > $@
lib/%.js: %.coffee
@mkdir -p $(@D)
$(COFFEE) --compile --print $< > $@
lib/%.js: %.js
@mkdir -p $(@D)
cp -f $< $@
doc/index.html: README.md
@mkdir -p $(@D)
$(DOCCO) -t docco/docco.jst -c docco/docco.css -o $(@D) $<
mv $(@D)/README.html $@
cp -rf docco/public $(@D)
doc/%.html: %.litcoffee
@mkdir -p $(@D)
$(DOCCO) -t docco/docco.jst -c docco/docco.css -o $(@D) $<
cp -rf docco/public $(@D)
doc/%.html: %.coffee
@mkdir -p $(@D)
$(DOCCO) -t docco/docco.jst -c docco/docco.css -o $(@D) $<
cp -rf docco/public $(@D)
doc/%.html: %.js
@mkdir -p $(@D)
$(DOCCO) -t docco/docco.jst -c docco/docco.css -o $(@D) $<
cp -rf docco/public $(@D)
clean:
rm -rf ./doc
rm -rf ./lib
find . -name "*~" -exec rm -f {} \;
install:
$(NPM) install
test: all
$(MOCHA) --compilers coffee:coffee-script/register `find test -name *.coffee`
@$(COFFEE) --compile test/heterarchy.spec.coffee
@# if phantomjs is actually installed (not just as a node module) use that
@# because there is a bug on macOS with the node module
@if [[ $(PHANTOM_JS) = "" ]]; then \
echo "$(MOCHA_PHANTOM) test/heterarchy.browser.html"; \
$(MOCHA_PHANTOM) test/heterarchy.browser.html; \
else \
echo "$(MOCHA_PHANTOM) -p $(PHANTOM_JS) test/heterarchy.browser.html"; \
$(MOCHA_PHANTOM) -p $(PHANTOM_JS) test/heterarchy.browser.html; \
fi
lint:
$(COFFEELINT) --literate heterarchy.litcoffee
$(COFFEELINT) test/heterarchy.spec.coffee
test-coverage: all
$(MOCHA) --compilers coffee:coffee-script/register \
--require coffee-coverage/register-istanbul \
`find test -name *.coffee`
$(ISTANBUL) report text lcov
travis: lint test-coverage
upload-doc: doc
ncftpput -R -m -u u48595320 sinusoid.es /heterarchy doc/*