/
Makefile
227 lines (186 loc) · 6.16 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# Makefile for tootstest
#
# Targets:
#
# deps — install prerequisites needed from the build-deps file
#
# bin — compile the deployment files (CGI script, compiled JS/CSS, &c)
#
# doc — extract and build documentation in various formats
#
# doc-publish — push docs to Goethe
#
# test — run automated unit tests
#
# ui-test — run Selenium-based unit tests
#
# deploy — send code to production server, compile and test
#
all: bin doc
clean:
-$(MAKE) -C src/lib/jscl clean
-rm -f tootstest.cgi tootstest.cgi.new \
js/*.js css/*.css \
static/js/*.js static/js/*.map static/css/*.css \
doc/* bin/buildapp
find . -name \*.fasl -exec rm {} \;
git gc --auto
git submodule foreach git gc --auto
deps: .deps-installed~ ~/quicklisp/setup.lisp
~/quicklisp/setup.lisp: .quicklisp-signing-key.txt bin/sbcl
gpg --import .quicklisp-signing-key.txt
curl -L https://beta.quicklisp.org/quicklisp.lisp > quicklisp.lisp
curl -L https://beta.quicklisp.org/quicklisp.lisp.asc > quicklisp.lisp.asc
gpg --verify quicklisp.lisp.asc quicklisp.lisp
bin/sbcl --non-interactive \
--load quicklisp.lisp \
--eval '(quicklisp-quickstart:install)'
TAGS: $(shell find . -name \*.lisp)
ctags --languages=lisp -e -R -f TAGS
.deps-installed~: build-deps bin/do-install-deps
bin/do-install-deps
>> ~/.sbclrc
>.deps-installed~
deploy: bin test
./server-push
# TODO: fix version labels, filenames magically
doc-publish: doc
rsync -rv -essh doc/* goethe.tootsville.adventuring.click:goethe.tootsville.adventuring.click/devel/docs/tootstest/0.2/
bin: tootstest.cgi \
static/js/jscl.js \
static/js/mesh.js \
static/js/lisp.js \
static/js/social.js \
static/css/main.css static/css/doc.css
bin/sbcl:
bin/ensure-sane-sbcl
bin/buildapp: bin/sbcl
if which buildapp; \
then \
ln -s $$(which buildapp) -f bin/buildapp; \
else \
bin/sbcl --non-interactive \
--load ~/quicklisp/setup.lisp \
--eval '(ql:quickload :buildapp)' \
--eval '(buildapp:build-buildapp "bin/buildapp")'; \
fi
tootstest.cgi: tootstest.cgi.new
./tootstest.cgi.new check
mv --backup=t tootstest.cgi.new tootstest.cgi
tootstest.cgi.new: tootstest.asd bin/buildapp \
$(shell find . -name \*.lisp \
-and -not -path \**/.\* \
-and -not -path src/mesh/\**)
bin/buildapp --output tootstest.cgi.new \
--load ~/quicklisp/setup.lisp \
--asdf-path . \
--load "src/setup.lisp" \
--eval '(ql:quickload :tootstest)' \
--load-system tootstest \
--entry tootstest:entry
src/lib/jscl/jscl.js: $(shell find src/lib/jscl -name \*.lisp \
-and -not -name .\*) \
src/lib/jscl/src/prelude.js \
bin/sbcl
# ensure our SBCL is on PATH
if [ -d ~/.local/bin ] && ! [ -x ~/.local/bin/sbcl ] ; \
then \
ln -sf bin/sbcl -f ~/.local/bin/ ; \
fi
if [ -d ~/bin ] && ! [ -x ~/bin/sbcl ] ; \
then \
ln -sf bin/sbcl ~/bin/ ; \
fi
$(MAKE) -C src/lib/jscl || ( cd src/lib/jscl ; ./make.sh )
# required to make Closure happy
js/undef-require.js:
echo 'var require=undefined;' >> $@
js/mesh.cc.js: js/mesh.js js/undef-require.js src/lib/jscl/jscl.js
closure-compiler --compilation_level SIMPLE_OPTIMIZATIONS \
--create_source_map static/js/mesh.cc.js.map \
--third_party true \
--js_output_file $@ \
--js js/undef-require.js \
--js src/lib/jscl/jscl.js \
--js js/mesh.js
js/mesh.yug.js: js/mesh.js src/lib/jscl/jscl.js
uglifyjs src/lib/jscl/jscl.js js/mesh.js \
--source-map static/$@.map \
--screw-ie8 \
-o js/mesh.yug.js \
-m -c
js/%.yug.js: src/js/%.js
uglifyjs $< \
--source-map static/$@.map \
--screw-ie8 \
-o $@ \
-m -c
js/%.cc.js: src/js/%.js
closure-compiler --compilation_level SIMPLE_OPTIMIZATIONS \
--create_source_map static/$@.map \
--third_party true \
--js_output_file $@ \
--js $<
js/jscl.yug.js: src/lib/jscl/jscl.js
uglifyjs $< \
--source-map static/$@.map \
--screw-ie8 \
-o $@ \
-m -c
js/jscl.cc.js: src/lib/jscl/jscl.js
closure-compiler --compilation_level SIMPLE_OPTIMIZATIONS \
--create_source_map static/$@.map \
--third_party true \
--js_output_file $@ \
--js $<
static/js/%.js: js/%.cc.js js/%.yug.js
echo "Comparing smaller JS isn't working, just using Closure version for now"
cp $< $@
static/css/%.css: src/css/%.less $(shell echo src/css/*.less)
lessc $< | cleancss --skip-import -o $@
js/mesh.js: src/lib/jscl/jscl.js src/bootstrap-tootstest.lisp \
$(find src/mesh -name \*.lisp -and -not -path \**/.\*) \
bin/sbcl
mkdir -p js
( cd src/lib/jscl ; \
bin/sbcl --non-interactive \
--load jscl.lisp \
--load ../../../src/bootstrap-tootstest.lisp \
--eval '(jscl::bootstrap-mesh)' --eval '(quit)' ) || \
( echo " MESH not building (no surprises there) FIXME " ; \
> js/mesh.js )
test: bin
./tootstest.cgi test
$(MAKE) -C src/lib/jscl test || (cd src/lib/jscl && ./run-tests.sh)
doc/violet-volts.pdf: doc/violet-volts.texi
doc/violet-volts.html.tar.gz: doc/violet-volts.html.tar
gzip -9 -c < $< > $@
doc/violet-volts.html.tar.z: doc/violet-volts.html.tar
compress -9 -c < $< > $@
doc/violet-volts.html.tar.bz2: doc/violet-volts.html.tar
bzip2 -9 -c < $< > $@
doc/violet-volts.html.tar.xz: doc/violet-volts.html.tar
xz -9 -c < $< > $@
doc/violet-volts.html.tar: doc/violet-volts.html.d/violet-volts.html \
doc/violet-volts.texi
cd doc; tar cf violet-volts.html.tar violet-volts.html.d
doc/violet-volts.html.zip: doc/violet-volts.html.d/violet-volts.html \
doc/violet-volts.texi
cd doc; zip -9 violet-volts.html.zip violet-volts.html.d
doc/violet-volts.html.d/violet-volts.html: doc/violet-volts.texi
cd doc; makeinfo -o violet-volts.html.d/ \
--html --css-include=src/static/css/doc.css \
--split=node violet-volts.texi
doc/violet-volts.ps: doc/violet-volts.texi
cd doc; makeinfo --ps -o violet-volts.ps violet-volts.texi
doc/violet-volts.pdf: doc/violet-volts.texi
cd doc; makeinfo --pdf -o violet-volts.pdf violet-volts.texi
doc/violet-volts.txt: doc/violet-volts.texi
cd doc; makeinfo --plaintext -o violet-volts.txt violet-volts.texi
doc/violet-volts.info: doc/violet-volts.texi
cd doc; makeinfo -o violet-volts.info violet-volts.texi
doc: doc/violet-volts.pdf doc/violet-volts.info doc/violet-volts.txt \
doc/violet-volts.html.tar.gz
doc/violet-volts.texi: tootstest.cgi
./tootstest.cgi write-docs
ln doc/tootstest.texi doc/violet-volts.texi