forked from enjalot/tributary
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
92 lines (76 loc) · 2.26 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
# 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
BROWSERIFY = $(NODE_PATH)/.bin/browserify
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 \
tributary-ui.js \
tributary-ui.min.js \
tributary-screenshot.js \
tributary-screenshot.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/main.js \
src/context.js \
src/editor.js \
src/gist.js \
src/batch.js \
src/parser.js \
src/plugin.js \
src/end.js
UI = \
src/ui/start.js \
src/ui/ui.js \
src/ui/files.js \
src/ui/end.js
SCREENSHOT = \
static/plugins/screenshots/lib/rgbcolor.js \
static/plugins/screenshots/lib/StackBlur.js \
static/plugins/screenshots/lib/canvg.js \
static/plugins/screenshots/lib/html2canvas.js
#THIRD_PARTY = \
#static/lib/three.min.js \
#static/lib/Stats.js
#static/lib/jsonlint.js
test: all
@$(JS_TESTER)
%.min.js: %.js Makefile
@rm -f static/$@
#$(JS_COMPILER) < static/$< > static/$@
#browserify -x $(THIRD_PARTY) static/tributary.js -o static/tributary.min.js
$(BROWSERIFY) static/$< -o static/$@
tributary.js: Makefile
@rm -f static/$@
cat $(filter %.js,$^) | $(JS_BEAUTIFIER) > static/$@
@chmod a-w static/$@
tributary-ui.js: Makefile
@rm -f static/$@
cat $(UI) | $(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
$(LESS_COMPILER) static/css/index.less > static/css/index.css
tributary-screenshot.js: Makefile
@rm -f static/$@
cat $(SCREENSHOT) | $(JS_BEAUTIFIER) > static/$@
@chmod a-w static/$@
clean:
rm -f static/tributary*.js