20181116_jeffrey - silenceuncrio/diary GitHub Wiki
繼續昨天的 online user manual
盤一下目前 www 目錄下 makefile 的流程
user@10972b0a698a:~/proscend/prosrc/www$ make
rm -rf ./www
mkdir -p ./www/brand
cp -a app ./www/
cp -a libs ./www/
cpp -include ../../autoconf.h -P src/index.html.src src/index.html
sed -i "s/\.js/\.js\?v=2018111601051542330330/g; s/\.css/\.css\?v=2018111601051542330330/g; s/\.html/\.html\?v=2018111601051542330330/g" src/index.html
sed -i "s/\.html/\.html?v=2018111601051542330330/g" src/index.html
mv src/index.html ./www/index.html
cpp -include ../../autoconf.h -P src/menu.html.src src/menu.html
sed -i "s/\.js/\.js\?v=2018111601051542330330/g; s/\.css/\.css\?v=2018111601051542330330/g; s/\.html/\.html\?v=2018111601051542330330/g" src/menu.html
sed -i "s/\.html/\.html?v=2018111601051542330330/g" src/menu.html
mv src/menu.html ./www/menu.html
cpp -include ../../autoconf.h -P src/app/feature/ipfilter.html.src src/app/feature/ipfilter.html
sed -i "s/\.js/\.js\?v=2018111601051542330330/g; s/\.css/\.css\?v=2018111601051542330330/g; s/\.html/\.html\?v=2018111601051542330330/g" src/app/feature/ipfilter.html
sed -i "s/\.html/\.html?v=2018111601051542330330/g" src/app/feature/ipfilter.html
mv src/app/feature/ipfilter.html ./www/app/feature/ipfilter.html
cpp -include ../../autoconf.h -P src/app/feature/ipsec.html.src src/app/feature/ipsec.html
sed -i "s/\.js/\.js\?v=2018111601051542330330/g; s/\.css/\.css\?v=2018111601051542330330/g; s/\.html/\.html\?v=2018111601051542330330/g" src/app/feature/ipsec.html
sed -i "s/\.html/\.html?v=2018111601051542330330/g" src/app/feature/ipsec.html
mv src/app/feature/ipsec.html ./www/app/feature/ipsec.html
cpp -include ../../autoconf.h -P src/app/feature/macfilter.html.src src/app/feature/macfilter.html
sed -i "s/\.js/\.js\?v=2018111601051542330330/g; s/\.css/\.css\?v=2018111601051542330330/g; s/\.html/\.html\?v=2018111601051542330330/g" src/app/feature/macfilter.html
sed -i "s/\.html/\.html?v=2018111601051542330330/g" src/app/feature/macfilter.html
mv src/app/feature/macfilter.html ./www/app/feature/macfilter.html
cpp -include ../../autoconf.h -P src/app/feature/openvpn.html.src src/app/feature/openvpn.html
sed -i "s/\.js/\.js\?v=2018111601051542330330/g; s/\.css/\.css\?v=2018111601051542330330/g; s/\.html/\.html\?v=2018111601051542330330/g" src/app/feature/openvpn.html
sed -i "s/\.html/\.html?v=2018111601051542330330/g" src/app/feature/openvpn.html
mv src/app/feature/openvpn.html ./www/app/feature/openvpn.html
cpp -include ../../autoconf.h -P src/app/feature/urlfilter.html.src src/app/feature/urlfilter.html
sed -i "s/\.js/\.js\?v=2018111601051542330330/g; s/\.css/\.css\?v=2018111601051542330330/g; s/\.html/\.html\?v=2018111601051542330330/g" src/app/feature/urlfilter.html
sed -i "s/\.html/\.html?v=2018111601051542330330/g" src/app/feature/urlfilter.html
mv src/app/feature/urlfilter.html ./www/app/feature/urlfilter.html
cpp -include ../../autoconf.h -P src/app/feature/comPorts_v2.html.src src/app/feature/comPorts_v2.html
sed -i "s/\.js/\.js\?v=2018111601051542330330/g; s/\.css/\.css\?v=2018111601051542330330/g; s/\.html/\.html\?v=2018111601051542330330/g" src/app/feature/comPorts_v2.html
sed -i "s/\.html/\.html?v=2018111601051542330330/g" src/app/feature/comPorts_v2.html
mv src/app/feature/comPorts_v2.html ./www/app/feature/comPorts_v2.html
cpp -include ../../autoconf.h -P src/app/feature/portForwarding_v2.html.src src/app/feature/portForwarding_v2.html
sed -i "s/\.js/\.js\?v=2018111601051542330330/g; s/\.css/\.css\?v=2018111601051542330330/g; s/\.html/\.html\?v=2018111601051542330330/g" src/app/feature/portForwarding_v2.html
sed -i "s/\.html/\.html?v=2018111601051542330330/g" src/app/feature/portForwarding_v2.html
mv src/app/feature/portForwarding_v2.html ./www/app/feature/portForwarding_v2.html
cpp -include ../../autoconf.h -P src/app/feature/vlanSubnet.html.src src/app/feature/vlanSubnet.html
sed -i "s/\.js/\.js\?v=2018111601051542330330/g; s/\.css/\.css\?v=2018111601051542330330/g; s/\.html/\.html\?v=2018111601051542330330/g" src/app/feature/vlanSubnet.html
sed -i "s/\.js/\.js\?v=2018111601051542330330/g; s/\.css/\.css\?v=2018111601051542330330/g; s/\.html/\.html\?v=2018111601051542330330/g" src/app/feature/vlanSubnet.html
sed -i "s/\.html/\.html?v=2018111601051542330330/g" src/app/feature/vlanSubnet.html
mv src/app/feature/vlanSubnet.html ./www/app/feature/vlanSubnet.html
cpp -include ../../autoconf.h -P src/app/feature/alarm.html.src src/app/feature/alarm.html
sed -i "s/\.js/\.js\?v=2018111601051542330330/g; s/\.css/\.css\?v=2018111601051542330330/g; s/\.html/\.html\?v=2018111601051542330330/g" src/app/feature/alarm.html
sed -i "s/\.html/\.html?v=2018111601051542330330/g" src/app/feature/alarm.html
mv src/app/feature/alarm.html ./www/app/feature/alarm.html
cpp -include ../../autoconf.h -P src/app/feature/contact_duty_schedule.html.src src/app/feature/contact_duty_schedule.html
sed -i "s/\.js/\.js\?v=2018111601051542330330/g; s/\.css/\.css\?v=2018111601051542330330/g; s/\.html/\.html\?v=2018111601051542330330/g" src/app/feature/contact_duty_schedule.html
sed -i "s/\.html/\.html?v=2018111601051542330330/g" src/app/feature/contact_duty_schedule.html
mv src/app/feature/contact_duty_schedule.html ./www/app/feature/contact_duty_schedule.html
cpp -include ../../autoconf.h -P src/app/feature/status.html.src src/app/feature/status.html
sed -i "s/\.js/\.js\?v=2018111601051542330330/g; s/\.css/\.css\?v=2018111601051542330330/g; s/\.html/\.html\?v=2018111601051542330330/g" src/app/feature/status.html
sed -i "s/\.html/\.html?v=2018111601051542330330/g" src/app/feature/status.html
mv src/app/feature/status.html ./www/app/feature/status.html
cp -r brand_proscend/brand/* ./www/brand
cp -r brand_proscend/app/* ./www/app/
# Use find to get the source files and make it again.
find brand_proscend -type f -name "*.src" -exec bash -c "echo {} | sed 's=\.src==i' | xargs make" \;
make[1]: Entering directory `/home/user/proscend/prosrc/www'
cpp -include ../../autoconf.h -P brand_proscend/src/brand/top.html.src brand_proscend/src/brand/top.html
sed -i "s/\.js/\.js\?v=2018111601051542330333/g; s/\.css/\.css\?v=2018111601051542330333/g; s/\.html/\.html\?v=2018111601051542330333/g" brand_proscend/src/brand/top.html
sed -i "s/\.html/\.html?v=2018111601051542330333/g" brand_proscend/src/brand/top.html
mv brand_proscend/src/brand/top.html ./www/brand/top.html
make[1]: Leaving directory `/home/user/proscend/prosrc/www'
對應的 Makefile
-include ../.config
-include ../crosscmpl_vars
-include ../env_vars
TARGETS :=
# The source files with Compiler flag and timestamp
TARGETS += src/index.html
TARGETS += src/menu.html
TARGETS += src/app/feature/ipfilter.html
TARGETS += src/app/feature/ipsec.html
TARGETS += src/app/feature/macfilter.html
TARGETS += src/app/feature/openvpn.html
TARGETS += src/app/feature/urlfilter.html
TARGETS += src/app/feature/comPorts_v2.html
TARGETS += src/app/feature/portForwarding_v2.html
TARGETS += src/app/feature/vlanSubnet.html
TARGETS += src/app/feature/alarm.html
#TARGETS += src/app/feature/switch.html
#TARGETS += src/app/feature/lteGps.html
#TARGETS += src/app/feature/administration.html
#TARGETS += src/app/feature/lteConfig.html
TARGETS += src/app/feature/contact_duty_schedule.html
TARGETS += src/app/feature/status.html
# Customer's Customization Target
# Task format: <customer>.brand
# Brand folder: brand_<customer>
ifeq ($(_BRAND_ID),66)
TARGETS += proscend.brand
else
TARGETS += nobrand.brand
endif
label := $(shell date +'%Y%m%d%H%M%s')
WWW_DIR := ./www
################################################################################
# Target all
################################################################################
default: WWW $(TARGETS)
WWW:
rm -rf $(WWW_DIR)
mkdir -p $(WWW_DIR)/brand
cp -a app $(WWW_DIR)/
cp -a libs $(WWW_DIR)/
%.html:%.html.src
cpp -include ../../autoconf.h -P $< $@
sed -i "s/\.js/\.js\?v=${label}/g; s/\.css/\.css\?v=${label}/g; s/\.html/\.html\?v=${label}/g" $@
sed -i "s/\.html/\.html?v=${label}/g" $@
mv $@ $(shell echo $@ \
| sed 's=^brand_.*/src/=$(WWW_DIR)/=i; s=^brand_.*/app/=$(WWW_DIR)/app/=i; s=src/=$(WWW_DIR)/=i')
%.brand: brand_%
cp -r $</brand/* $(WWW_DIR)/brand
cp -r $</app/* $(WWW_DIR)/app/
# Use find to get the source files and make it again.
find $< -type f -name "*.src" -exec bash -c "echo {} | sed 's=\.src==i' | xargs make" \;
install: default
echo "install"
mkdir -p $(INSTALL_DIR)/www
find $(INSTALL_DIR)/www -mindepth 1 -maxdepth 1 -type d -not -name "cgi-bin" -exec rm -rf {} \;
find $(INSTALL_DIR)/www -mindepth 1 -maxdepth 1 -type f -exec rm -rf {} \;
cp -a $(WWW_DIR)/* $(INSTALL_DIR)/www/
clean:
echo "clean"
rm -rf $(WWW_DIR)
@rm -f icos-mcsv
test:
sed "s/\.js/\.js\?v=${label}/g; s/\.css/\.css\?v=${label}/g" index.html.src > index.html
debug:
@echo "================================================================="
@echo "Gen icos-mcsv for /usr/sbin/icos/ChkUpgradeFile.sh to check ModelID/BrandID..."
@printf "%04d%04d" $(_MODEL_ID) $(_BRAND_ID) > icos-mcsv
@cat icos-mcsv
@echo
@echo "================================================================="
.PHONY: all
BOOTSTRAP SIDEBAR 的第二個範例也不適合
toggle 左側 menu 的按鈕在 main 的最頂部
BOOTSTRAP SIDEBAR 還有第三個和第四個範例
沒有一個能填滿我對第二個範例感覺的的不足
看來就先不要換了
Bootstrap Docs Sidebar Explained
這個相當不錯
不過有點歷史
可以放後面一點