forked from hanshoglund/animator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·127 lines (102 loc) · 2.85 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
JSPP = cpp -P -CC
JSLINT = build/jslint.sh
JSMIN = jsmin
JSOPT = googleclosure \
--language_in ECMASCRIPT5 \
--compilation_level SIMPLE_OPTIMIZATIONS
JSINSTALL = haste-inst --disable-library-profiling install
JSC = hastec \
-O2 \
--debug \
--out=main.js \
--with-js=src-js/animator.jspp,lib/processing/processing.js,lib/jquery/jquery.js
JSC_RELEASE = hastec \
-O2 \
--out=main.js \
--with-js=src-js/animator.jspp,lib/processing/processing.js,lib/jquery/jquery.js
CLOSURE = googleclosure
BROWSER = Google Chrome
# FLAGS = -DENABLE_TYPE_CHECKS=1
MAIN = sketch
PAPERJS_URL = http://paperjs.org/downloads/paperjs-nightly.zip
PROCESSING_URL = http://cloud.github.com/downloads/processing-js/processing-js/processing-1.4.1-api.min.js
DOMREADY_URL = http://domready.googlecode.com/files/domready.js
JQUERY_URL = http://code.jquery.com/jquery-1.8.2.min.js
JSLINT_URL = https://raw.github.com/douglascrockford/JSLint/master/jslint.js
all: debug
debug: post reload
release: post minify reload
install-deps:
$(JSINSTALL) containers semigroups colour vector-space
jspp:
$(JSPP) $(FLAGS) src-js/animator.js src-js/animator.jspp;
jslint: jspp
$(JSLINT) src-js/animator.jspp;
build: jslint
$(JSC) `find src -d -name "*.hs"` $(MAIN).hs && \
perl -pi -e 's/window.onload = (function.*);/jQuery(document).ready($$1);/g' main.js;
post: build
rm -f `find . -d -name "*.jspp"`
rm -f `find . -d -name "*.core*"`
rm -f `find . -d -name "*.hi*"`
rm -f `find . -d -name "*.mjs*"`
rm -f `find . -d -name "*.clo*"`
rm -f `find . -d -name "*.jsmod*"`
rm -f `find . -d -name "*.o*"`
rm -rf Animator
rm -rf Foreign
rm -rf Web
optimize:
$(JSOPT) <$(MAIN).js >$(MAIN).jsopt && \
rm $(MAIN).js && \
mv $(MAIN).jsopt $(MAIN).js;
minify:
$(JSMIN) <$(MAIN).js >$(MAIN).jsmin && \
rm $(MAIN).js && \
mv $(MAIN).jsmin $(MAIN).js;
reload:
sh build/reload.sh $(BROWSER)
clean:
rm main.js
haddock:
cabal haddock --hyperlink-source
server-start:
(python -m SimpleHTTPServer 5566 &) > /dev/null 2>&1
server-stop:
killall python
update-lib: update-paperjs update-processing update-domready update-jquery update-jslint
update-paperjs:
rm -rf lib/paperjs; \
mkdir -p lib/paperjs; \
cd lib; \
curl $(PAPERJS_URL) > paperjs.zip; \
cd paperjs; \
unzip ../paperjs.zip; \
cd ..; \
rm -f paperjs.zip; \
cd ..;
update-processing:
rm -rf lib/processing; \
mkdir -p lib/processing; \
cd lib/processing; \
curl $(PROCESSING_URL) > processing.js; \
cd ..;
update-domready:
rm -rf lib/domready; \
mkdir -p lib/domready; \
cd lib/domready; \
curl $(DOMREADY_URL) > domready.js; \
cd ..;
update-jquery:
rm -rf lib/jquery; \
mkdir -p lib/jquery; \
cd lib/jquery; \
curl $(JQUERY_URL) > jquery.js; \
cd ..;
update-jslint:
rm -rf lib/jslint; \
mkdir -p lib/jslint; \
cd lib/jslint; \
curl $(JSLINT_URL) > jslint.js; \
cd ..;
.PHONY: build