| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- #PRJS="PRJ_XIAN_AC_I1_O1_P4"
- #PRJS="PRJ_XIAN_AC_I1_O1_P8"
- #PRJS="PRJ_ITK_AC_I1_O1"
- #PRJS="PRJ_ITK_AC_I3_O1"
- #PRJS="PRJ_LITECH_AC_I1_O1"
- #PRJS="PRJ_LITECH_AC_I3_O1"
- #PRJS="PRJ_ANDERSON_AC_I3_O3"
- #PRJS="PRJ_USASL_AC_I3_O1"
- #PRJS="PRJ_USASL_AC_I3_O3"
- #PRJS="PRJ_HYPERTEC_AC_I3_O1"
- #PRJS="PRJ_INSPUR_DC_I_DC_O"
- #PRJS="PRJ_RELEASE_DC_I_DC_O"
- #PRJS="PRJ_RELEASE_AC_I1_O1"
- #PRJS="PRJ_RELEASE_AC_I3_O1"
- #PRJS="PRJ_RELEASE_AC_I3_O3"
- #PRJS="PRJ_STSC_I3_O3"
- PRJS="PRJ_TEST"
- #PRJS="PRJ_USASL_AC_I3_O1 PRJ_USASL_AC_I3_O3"
- #PRJS="PRJ_XIAN_AC_I1_O1_P4 PRJ_XIAN_AC_I1_O1_P8"
- #PRJS="PRJ_ITK_AC_I1_O1 PRJ_ITK_AC_I3_O1"
- #PRJS="PRJ_LITECH_AC_I1_O1 PRJ_LITECH_AC_I3_O1"
- #PRJS="PRJ_RELEASE_DC_I_DC_O PRJ_RELEASE_AC_I1_O1 PRJ_RELEASE_AC_I3_O1 PRJ_RELEASE_AC_I3_O3"
- #PRJS="PRJ_LITECH_AC_I1_O1 PRJ_LITECH_AC_I3_O1 PRJ_XIAN_AC_I1_O1_P4 PRJ_XIAN_AC_I1_O1_P8"
- fulldir=$(realpath $0)
- curdir=$(dirname $fulldir)
- custdir=$curdir/cust_data
- name=null
- function prj_enable()
- {
- fcfg=$curdir/pro/config/cfg.h
- #clear space
- sed -i 's|^[[:space:]]\(#define PRJ_*\)|\1|g' $fcfg
- #mask all PRJ_XXX define
- sed -i 's|^\(.*\)\(#define PRJ_*\)|//\2|g' $fcfg
- #enable the needed PRJ_XXX define
- sed -i "s|^//\(#define $1.*\)|\1|g" $fcfg
- }
- function prj_unmask()
- {
- prj=$1
- }
- function do_copy()
- {
- echo do_copy ...
-
- flag=0
-
- rm -f $curdir/output/t113i/etc/network/interfaces
- mkdir -p $curdir/output/t113i/root/run/app/image
-
- if [ "$1" = "PRJ_XIAN_AC_I1_O1_P4" ]; then
- name=ac_in1_out1_p4_xian
- cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
- elif [ "$1" = "PRJ_XIAN_AC_I1_O1_P8" ]; then
- name=ac_in1_out1_p8_xian
- cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
- elif [ "$1" = "PRJ_ITK_AC_I1_O1" ]; then
- name=ac_in1_out1_russia_itk
- cp -f $custdir/logo/logo_itk.png $curdir/output/t113i/root/run/app/image/logo.png
- elif [ "$1" = "PRJ_ITK_AC_I3_O1" ]; then
- name=ac_in3_out1_russia_itk
- cp -f $custdir/logo/logo_itk.png $curdir/output/t113i/root/run/app/image/logo.png
- elif [ "$1" = "PRJ_RELEASE_DC_I_DC_O" ]; then
- name=dc_in_dc_out_release
- cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
- elif [ "$1" = "PRJ_RELEASE_AC_I1_O1" ]; then
- name=ac_in1_out1_release
- cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
- elif [ "$1" = "PRJ_RELEASE_AC_I3_O1" ]; then
- name=ac_in3_out1_release
- cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
- elif [ "$1" = "PRJ_RELEASE_AC_I3_O3" ]; then
- name=ac_in3_out3_release
- cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
- elif [ "$1" = "PRJ_LITECH_AC_I1_O1" ]; then
- name=ac_in1_out1_litech
- cp -f $custdir/logo/logo_litech.png $curdir/output/t113i/root/run/app/image/logo.png
- elif [ "$1" = "PRJ_LITECH_AC_I3_O1" ]; then
- name=ac_in3_out1_litech
- cp -f $custdir/logo/logo_litech.png $curdir/output/t113i/root/run/app/image/logo.png
- elif [ "$1" = "PRJ_ANDERSON_AC_I3_O3" ]; then
- name=ac_in3_out3_anderson
- flag=1
- cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
- elif [ "$1" = "PRJ_USASL_AC_I3_O1" ]; then
- name=ac_in3_out1_usa_sl
- cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
- elif [ "$1" = "PRJ_USASL_AC_I3_O3" ]; then
- name=ac_in3_out3_usa_sl
- cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
- elif [ "$1" = "PRJ_HYPERTEC_AC_I3_O1" ]; then
- name=ac_in3_out1_hypertec
- cp -f $custdir/logo/logo_hypertec.png $curdir/output/t113i/root/run/app/image/logo.png
- elif [ "$1" = "PRJ_INSPUR_DC_I_DC_O" ]; then
- name=dc_in1_out1_inspur
- cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
- elif [ "$1" = "PRJ_TEST" ]; then
- name=ac_in3_out1_test
- cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
- elif [ "$1" = "PRJ_STSC_I3_O3" ]; then
- name=ac_in3_out3_stsc
- cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
- else
- echo error! $RPJ not define!!!
- exit 1
- fi
- rm -rf $curdir/output/t113i/root/run/web
- if [ $flag -gt 0 ]; then
- cp -rf $custdir/web/general $curdir/output/t113i/root/run/web
- else
- cp -rf $custdir/web/anderson $curdir/output/t113i/root/run/web
- fi
- prj_enable $1
- }
- function do_compile()
- {
- echo do_compile ...
- cd $curdir/pro
- rm -rf build; mkdir build; cd build
- cmake .. && make
- if [ $? -gt 0 ]; then
- exit 1
- fi
- }
- function do_pack()
- {
- echo do_pack ...
- $curdir/output/pack.sh
- }
- function do_zip()
- {
- echo do_zip ...
-
- ztm=`date +%Y%m%d_%H%M%S`
- zname="upgrade_"$ztm"_$name"
- zdir=$curdir/output/push
- files="push.bat pdutar tools/*"
-
- cd $zdir; zip -q $zname.zip $files
- mv $zname.zip $curdir/output/
- }
- function do_one()
- {
- do_copy $1
- do_compile
- do_pack
- do_zip
- }
- function do_all()
- {
- for s in $PRJS; do
- do_one $s
- done
- }
- do_all
|