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,<link[^>]\+href='color\.css'>,<% css(); %>," \
31 -e
"s,color\.css,<% nv('web_css'); %>\.css," \
32 -e
"s,<!-- / / / -->,," \
36 -e
"/^<!--$$/,/^-->$$/! { s,^\s\+, , }" $$F > $(INSTALLDIR
)/www
/$$F; \
38 # Only include the FTP pages if FTP Server is configured in.
39 ifneq ($(TCONFIG_FTP
),y
)
40 rm -f
$(INSTALLDIR
)/www
/nas-ftp.asp
41 sed
-i
$(INSTALLDIR
)/www
/tomato.js
-e
"/FTP-BEGIN/,/FTP-END/d"
43 # Only include the Samba pages if Samba is configured in.
44 ifneq ($(TCONFIG_SAMBASRV
),y
)
45 rm -f
$(INSTALLDIR
)/www
/nas-samba.asp
46 sed
-i
$(INSTALLDIR
)/www
/tomato.js
-e
"/SAMBA-BEGIN/,/SAMBA-END/d"
48 # Only include the CIFS pages if CIFS is configured in.
49 ifneq ($(TCONFIG_CIFS
),y
)
50 rm -f
$(INSTALLDIR
)/www
/admin-cifs.asp
51 sed
-i
$(INSTALLDIR
)/www
/tomato.js
-e
"/CIFS-BEGIN/,/CIFS-END/d"
53 # Only include the Zebra options if Zebra is configured in.
54 ifneq ($(TCONFIG_ZEBRA
),y
)
55 sed
-i
$(INSTALLDIR
)/www
/advanced-routing.asp
-e
"/ZEBRA-BEGIN/,/ZEBRA-END/d"
57 sed
-i
"/ZEBRA-BEGIN/d" $(INSTALLDIR
)/www
/advanced-routing.asp
58 sed
-i
"/ZEBRA-END/d" $(INSTALLDIR
)/www
/advanced-routing.asp
60 # Only include extra themes if USB Extras are configured in.
61 ifneq ($(TCONFIG_USB_EXTRAS
),y
)
62 rm -f
$(INSTALLDIR
)/www
/usbred.css
63 rm -f
$(INSTALLDIR
)/www
/usbblue.css
64 rm -f
$(INSTALLDIR
)/www
/tomatousb.png
65 rm -f
$(INSTALLDIR
)/www
/tomatousb_bg.png
66 sed
-i
$(INSTALLDIR
)/www
/admin-access.asp
-e
"/THEMES-BEGIN/,/THEMES-END/d"
68 sed
-i
"/THEMES-BEGIN/d" $(INSTALLDIR
)/www
/admin-access.asp
69 sed
-i
"/THEMES-END/d" $(INSTALLDIR
)/www
/admin-access.asp
70 # Only include NTFS settings if NTFS support is configured in.
71 ifneq ($(TCONFIG_NTFS
),y
)
72 sed
-i
$(INSTALLDIR
)/www
/nas-usb.asp
-e
"/NTFS-BEGIN/,/NTFS-END/d"
74 sed
-i
"/NTFS-BEGIN/d" $(INSTALLDIR
)/www
/nas-usb.asp
75 sed
-i
"/NTFS-END/d" $(INSTALLDIR
)/www
/nas-usb.asp
77 # Only include the USB and NAS pages if USB Support is configured in.
78 ifneq ($(TCONFIG_USB
),y
)
79 rm -f
$(INSTALLDIR
)/www
/nas-
*.asp
80 sed
-i
$(INSTALLDIR
)/www
/tomato.js
-e
"/USB-BEGIN/,/USB-END/d"
81 sed
-i
$(INSTALLDIR
)/www
/admin-buttons.asp
-e
"/USB-BEGIN/,/USB-END/d"
83 sed
-i
"/USB-BEGIN/d" $(INSTALLDIR
)/www
/admin-buttons.asp
84 sed
-i
"/USB-END/d" $(INSTALLDIR
)/www
/admin-buttons.asp
86 # make sure old and debugging crap is gone
87 @
rm -f
$(INSTALLDIR
)/www
/debug.js
88 @
rm -f
$(INSTALLDIR
)/www
/*-x.
*
89 @
rm -f
$(INSTALLDIR
)/www
/*-old.
*
90 @
rm -f
$(INSTALLDIR
)/www
/color.css
92 chmod
0644 $(INSTALLDIR
)/www
/*
94 # remove C-style comments from java files. All "control" comments have been processed by now.
95 for F in
$(wildcard *.js
*.jsx
); do \
96 $(TOP
)/www
/remcoms2.sh
$(INSTALLDIR
)/www
/$$F c
; \