forked from auser/codemirror-interactive-numbers
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
48 lines (32 loc) · 1.22 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
NPM_EXECUTABLE_HOME := node_modules/.bin
PATH := ${NPM_EXECUTABLE_HOME}:${PATH}
SRC_FILES := $(shell find coffee/src -name '*.coffee' | sed -e :a -e '$$!N;s/\n/ /;ta')
TEST_FILES := $(shell find coffee/test -name '*.test.*' | sed -e :a -e '$$!N;s/\n/ /;ta')
JS_SRC_FILES := $(shell find js/src -name '*.js' | sed -e :a -e '$$!N;s/\n/ /;ta')
JS_TEST_FILES := $(shell find js/test -name '*.test.*' | sed -e :a -e '$$!N;s/\n/ /;ta')
.PHONY: test test-js install watch js watch-js loc test-loc clean tree develop server workers run
test:
./node_modules/.bin/mocha --compilers coffee:coffee-script $(TEST_FILES)
watchtest:
./node_modules/.bin/mocha --watch --compilers coffee:coffee-script $(TEST_FILES)
install:
npm install -d
watch:
./node_modules/.bin/supervisor --watch coffee/ --extensions 'coffee|js' --exec 'make' --no-restart-on exit build
js: clean
coffee -c -o ./js ./coffee
watch-js: clean
coffee -wc -o ./js ./coffee
loc:
cat $(SRC_FILES) | grep -v -E '^( *#|\s*$$)' | wc -l | tr -s ' '
# calculate lines of code
test-loc:
cat $(TEST_FILES) | grep -v -E '^( *#|\s*$$)' | wc -l | tr -s ' '
clean:
@rm -fr js/
tree:
tree -I node_modules
browserify:
npm run-script build
build: js browserify
.PHONY: test build