forked from enjalot/tributary
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (46 loc) · 1.36 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
# See the README for installation instructions.
NODE_PATH ?= ./node_modules
JS_COMPILER = $(NODE_PATH)/uglify-js/bin/uglifyjs
JS_BEAUTIFIER = $(NODE_PATH)/uglify-js/bin/uglifyjs -b -i 2 -nm -ns
HANDLEBARS_COMPILER = $(NODE_PATH)/handlebars/bin/handlebars
LESS_COMPILER = $(NODE_PATH)/less/bin/lessc
JS_TESTER = $(NODE_PATH)/vows/bin/vows
LOCALE ?= en_US
all: \
tributary.js \
tributary.min.js \
handlebars \
less
# Modify this rule to build your own custom release.
.INTERMEDIATE tributary.js: \
src/start.js \
src/core.js \
src/util.js \
src/code.js \
src/config.js \
src/context.js \
src/editor.js \
src/gist.js \
src/files.js \
src/controls.js \
src/batch.js \
src/ui.js \
src/end.js
test: all
@$(JS_TESTER)
%.min.js: %.js Makefile
@rm -f static/$@
$(JS_COMPILER) < static/$< > static/$@
tributary.js: Makefile
@rm -f static/$@
cat $(filter %.js,$^) | $(JS_BEAUTIFIER) > static/$@
@chmod a-w static/$@
handlebars: Makefile
$(HANDLEBARS_COMPILER) static/templates/* > static/templates.js
$(HANDLEBARS_COMPILER) templates/*.handlebars > templates/server-templates.js
$(HANDLEBARS_COMPILER) sandbox/templates/*.handlebars > sandbox/templates/sandbox-templates.js
less: Makefile
$(LESS_COMPILER) static/css/less/style.less > static/css/style.css
$(LESS_COMPILER) static/css/less/header.less > static/css/header.css
clean:
rm -f static/tributary*.js