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 -> nv().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,color\.css,<% nv('web_css'); %>\.css," \
31 -e
"s,<!-- / / / -->,," \
33 -e
"/^<!--$$/,/^-->$$/! { s,^\s\+, , }" $$F > $(INSTALLDIR
)/www
/$$F; \
35 # Only include the FTP pages if FTP Server is configured in.
36 ifneq ($(TCONFIG_FTP
),y
)
37 rm -f
$(INSTALLDIR
)/www
/nas-ftp.asp
38 sed
-i
$(INSTALLDIR
)/www
/tomato.js
-e
"/FTP-BEGIN/,/FTP-END/d"
40 # Only include the Samba pages if Samba is configured in.
41 ifneq ($(TCONFIG_SAMBASRV
),y
)
42 rm -f
$(INSTALLDIR
)/www
/nas-samba.asp
43 sed
-i
$(INSTALLDIR
)/www
/tomato.js
-e
"/SAMBA-BEGIN/,/SAMBA-END/d"
45 # Only include the CIFS pages if CIFS is configured in.
46 ifneq ($(TCONFIG_CIFS
),y
)
47 rm -f
$(INSTALLDIR
)/www
/admin-cifs.asp
48 sed
-i
$(INSTALLDIR
)/www
/tomato.js
-e
"/CIFS-BEGIN/,/CIFS-END/d"
51 # Only include extra themes if USB Extras are configured in.
52 ifneq ($(TCONFIG_USB_EXTRAS
),y
)
53 rm -f
$(INSTALLDIR
)/www
/usbred.css
54 rm -f
$(INSTALLDIR
)/www
/usbblue.css
55 rm -f
$(INSTALLDIR
)/www
/tomatousb.png
56 rm -f
$(INSTALLDIR
)/www
/tomatousb_bg.png
57 sed
-i
$(INSTALLDIR
)/www
/admin-access.asp
-e
"/THEMES-BEGIN/,/THEMES-END/d"
59 # Only include NTFS settings if NTFS support is configured in.
60 ifneq ($(TCONFIG_NTFS
),y
)
61 sed
-i
$(INSTALLDIR
)/www
/nas-usb.asp
-e
"/NTFS-BEGIN/,/NTFS-END/d"
64 # make sure old and debugging crap is gone
65 @
rm -f
$(INSTALLDIR
)/www
/debug.js
66 @
rm -f
$(INSTALLDIR
)/www
/*-x.
*
67 @
rm -f
$(INSTALLDIR
)/www
/*-old.
*
68 @
rm -f
$(INSTALLDIR
)/www
/color.css
70 chmod
0644 $(INSTALLDIR
)/www
/*