9 rm -rf
$(INSTALLDIR
)/www
10 mkdir
-p
$(INSTALLDIR
)/www
12 cp
*.gif
*.png
*.ico robots.txt
$(INSTALLDIR
)/www
14 # squish some of the files by trimming whitespace...
16 for F in
$(wildcard *.js
*.jsx
); do \
17 sed
'/^\/\*\s*$$/,/\*\//! { s/^\s\+//; s/\s\+$$//; /^\/\/ --\+\s*/d; /^$$/d }' < $$F > $(INSTALLDIR
)/www
/$$F; \
20 for F in
$(wildcard *.css
); do \
21 sed
'/^\/\*\s*$$/,/\*\//! { s/\s\+/ /g; s/^\s\+//; s/\s\+$$//; /^$$/d }' < $$F > $(INSTALLDIR
)/www
/$$F; \
24 # remove "debug.js" references, convert color.css, remove comments
25 # in between REMOVE-BEGIN and REMOVE-END, and compress whitespace
27 for F in
$(wildcard *.asp
*.svg
); do \
28 sed
-e
"/REMOVE-BEGIN/,/REMOVE-END/d" \
29 -e
"s,<script[^>]\+debug\.js[^>]\+></script>,," \
30 -e
"s,<link[^>]\+href='color\.css'>,<% css(); %>," \
31 -e
"s,color\.css,<% nv('web_css'); %>\.css," \
32 -e
"s,<!-- / / / -->,," \
34 -e
"/^<!--$$/,/^-->$$/! { s,^\s\+, , }" $$F > $(INSTALLDIR
)/www
/$$F; \
37 ifeq ($(TOMATO_EXPERIMENTAL
),1)
38 cd
$(INSTALLDIR
)/www
&& \
39 for F in
$(wildcard *.asp
); do \
40 sed
-e
"s,<div class='title'>Tomato</div>,<div class='title'>Tomato <small><i>(beta)</i></small></div>," $$F > $$F.tmp
; \
47 # make sure old and debugging crap is gone
48 @
rm -f
$(INSTALLDIR
)/www
/debug.js
49 @
rm -f
$(INSTALLDIR
)/www
/*-x.
*
50 @
rm -f
$(INSTALLDIR
)/www
/*-old.
*
51 @
rm -f
$(INSTALLDIR
)/www
/color.css
53 chmod
0644 $(INSTALLDIR
)/www
/*