Samba: extra codepages
[tomato.git] / release / src / router / www / Makefile
blob82db2d4dd145b4b07202594dd37a76d82745d5d6
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 # Only include Linux 2.6 options if building for Linux 2.6.
38 ifneq ($(CONFIG_LINUX26),y)
39 sed -i $(INSTALLDIR)/www/nas-samba.asp -e "/LINUX26-BEGIN/,/LINUX26-END/d"
40 endif
41 sed -i "/LINUX26-BEGIN/d" $(INSTALLDIR)/www/nas-samba.asp
42 sed -i "/LINUX26-END/d" $(INSTALLDIR)/www/nas-samba.asp
44 # Only include the FTP pages if FTP Server is configured in.
45 ifneq ($(TCONFIG_FTP),y)
46 rm -f $(INSTALLDIR)/www/nas-ftp.asp
47 sed -i $(INSTALLDIR)/www/tomato.js -e "/FTP-BEGIN/,/FTP-END/d"
48 endif
49 # Only include the Samba pages if Samba is configured in.
50 ifneq ($(TCONFIG_SAMBASRV),y)
51 rm -f $(INSTALLDIR)/www/nas-samba.asp
52 sed -i $(INSTALLDIR)/www/tomato.js -e "/SAMBA-BEGIN/,/SAMBA-END/d"
53 endif
54 # Only include the CIFS pages if CIFS is configured in.
55 ifneq ($(TCONFIG_CIFS),y)
56 rm -f $(INSTALLDIR)/www/admin-cifs.asp
57 sed -i $(INSTALLDIR)/www/tomato.js -e "/CIFS-BEGIN/,/CIFS-END/d"
58 endif
59 # Only include the JFFS pages if JFFS is configured in.
60 ifneq ($(TCONFIG_JFFS2),y)
61 rm -f $(INSTALLDIR)/www/admin-jffs2.asp
62 sed -i $(INSTALLDIR)/www/tomato.js -e "/JFFS2-BEGIN/,/JFFS2-END/d"
63 endif
64 # Only include the Zebra options if Zebra is configured in.
65 ifneq ($(TCONFIG_ZEBRA),y)
66 sed -i $(INSTALLDIR)/www/advanced-routing.asp -e "/ZEBRA-BEGIN/,/ZEBRA-END/d"
67 endif
68 sed -i "/ZEBRA-BEGIN/d" $(INSTALLDIR)/www/advanced-routing.asp
69 sed -i "/ZEBRA-END/d" $(INSTALLDIR)/www/advanced-routing.asp
71 # Only include extra themes if USB Extras are configured in.
72 ifneq ($(TCONFIG_USB_EXTRAS),y)
73 rm -f $(INSTALLDIR)/www/usbred.css
74 rm -f $(INSTALLDIR)/www/usbblue.css
75 rm -f $(INSTALLDIR)/www/tomatousb.png
76 rm -f $(INSTALLDIR)/www/tomatousb_bg.png
77 sed -i $(INSTALLDIR)/www/admin-access.asp -e "/THEMES-BEGIN/,/THEMES-END/d"
78 endif
79 sed -i "/THEMES-BEGIN/d" $(INSTALLDIR)/www/admin-access.asp
80 sed -i "/THEMES-END/d" $(INSTALLDIR)/www/admin-access.asp
81 # Only include NTFS settings if NTFS support is configured in.
82 ifneq ($(TCONFIG_NTFS),y)
83 sed -i $(INSTALLDIR)/www/nas-usb.asp -e "/NTFS-BEGIN/,/NTFS-END/d"
84 endif
85 sed -i "/NTFS-BEGIN/d" $(INSTALLDIR)/www/nas-usb.asp
86 sed -i "/NTFS-END/d" $(INSTALLDIR)/www/nas-usb.asp
88 # Only include the USB and NAS pages if USB Support is configured in.
89 ifneq ($(TCONFIG_USB),y)
90 rm -f $(INSTALLDIR)/www/nas-*.asp
91 sed -i $(INSTALLDIR)/www/tomato.js -e "/USB-BEGIN/,/USB-END/d"
92 sed -i $(INSTALLDIR)/www/admin-buttons.asp -e "/USB-BEGIN/,/USB-END/d"
93 endif
94 sed -i "/USB-BEGIN/d" $(INSTALLDIR)/www/admin-buttons.asp
95 sed -i "/USB-END/d" $(INSTALLDIR)/www/admin-buttons.asp
98 ifeq ($(TOMATO_EXPERIMENTAL),1)
99 cd $(INSTALLDIR)/www && \
100 for F in $(wildcard *.asp); do \
101 sed -e "s,<div class='title'>Tomato</div>,<div class='title'>Tomato <small><i>(beta)</i></small></div>," $$F > $$F.tmp; \
102 mv $$F.tmp $$F; \
103 done
104 endif
108 # make sure old and debugging crap is gone
109 @rm -f $(INSTALLDIR)/www/debug.js
110 @rm -f $(INSTALLDIR)/www/*-x.*
111 @rm -f $(INSTALLDIR)/www/*-old.*
112 @rm -f $(INSTALLDIR)/www/color.css
114 chmod 0644 $(INSTALLDIR)/www/*