Tomato 1.28
[tomato.git] / release / src / router / www / Makefile
blob225e56a6142e5acd364a5857ea2081285a6004f6
2 include ../common.mak
4 all:
6 clean:
8 install:
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; \
18 done
20 for F in $(wildcard *.css); do \
21 sed '/^\/\*\s*$$/,/\*\//! { s/\s\+/ /g; s/^\s\+//; s/\s\+$$//; /^$$/d }' < $$F > $(INSTALLDIR)/www/$$F; \
22 done
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,<!-- / / / -->,," \
33 -e "/^$$/d" \
34 -e "/^<!--$$/,/^-->$$/! { s,^\s\+, , }" $$F > $(INSTALLDIR)/www/$$F; \
35 done
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; \
41 mv $$F.tmp $$F; \
42 done
43 endif
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/*