| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243 |
- #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_STSC_I3_O1_OLED"
- #PRJS="PRJ_SG_I3_O3"
- #PRJS="PRJ_ESOUTH_DC_I1_O4_RGB5"
- #PRJS="PRJ_TEST"
- #PRJS="PRJ_TEST_AC_I1_O1"
- #PRJS="PRJ_TEST_AC_I3_O1"
- PRJS="PRJ_TEST_AC_I3_O3"
- #PRJS="PRJ_INST2302_DC_OLED"
- #PRJS="PRJ_INST2106_AC_I1_O1_OLED"
- #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_TEST_AC_I1_O1 PRJ_TEST_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"
- #PRJS="PRJ_IP_AC_I3_O3"
- #PRJS="PRJ_IP_AC_I3_O1"
- #PRJS="PRJ_IP_AC_I1_O1"
- fulldir=$(realpath $0)
- curdir=$(dirname $fulldir)
- ip_flag=0
- custdir=$curdir/cust_data
- name=null
- rootdir=$curdir/output/t113i/pack_dir
- appdir=$rootdir/root/run/app
- function prj_enable()
- {
- fcfg=$curdir/pro/config/cfg.h
- fmak=$curdir/pro/CMakefile.txt
- #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\s*$\)|\1|g" $fcfg
- }
- function prj_unmask()
- {
- prj=$1
- }
- function do_copy()
- {
- echo do_copy ...
-
- if [[ "$1" == "PRJ_IP_"* ]]; then
- ip_flag=1
- fi
- if [ $ip_flag -eq 1 ]; then
- rootdir=$curdir/output/t113s/pack_dir
- appdir=$rootdir/mnt/UDISK/app
- fi
- rm -rf $appdir/image_qt
- mkdir -p $appdir/image
- mkdir -p $appdir/cert
- cp -f $custdir/cert/server.* $appdir/cert/
- cp -f $custdir/changes.txt $appdir/
- cp -f $custdir/db/pdu_dat.db $appdir/
- cp -f $custdir/logo/logo_neuter.png $appdir/image/logo.png
- cp -f $custdir/qt/S90PDUApp $rootdir/etc/init.d/
- if [ $ip_flag -eq 1 ]; then
- cp -f $custdir/qt/IP/Qt_Test $appdir/
- else
- cp -f $custdir/qt/Qt_Test $appdir/
- fi
- if [ "$1" = "PRJ_XIAN_AC_I1_O1_P4" ]; then
- name=ac_in1_out1_p4_xian
- elif [ "$1" = "PRJ_XIAN_AC_I1_O1_P8" ]; then
- name=ac_in1_out1_p8_xian
- elif [ "$1" = "PRJ_ITK_AC_I1_O1" ]; then
- name=ac_in1_out1_russia_itk
- cp -f $custdir/db/pdu_dat_itk.db $appdir/pdu_dat.db
- cp -f $custdir/logo/logo_itk.png $appdir/image/logo.png
- elif [ "$1" = "PRJ_ITK_AC_I3_O1" ]; then
- name=ac_in3_out1_russia_itk
- cp -f $custdir/logo/logo_itk.png $appdir/image/logo.png
- elif [ "$1" = "PRJ_RELEASE_DC_I_DC_O" ]; then
- name=dc_in_dc_out_release
- elif [ "$1" = "PRJ_RELEASE_AC_I1_O1" ]; then
- name=ac_in1_out1_release
- elif [ "$1" = "PRJ_RELEASE_AC_I3_O1" ]; then
- name=ac_in3_out1_release
- elif [ "$1" = "PRJ_RELEASE_AC_I3_O3" ]; then
- name=ac_in3_out3_release
- elif [ "$1" = "PRJ_LITECH_AC_I1_O1" ]; then
- name=ac_in1_out1_litech
- cp -f $custdir/logo/logo_litech.png $appdir/image/logo.png
- elif [ "$1" = "PRJ_LITECH_AC_I3_O1" ]; then
- name=ac_in3_out1_litech
- cp -f $custdir/logo/logo_litech.png $appdir/image/logo.png
- elif [ "$1" = "PRJ_ANDERSON_AC_I3_O3" ]; then
- name=ac_in3_out3_anderson
- elif [ "$1" = "PRJ_USASL_AC_I3_O1" ]; then
- name=ac_in3_out1_usa_sl
- elif [ "$1" = "PRJ_USASL_AC_I3_O3" ]; then
- name=ac_in3_out3_usa_sl
- elif [ "$1" = "PRJ_HYPERTEC_AC_I3_O1" ]; then
- name=ac_in3_out1_hypertec
- cp -f $custdir/logo/logo_hypertec.png $appdir/image/logo.png
- elif [ "$1" = "PRJ_INSPUR_DC_I_DC_O" ]; then
- name=dc_in1_out1_inspur
- elif [ "$1" = "PRJ_STSC_I3_O3" ]; then
- name=ac_in3_out3_stsc
- elif [ "$1" = "PRJ_SG_I3_O3" ]; then
- name=ac_in2_out1_sg24016
- elif [ "$1" = "PRJ_TEST" ]; then
- name=ac_in3_out1_test
- elif [ "$1" = "PRJ_TEST_AC_I1_O1" ]; then
- name=ac_in1_out1_test
- elif [ "$1" = "PRJ_TEST_AC_I3_O1" ]; then
- name=ac_in3_out1_test
- elif [ "$1" = "PRJ_TEST_AC_I3_O3" ]; then
- name=ac_in3_out3_test
- elif [ "$1" = "PRJ_TEST" ]; then
- name=ac_in3_out1_test
- elif [ "$1" = "PRJ_IP_AC_I3_O3" ];then
- name=ac_in3_out3_ip
- elif [ "$1" = "PRJ_INST2302_DC_OLED" ];then
- name=dc_in_dc_out_oled
- rm -f $appdir/Qt_Test
- elif [ "$1" = "PRJ_INST2106_AC_I1_O1_OLED" ];then
- name=ac_in1_out1_inst2106_oled
- rm -f $appdir/Qt_Test
- elif [ "$1" = "PRJ_STSC_I3_O1_OLED" ];then
- name=ac_in3_out1_stsc_oled
- rm -f $appdir/Qt_Test
- elif [ "$1" = "PRJ_ESOUTH_DC_I1_O4_RGB5" ];then
- name=dc_in1_out4_esouth_rgb5
- cp -f $custdir/qt/rgb/Qt_Test $appdir/
- cp -rf $custdir/qt/rgb/image_qt $appdir/
- cp -f $custdir/qt/rgb/S90PDUApp $rootdir/etc/init.d/
- elif [ "$1" = "PRJ_IP_AC_I3_O1" ];then
- name=ip_ac_in3_out1_release
- elif [ "$1" = "PRJ_IP_AC_I1_O1" ];then
- name=ip_ac_in1_out1_release
- else
- echo error! $RPJ not define!!!
- exit 1
- fi
- rm -rf $appdir/../web
- cp -rf $custdir/web/unique $appdir/../web
- prj_enable $1
- }
- function do_compile()
- {
- echo do_compile ...
- cd $curdir/pro
- rm -rf build; mkdir build; cd build
- if [[ "$1" == "PRJ_IP_"* ]];then
- cmake .. -DCHIP=t113s && make
- else
- cmake .. -DCHIP=t113i && make
- fi
- if [ $? -gt 0 ]; then
- exit 1
- fi
- }
- function do_pack()
- {
- echo do_pack ...
- if [[ "$1" == "PRJ_IP_"* ]];then
- $curdir/output/t113s/pack.sh
- else
- $curdir/output/t113i/pack.sh
- fi
- }
- function do_zip()
- {
- echo do_zip ...
-
- ztm=`date +%Y%m%d_%H%M%S`
- if [[ "$1" == "PRJ_IP_"* ]];then
- zname="upgrade_"$ztm"_$name"
- zdir=$curdir/output/t113s/push
- files="push.bat pdutar tools/*"
- cd $zdir; zip -q $zname.zip $files
- mv $zname.zip $curdir/output/t113s/
- else
- zname="upgrade_"$ztm"_$name"
- zdir=$curdir/output/t113i/push2
- files="push.bat pdutar tools/*"
- cd $zdir; zip -q $zname.zip $files
- mv $zname.zip $curdir/output/t113i/
- fi
- }
- function do_one()
- {
- do_copy $1
- do_compile $1
- do_pack $1
- do_zip $1
- }
- function do_all()
- {
- for s in $PRJS; do
- do_one $s
- done
- }
- do_all
|