Added option to include NTFS support module.
[tomato.git] / release / src / router / www / Makefile
blobb4d3613c2cfb8b8a6ec51339697be2bb0c1370a0
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 -> 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,<!-- / / / -->,," \
32 -e "/^$$/d" \
33 -e "/^<!--$$/,/^-->$$/! { s,^\s\+, , }" $$F > $(INSTALLDIR)/www/$$F; \
34 done
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"
39 endif
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"
44 endif
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"
49 endif
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"
58 endif
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"
62 endif
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/*