Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
78 lines (62 loc) · 1.78 KB
/
Copy pathMakefile
File metadata and controls
78 lines (62 loc) · 1.78 KB
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
# See the README for installation instructions.
NODE_MODULES_PATH ?= ./node_modules
JS_COMPILER = $(NODE_MODULES_PATH)/uglify-js/bin/uglifyjs
JS_TESTER = $(NODE_MODULES_PATH)/vows/bin/vows
SOURCEDIR = ./src
BIN_PATH = ./bin
COMPILE_PATH = ./bin/compile
COVERAGE_PATH ?= ./coverage
SOURCES := $(shell find $(SOURCEDIR) -name '*.js')
all: \
# Modify this rule to build your own custom release.
.INTERMEDIATE triflow.js: \
triflow.core.js \
triflow.core.js: \
$(SOURCES)
.PHONY: test
test: Makefile
@$(JS_TESTER)
test-cover: coverage
@NODE_COVERAGE='coverage' $(JS_TESTER) --cover-html
@echo "code coverage run, see coverage.html"
style: Makefile
gjslint --jslint_error=all --nojsdoc -r src/
gjslint --jslint_error=all --nojsdoc -r test/
jshint --config=.jshintrc src
jshint --config=.jshintrc test
coverage: $(SOURCES)
@rm -r -f $(COVERAGE_PATH)
jscoverage src coverage
node_modules: package.json
mkdir -p node_modules
npm install
install: node_modules
clean:
rm -rf coverage coverage.html
build: install
mkdir -p dist/
./node_modules/gluejs/bin/gluejs \
--include ./index.js \
--include ./src \
--include ./node_modules/microee \
--command '${JS_COMPILER} --no-copyright --no-dead-code --mangle-toplevel' \
--replace underscore=window._ \
--replace fs={} \
--global triflow \
--main index.js \
--out dist/triflow.js
build-debug: install
mkdir -p dist/
./node_modules/gluejs/bin/gluejs \
--include ./index.js \
--include ./src \
--include ./node_modules/microee \
--source-url \
--replace underscore=window._ \
--replace fs={} \
--global triflow \
--main index.js \
--out dist/triflow.js
# node_modules really shouldn't be a phony target, but we're making it one so
# that gluejs installs properly.
.PHONY: test build build-debug install node_modules