TOP=. include $(TOP)/env.conf build_dir=s2 ifdef PJ BIN_FILENAME=$(shell sed -n 's/^CONFIG_BIN_FILENAME=\"\(.\+\)\"/\1/p' $(PJ)) CHIP_ID=$(shell sed -n 's/^CONFIG_CHIPID=0x\(.\+\)/\1/p' $(PJ)) KERNEL_VERSION=$(sed -n 's/^CONFIG_KERNEL_VERSION_\(.\+\)=y/\1/p' $(PJ) | sed 's/_/\./g') else BIN_FILENAME=$(shell sed -n 's/^CONFIG_BIN_FILENAME=\"\(.\+\)\"/\1/p' menuconfig.config) CHIP_ID=$(shell sed -n 's/^CONFIG_CHIPID=0x\(.\+\)/\1/p' menuconfig.config) KERNEL_VERSION=$(shell sed -n 's/^CONFIG_KERNEL_VERSION_\(.\+\)=y/\1/p' menuconfig.config | sed 's/_/\./g') endif define GET_BIN_FILENAME $(shell sed -n 's/.*CONFIG_BIN_FILENAME\s\+\"\(.\+\)\"/\1/p' project.h) endef #ifeq ($(CONFIG_VERSION),release) #CONFIG_S2DRV=y #else #CONFIG_S2DRV=m #endif #parse menuconfig::kernel hack settings define parse_menuconfig @grep -q 'CONFIG_KALLSYMS_MENU=y' menuconfig.config; \ if [ $$? == 0 ]; \ then \ sed -i 's/# CONFIG_KALLSYMS is not set/CONFIG_KALLSYMS=y\n# CONFIG_KALLSYMS_ALL is not set\n# CONFIG_KALLSYMS_EXTRA_PASS is not set/g' ./kernel/linux-$(KERNEL_VERSION)/330_dtv.config; \ sed -i 's/# CONFIG_KALLSYMS is not set/CONFIG_KALLSYMS=y\n# CONFIG_KALLSYMS_ALL is not set\n# CONFIG_KALLSYMS_EXTRA_PASS is not set/g' ./kernel/linux-$(KERNEL_VERSION)/330_dtv_wifi.config; \ grep -q 'CONFIG_KERNEL_VERSION_3_0_8=y' menuconfig.config; \ if [ $$? == 0 ]; \ then \ sed -i 's/# CONFIG_KALLSYMS is not set/CONFIG_KALLSYMS=y\n# CONFIG_KALLSYMS_ALL is not set\n# CONFIG_KALLSYMS_EXTRA_PASS is not set/g' ./kernel/linux-$(KERNEL_VERSION)/330_dtv_wifi_AIC8800.config; \ fi \ fi @grep -q '# CONFIG_KALLSYMS_MENU is not set' menuconfig.config; \ if [ $$? == 0 ]; \ then \ sed -i 's/CONFIG_KALLSYMS=y/# CONFIG_KALLSYMS is not set/g' ./kernel/linux-$(KERNEL_VERSION)/330_dtv.config; \ sed -i '/CONFIG_KALLSYMS_ALL/d' ./kernel/linux-$(KERNEL_VERSION)/330_dtv.config; \ sed -i '/CONFIG_KALLSYMS_EXTRA_PASS/d' ./kernel/linux-$(KERNEL_VERSION)/330_dtv.config; \ sed -i 's/CONFIG_KALLSYMS=y/# CONFIG_KALLSYMS is not set/g' ./kernel/linux-$(KERNEL_VERSION)/330_dtv_wifi.config; \ sed -i '/CONFIG_KALLSYMS_ALL/d' ./kernel/linux-$(KERNEL_VERSION)/330_dtv_wifi.config; \ sed -i '/CONFIG_KALLSYMS_EXTRA_PASS/d' ./kernel/linux-$(KERNEL_VERSION)/330_dtv_wifi.config; \ grep -q 'CONFIG_KERNEL_VERSION_3_0_8=y' menuconfig.config; \ if [ $$? == 0 ]; \ then \ sed -i 's/CONFIG_KALLSYMS=y/# CONFIG_KALLSYMS is not set/g' ./kernel/linux-$(KERNEL_VERSION)/330_dtv_wifi_AIC8800.config; \ sed -i '/CONFIG_KALLSYMS_ALL/d' ./kernel/linux-$(KERNEL_VERSION)/330_dtv_wifi_AIC8800.config; \ sed -i '/CONFIG_KALLSYMS_EXTRA_PASS/d' ./kernel/linux-$(KERNEL_VERSION)/330_dtv_wifi_AIC8800.config; \ fi \ fi @grep -q 'CONFIG_ETHERNET_MAC_ADDRESS=' menuconfig.config; \ if [ $$? == 0 ]; \ then \ grep CONFIG_ETHERNET_MAC_ADDRESS menuconfig.config > mac_addr.tmp; \ sed -i 's/CONFIG_ETHERNET_MAC_ADDRESS="//g' mac_addr.tmp; \ sed -i 's/"//g' mac_addr.tmp; \ if [ "`sed -n "/^\([0-9A-Z][0-9A-Z]:\)\{5\}[0-9A-Z][0-9A-Z]$$/p" mac_addr.tmp`" = "" ]; \ then echo -e '\033[31mMAC address error! Please input the MAC address with the format "\033[32mxx:xx:xx:xx:xx:xx\033[31m".\033[0m'; \ echo ''; \ exit 1; \ fi; \ MAC_ADDRESS=`sed 's/:/, 0x/g' mac_addr.tmp`; \ sed -i "/Mac/s/^.*Mac/\t{0x55, 0xAA, 0xAA, 0x55, 0x$$MAC_ADDRESS}, \/\/Mac/g" ./aps/$(CUSTOMER_BOARD_PATH)/adaptable/8051_param_table.c; \ rm -f mac_addr.tmp; \ fi endef DATE_TIME = `/bin/date +%Y%m%d_%H%M` BUILD_TIMESTAMP=$(shell date --rfc-3339=seconds) SW_VERSION_TEMP = \"`svn info $(TOP) 2>&1 |grep Revision|sed 's/Revision: //g'`\" BACKUP_FILES = mergedir/System.map mergedir/vmlinux mconfig.config menuconfig.config boardconfig.config ifeq ($(CONFIG_CORE_DUMP),y) BACKUP_FILES += aps/application/$(APPDIR_NAME)/umf.gdb endif all: release release: @$(MAKE) -f Makefile.pj buildimg 2>&1 | /usr/bin/tee log/buildlog-$(DATE_TIME).log debug: @$(MAKE) -f Makefile.pj buildimg 2>&1 | /usr/bin/tee log/buildlog-$(DATE_TIME).log customer: ifndef PJ ./tools/gen_customer.pl -C aps/customer -E aps/external endif mconfig: customer ifndef PJ @[ -e $@.config ] && mv -f $@.config .config; ./tools/mconf/mconf $@.Kconfig; mv -f .config $@.config @NEW_CUSTOMER_NAME=`grep CONFIG_CUSTOMER_NAME $@.config | awk 'BEGIN {FS="\""}{print $$2}'`; \ NEW_SUB_NAME=`grep CONFIG_SUBCUSTOMER_NAME $@.config | awk 'BEGIN {FS="\""}{print $$2}'`; \ NEW_SUBSUB_NAME=`grep CONFIG_SUBSUBCUSTOMER_NAME $@.config | awk 'BEGIN {FS="\""}{print $$2}'`;\ NEW_MODEL_BOARD_NAME=`grep CONFIG_MODEL_BOARD_NAME $@.config | awk 'BEGIN {FS="\""}{print $$2}'`;\ NEW_CUSTOMER_BOARD_PATH=customer/$${NEW_CUSTOMER_NAME}/$${NEW_MODEL_BOARD_NAME}; \ NEW_PROJECT_NAME=`grep CONFIG_PROJECT_NAME $@.config | awk 'BEGIN {FS="\""}{print $$2}'`;\ NEW_FORMAL_CUSTOMER_PATH=customer/$${NEW_CUSTOMER_NAME}/sub_customer/$${NEW_SUB_NAME}/$${NEW_SUBSUB_NAME}; \ [ -e aps/$${NEW_CUSTOMER_BOARD_PATH}/boardconfig.config ] && cp -f aps/$${NEW_CUSTOMER_BOARD_PATH}/boardconfig.config boardconfig.config; \ [ -e aps/$${NEW_FORMAL_CUSTOMER_PATH}/project/$${NEW_PROJECT_NAME}.config ] && cp -f aps/$${NEW_FORMAL_CUSTOMER_PATH}/project/$${NEW_PROJECT_NAME}.config menuconfig.config; endif boardconfig: customer ifndef PJ @[ -e aps/$(CUSTOMER_BOARD_PATH)/$@.config ] && cp -f aps/$(CUSTOMER_BOARD_PATH)/$@.config .config; \ ./tools/mconf/mconf $@.Kconfig; mv -f .config $@.config; \ cp -f $@.config aps/$(CUSTOMER_BOARD_PATH)/$@.config; endif menuconfig: customer ifndef PJ @PROJECT_NAME=`grep CONFIG_PROJECT_NAME mconfig.config | awk 'BEGIN {FS="\""}{print $$2}'`; \ [ -e aps/$(FORMAL_CUSTOMER_PATH)/project/$${PROJECT_NAME}.config ] && cp -f aps/$(FORMAL_CUSTOMER_PATH)/project/$${PROJECT_NAME}.config .config; \ ./tools/mconf/mconf $@.Kconfig; mv -f .config $@.config; \ cp -f $@.config aps/$(FORMAL_CUSTOMER_PATH)/project/$${PROJECT_NAME}.config $(parse_menuconfig) endif clean: @rm -fr kernel/linux @rm -fr drivers/DTV @if [ ! -e kernel/linux-$(KERNEL_VERSION) ]; then echo 'Error: kernel/linux-$(KERNEL_VERSION) is not exist!'; exit 1; fi @ln -s linux-$(KERNEL_VERSION) ./kernel/linux @./parser.pl -R `pwd` -M ./Makefile.project @if [ ! -e ./Makefile.project ]; then echo 'Error: ./Makefile.project is not exist!'; exit 1; fi @if [ "`sed -n 1p ./Makefile.project`" = "" ]; then echo -e "ERROR! Nothing in Makefile.project!" ; exit 1 ; fi @cp -f ./Makefile.project ./aps @cp -f ./Makefile.project ./drivers @cp -f ./Makefile.project ./kernel/linux @rm -f .ver @rm -f mergedir/timestamp_info mergedir/vmlinux.dsc @rm -f kernel/linux/*.dsc kernel/linux/*.map -@rm -f ./mergedir/$(GET_BIN_FILENAME) @$(MAKE) -C ./boot clean PJ=$(PJ)|| exit 1 @$(MAKE) -C ./tools/lzma460 clean PJ=$(PJ)|| exit 1 @$(MAKE) -C ./tools/pnlset2bin clean PJ=$(PJ)|| exit 1 @$(MAKE) -C ./tools/vip2bin clean PJ=$(PJ)|| exit 1 @$(MAKE) -C ./tools/mergeImage clean PJ=$(PJ)|| exit 1 @$(MAKE) -C ./aps clean PJ=$(PJ)|| exit 1 @$(MAKE) -C ./kernel/linux clean PJ=$(PJ)|| exit 1 buildimg: ifdef PJ @if [ -e mconfig.config ]; then \ mv mconfig.config .mconfig.config; \ mv boardconfig.config .boardconfig.config; \ mv menuconfig.config .menuconfig.config; \ fi @rm -f menuconfig.config; ln -s $(PJ) menuconfig.config endif #ifeq ($(CONFIG_VERSION),) # $(error Please use 'make' or 'make release' or 'make debug' to build image) #endif ifeq ($(BIN_FILENAME),) $(error Error: System BIN filename (CONFIG_BIN_FILENAME) is not set) endif @if [ ! -d "mergedir" ]; then echo "Error: mergedir is not exist." ; exit 1 ; fi @if [ ! -e kernel/linux-$(KERNEL_VERSION) ]; then echo "Error: kernel/linux-$(KERNEL_VERSION) does not exist!"; exit 1; fi # @if [ -e .ver ]; then \ # OLD_VERSION=`awk 'BEGIN {FS="="}; {print $$2}' .ver`; \ # if [ $${OLD_VERSION} != $(CONFIG_VERSION) ]; then \ # echo "**********************************************";\ # echo "version is not matched, do 'make clean' first";\ # echo "**********************************************";\ # $(MAKE) clean; \ # fi;\ # fi # @rm -f .ver; echo "CONFIG_VERSION=$(CONFIG_VERSION)" > .ver @echo "*****************" @if [ "`uname -a | grep "x86_64"`" != "" ]; then echo "* 64bit Server *"; else echo "* 32bit Server *"; fi @echo "*****************" @echo "Run parser.pl" @echo "Gen project.h&Makefile.project&mergeImage.cfg ..." @./parser.pl -R `pwd` -M ./Makefile.project ifdef PJ @./tools/auto_cfg.pl $(PJ) else @./tools/auto_cfg.pl ./mconfig.config ./boardconfig.config ./menuconfig.config .ver endif @echo "#define TIMESTAMP \"$(BUILD_TIMESTAMP)\"" > aps/include/timestamp.h @echo "#define TIMESTAMP_F2 \"`date +%Y%m%d_%H%M`\"" >> aps/include/timestamp.h @if [ -d .svn ] && [ "$SW_VERSION_TEMP" != "" ]; then \ echo "#define SW_SVN_VERSION $(SW_VERSION_TEMP)" > aps/include/svn.h;\ else \ echo "#define SW_SVN_VERSION \"none\"" > aps/include/svn.h; \ fi @echo "#define SW_BUILDER_ENGINEER \"$(USER)\"" > aps/include/builder_engineer.h @./tools/reconfig.py ./auto_config.h aps/customer/$(CUSTOMER_NAME)/public/reconfig.ini @cmp -s ./auto_config.h ./project.h || cat ./auto_config.h > ./project.h @sed -i 's/^\(\#define[ \t]\+CONFIG[_0-9a-zA-Z]\+[ \t]\+\)\"\([_./0-9a-zA-Z]\+\)\"/\1\2/' ./auto_config.h @rm -fr ./auto_config.h @echo "kernel version=$(KERNEL_VERSION)" @echo "version of kernel source code is kernel/linux-$(KERNEL_VERSION)" @rm -f kernel/linux @ln -s linux-$(KERNEL_VERSION) ./kernel/linux @if [ -e ./project.h ]; then \ if [ "`sed -n 1p ./project.h`" = "" ] ; then echo -e "ERROR! Nothing in project.h!"; exit 1; fi; \ cmp -s ./project.h drivers/include/project.h || cp ./project.h drivers/include/project.h ;\ cmp -s ./project.h aps/include/project.h || cp ./project.h aps/include/project.h ;\ fi @if [ ! -e ./Makefile.project ]; then echo "Error: no ./Makefile.project exist!"; exit 1; fi @if [ "`sed -n 1p ./Makefile.project`" = "" ]; then echo -e "ERROR! Nothing in Makefile.project!" ; exit 1 ; fi @cp -f ./Makefile.project ./aps @cp -f ./Makefile.project ./drivers @cp -f ./Makefile.project ./kernel/linux @rm -f kernel/linux/*.dsc kernel/linux/*.map @tools/gen_flash_layout.py -f mergedir/flash_layout.gyp -i ./project.h @echo "****************************" @echo "* Start Build DTV " @echo "****************************" @if [ $(shell grep ^CONFIG_DEMODTYPE boardconfig.config | awk 'BEGIN {FS="\""}{print $$2}') == "UCCP" ]; then \ ./tools/uccp_parse_tool ./drivers/Tuner_demod/Ddemod/Uccp/$(CHIP_ID)/Firmware/dvbt ./drivers/Tuner_demod/Ddemod/Uccp/$(CHIP_ID)/Firmware/dvbt 0 ; \ ./tools/uccp_parse_tool ./drivers/Tuner_demod/Ddemod/Uccp/$(CHIP_ID)/Firmware/dvbt2 ./drivers/Tuner_demod/Ddemod/Uccp/$(CHIP_ID)/Firmware/dvbt2 7 ; \ ./tools/uccp_parse_tool ./drivers/Tuner_demod/Ddemod/Uccp/$(CHIP_ID)/Firmware/dvbc ./drivers/Tuner_demod/Ddemod/Uccp/$(CHIP_ID)/Firmware/dvbc 4 ; \ if [ $(shell grep ^CONFIG_S2TUNERTYPE boardconfig.config | awk 'BEGIN {FS="\""}{print $$2}') == "Rda_5815M" ]; then \ ./tools/uccp_parse_tool ./drivers/Tuner_demod/Ddemod/Uccp/$(CHIP_ID)/Firmware/slt_Rda_5815M ./drivers/Tuner_demod/Ddemod/Uccp/$(CHIP_ID)/Firmware/slt 6 ; \ elif [ $(shell grep ^CONFIG_S2TUNERTYPE boardconfig.config | awk 'BEGIN {FS="\""}{print $$2}') == "Airoha_AV2018" ]; then \ ./tools/uccp_parse_tool ./drivers/Tuner_demod/Ddemod/Uccp/$(CHIP_ID)/Firmware/slt_Rda_5815M ./drivers/Tuner_demod/Ddemod/Uccp/$(CHIP_ID)/Firmware/slt 6 ; \ else \ ./tools/uccp_parse_tool ./drivers/Tuner_demod/Ddemod/Uccp/$(CHIP_ID)/Firmware/slt ./drivers/Tuner_demod/Ddemod/Uccp/$(CHIP_ID)/Firmware/slt 6 ; \ fi;\ ./tools/uccp_parse_tool ./drivers/Tuner_demod/Ddemod/Uccp/$(CHIP_ID)/Firmware/isdbt ./drivers/Tuner_demod/Ddemod/Uccp/$(CHIP_ID)/Firmware/isdbt 2 ; \ ./tools/uccp_parse_tool ./drivers/Tuner_demod/Ddemod/Uccp/$(CHIP_ID)/Firmware/isdbc ./drivers/Tuner_demod/Ddemod/Uccp/$(CHIP_ID)/Firmware/isdbc 8 ; \ ./tools/uccp_parse_tool ./drivers/Tuner_demod/Ddemod/Uccp/$(CHIP_ID)/Firmware/atsc ./drivers/Tuner_demod/Ddemod/Uccp/$(CHIP_ID)/Firmware/atsc 1 ; \ ./tools/uccp_parse_tool ./drivers/Tuner_demod/Ddemod/Uccp/$(CHIP_ID)/Firmware/j83b ./drivers/Tuner_demod/Ddemod/Uccp/$(CHIP_ID)/Firmware/j83b 5 ; \ ./tools/uccp_parse_tool ./drivers/Tuner_demod/Ddemod/Uccp/$(CHIP_ID)/Firmware/dtmb ./drivers/Tuner_demod/Ddemod/Uccp/$(CHIP_ID)/Firmware/dtmb 3 ; \ fi; @cd ./kernel/linux; \ if [ "`grep "CONFIG_SUPPORT_ETHERNET" ./../../drivers/include/project.h`" != "" ]; then \ "`touch 330_dtv_network.config`"; \ elif [ "`grep "CONFIG_SUPPORT_AIC8800" ./../../drivers/include/project.h`" != "" ]; then \ "`touch 330_dtv_wifi_AIC8800.config`"; \ elif [ "`grep "CONFIG_SUPPORT_WIFI" ./../../drivers/include/project.h`" != "" ]; then \ "`touch 330_dtv_wifi.config`"; \ elif [ "`grep "CONFIG_SUPPORT_4G" ./../../drivers/include/project.h`" != "" ]; then \ "`touch 330_dtv_4g.config`"; \ elif [ "`grep "CONFIG_SUPPORT_NES_GAME" ./../../drivers/include/project.h`" != "" ]; then \ "`touch 330_dtv_nesgame.config`"; \ elif [ "`grep "CONFIG_SUPPORT_KEY_BOARD" ./../../drivers/include/project.h`" != "" ]; then \ "`touch 330_dtv_nesgame.config`"; \ elif [ "`grep "CONFIG_TUXERA_FS_NTFS_WRITE_SUPPORT" ./../../drivers/include/project.h`" != "" ]; then \ "`touch 330_dtv_ntfs.config`"; \ elif [ "`grep "CONFIG_FS_EXFAT_SUPPORT" ./../../drivers/include/project.h`" != "" ]; then \ "`touch 330_dtv_exfat.config`"; \ else \ "`touch 330_dtv.config`"; \ fi;\ rm -f .config; \ if [ "`grep "CONFIG_SUPPORT_ETHERNET" ./../../drivers/include/project.h`" != "" ]; then \ #"`cat 330_dtv_network.config > .config`" \ if [ "`grep "CONFIG_SUPPORT_NES_GAME" ./../../drivers/include/project.h`" != "" ]; then \ "`cat 330_dtv_network.config extra_nesgame.config > .config`"; \ else \ ln -fs 330_dtv_network.config .config; \ fi; \ #ln -fs 330_dtv_network.config .config; \ elif [ "`grep "CONFIG_SUPPORT_AIC8800" ./../../drivers/include/project.h`" != "" ]; then \ #"`cat 330_dtv_wifi_AIC8800.config > .config`" \ if [ "`grep "CONFIG_SUPPORT_NES_GAME" ./../../drivers/include/project.h`" != "" ]; then \ "`cat 330_dtv_wifi.config extra_nesgame.config > .config`"; \ else \ ln -fs 330_dtv_wifi_AIC8800.config .config; \ fi; \ #ln -fs 330_dtv_wifi_AIC8800.config .config; \ elif [ "`grep "CONFIG_SUPPORT_WIFI" ./../../drivers/include/project.h`" != "" ]; then \ #"`cat 330_dtv_wifi.config > .config`" \ if [ "`grep "CONFIG_SUPPORT_NES_GAME" ./../../drivers/include/project.h`" != "" ]; then \ "`cat 330_dtv_wifi.config extra_nesgame.config > .config`"; \ else \ ln -fs 330_dtv_wifi.config .config; \ fi; \ #ln -fs 330_dtv_wifi.config .config; \ elif [ "`grep "CONFIG_SUPPORT_4G" ./../../drivers/include/project.h`" != "" ]; then \ #"`cat 330_dtv_4g.config > .config`" \ ln -fs 330_dtv_4g.config .config; \ elif [ "`grep "CONFIG_SUPPORT_NES_GAME" ./../../drivers/include/project.h`" != "" ]; then \ #"`cat 330_dtv_nesgame.config > .config`" \ ln -fs 330_dtv_nesgame.config .config; \ elif [ "`grep "CONFIG_SUPPORT_KEY_BOARD" ./../../drivers/include/project.h`" != "" ]; then \ #"`cat 330_dtv_nesgame.config > .config`" \ ln -fs 330_dtv_nesgame.config .config; \ elif [ "`grep "CONFIG_TUXERA_FS_NTFS_WRITE_SUPPORT" ./../../drivers/include/project.h`" != "" ]; then \ if [ -f extra_exfat.config ]; then \ "`cat 330_dtv_ntfs.config extra_exfat.config > .config`"; \ else \ ln -fs 330_dtv_ntfs.config .config; \ fi; \ elif [ "`grep "CONFIG_FS_EXFAT_SUPPORT" ./../../drivers/include/project.h`" != "" ]; then \ if [ -f extra_exfat.config ]; then \ "`cat 330_dtv.config extra_exfat.config > .config`"; \ else \ ln -fs 330_dtv_exfat.config .config; \ fi; \ else \ #"`cat 330_dtv.config > .config`" \ ln -fs 330_dtv.config .config;\ fi;\ if [ "`grep "CONFIG_GCOV_KERNEL_SUPPORT" ./../../drivers/include/project.h`" != "" ]; then \ ln -fs 330_dtv_gcov.config .config; \ fi;\ if [ "`grep "CONFIG_TRACING_KERNEL" ./../../drivers/include/project.h`" != "" ]; then \ ../../tools/trace_analyze-master/s2_setup_trace.py .config; \ fi;\ rm -rf initramfs; mkdir initramfs; \ $(MAKE) -C ../../tools/lzma460 PJ=$(PJ) || exit 1 ;\ $(MAKE) -C ../../tools/pnlset2bin PJ=$(PJ)|| exit 1 ;\ $(MAKE) -C ../../tools/vip2bin PJ=$(PJ)|| exit 1 ;\ $(MAKE) -C ../../aps all PJ=$(PJ)|| exit 1 ; \ $(MAKE) -C ../../aps install CONFIG_INSTALLDIR=`pwd`/initramfs PJ=$(PJ)|| exit 1 ;\ if [ "`grep "CONFIG_LOAD_UCCP_FW_FROM_FLASH" ./../../drivers/include/project.h`" != "" ]; then \ $(MAKE) -C ../../drivers/Tuner_demod/Ddemod/Uccp/merge_fw install || exit 1;\ fi;\ echo ${BUILD_TIMESTAMP} > initramfs/tmp/timestamp_info ;\ rm -rf `find initramfs/* -name .svn` ;\ if [ "`grep "CONFIG_GCC473" ../../project.h`" != "" ]; then \ mipsel-s2-linux-uclibc-strip -s initramfs/lib/* ;\ mipsel-s2-linux-uclibc-strip -s initramfs/bin/* ;\ mipsel-s2-linux-uclibc-strip -s initramfs/usr/bin/* ;\ else \ mipsel-unknown-linux-uclibc-strip -s initramfs/lib/* ;\ mipsel-unknown-linux-uclibc-strip -s initramfs/bin/* ;\ mipsel-unknown-linux-uclibc-strip -s initramfs/usr/bin/* ;\ fi;\ mkdir initramfs/tmp/ko_bak ;\ mv initramfs/tmp/*.ko initramfs/tmp/ko_bak ;\ if [ "`grep "CONFIG_GCC473" ../../project.h`" != "" ]; then \ mipsel-s2-linux-uclibc-strip -s initramfs/tmp/* ;\ mipsel-s2-linux-uclibc-strip -d initramfs/tmp/ko_bak/* ;\ else \ mipsel-unknown-linux-uclibc-strip -s initramfs/tmp/* ;\ mipsel-unknown-linux-uclibc-strip -d initramfs/tmp/ko_bak/* ;\ fi;\ mv initramfs/tmp/ko_bak/* initramfs/tmp/ ;\ rmdir initramfs/tmp/ko_bak ;\ ../../tools/tar_large_file.py t initramfs;\ $(MAKE) vmlinux.bin CONFIG_S2DRV=y PJ=$(PJ)|| exit 1 ; \ if [ "`grep "CONFIG_GCC473" ../../project.h`" != "" ]; then \ [ -e System.map ] || mipsel-s2-linux-uclibc-nm -n vmlinux | grep -v '\( [aUw] \)\|\(__crc_\)\|\( \$[adt]\)' > System.map ;\ else \ [ -e System.map ] || mipsel-unknown-linux-uclibc-nm -n vmlinux | grep -v '\( [aUw] \)\|\(__crc_\)\|\( \$[adt]\)' > System.map ;\ fi;\ $(MAKE) -C ../../tools/mergeImage PJ=$(PJ)|| exit 1 ; \ ../../tools/packet/packet $(build_dir)-$(GET_BIN_FILENAME)_$(CHIP_ID) 0x00294801 $(CHIP_ID) || exit 1 ; \ ../../tools/tar_large_file.py d .; $(MAKE) -C boot PJ=$(PJ)|| exit 1 ; @rm -f mergedir/vmlinux.dsc; mv kernel/linux/vmlinux.dsc mergedir/ @rm -f mergedir/timestamp_info; ln -s ../kernel/linux/initramfs/tmp/timestamp_info mergedir @rm -f mergedir/vmlinux; mv kernel/linux/vmlinux mergedir/ @rm -f mergedir/System.map; mv kernel/linux/System.map mergedir/ @./tools/mergeImage/mergeImage mergedir || exit 1 @echo "Packing new debug files and deleting older files ... \c" -@mv -f mergedir/debug-20*.tar.gz log/ 2>/dev/null; true @tar zcf mergedir/debug-$(DATE_TIME).tar.gz $(BACKUP_FILES) @ls log/debug-20* -t | sed -e '1,10d' | xargs -d '\n' rm -f @ls log/buildlog-* -t | sed -e '1,10d' | xargs -d '\n' rm -f @echo "done" @$(MAKE) -f Makefile.pj info PJ=$(PJ) info: @echo '-------------------- main code config -------------------' ifdef PJ @echo '**** PJ := '$(PJ) @echo '**** CONFIG_APP_FOLDER_NAME := '$(shell grep ^CONFIG_APP_FOLDER_NAME $(PJ) | awk 'BEGIN {FS="\""}{print $$2}') @echo '**** CONFIG_CUSTOMER_NAME := '$(shell grep ^CONFIG_CUSTOMER_NAME $(PJ) | awk 'BEGIN {FS="\""}{print $$2}') @echo '**** CONFIG_SUBCUSTOMER_NAME := '$(shell grep ^CONFIG_SUBCUSTOMER_NAME $(PJ) | awk 'BEGIN {FS="\""}{print $$2}') @echo '**** CONFIG_SUBSUBCUSTOMER_NAME := '$(shell grep ^CONFIG_SUBSUBCUSTOMER_NAME $(PJ) | awk 'BEGIN {FS="\""}{print $$2}') @echo '**** CONFIG_MODEL_BOARD_NAME := '$(shell grep ^CONFIG_MODEL_BOARD_NAME $(PJ) | awk 'BEGIN {FS="\""}{print $$2}') @echo '**** CONFIG_PANEL_TYPE_NAME := '$(shell grep ^CONFIG_PANEL_TYPE_DEFAULT $(PJ) | awk 'BEGIN {FS="\""}{print $$2}' | sed 's/=y//g') @echo '**** Demod := '$(shell grep ^CONFIG_DEMODTYPE $(PJ) | awk 'BEGIN {FS="\""}{print $$2}') @echo '**** Tuner := '$(shell grep ^CONFIG_TUNERTYPE $(PJ) | awk 'BEGIN {FS="\""}{print $$2}') @echo '**** S_Tuner := '$(shell grep ^CONFIG_S2TUNERTYPE $(PJ) | awk 'BEGIN {FS="\""}{print $$2}') @echo '**** LNB := '$(shell grep ^CONFIG_LNBTYPE $(PJ) | awk 'BEGIN {FS="\""}{print $$2}') @echo '**** AudioRom := '$(shell grep ^CONFIG_AUDIOROMTYPE $(PJ) | awk 'BEGIN {FS="\""}{print $$2}' | sed 's/.bin//g') @echo '**** ChipID := '$(shell grep ^CONFIG_CHIPID=0x.* $(PJ) | sed 's/CONFIG_CHIPID=0x//g') else @echo '**** CONFIG_APP_FOLDER_NAME := '$(shell grep ^CONFIG_APP_FOLDER_NAME mconfig.config | awk 'BEGIN {FS="\""}{print $$2}') @echo '**** CONFIG_CUSTOMER_NAME := '$(shell grep ^CONFIG_CUSTOMER_NAME mconfig.config | awk 'BEGIN {FS="\""}{print $$2}') @echo '**** CONFIG_SUBCUSTOMER_NAME := '$(shell grep ^CONFIG_SUBCUSTOMER_NAME mconfig.config | awk 'BEGIN {FS="\""}{print $$2}') @echo '**** CONFIG_SUBSUBCUSTOMER_NAME := '$(shell grep ^CONFIG_SUBSUBCUSTOMER_NAME mconfig.config | awk 'BEGIN {FS="\""}{print $$2}') @echo '**** CONFIG_MODEL_BOARD_NAME := '$(shell grep ^CONFIG_MODEL_BOARD_NAME mconfig.config | awk 'BEGIN {FS="\""}{print $$2}') @echo '**** CONFIG_PANEL_TYPE_NAME := '$(shell grep ^CONFIG_PANEL_TYPE_DEFAULT mconfig.config | awk 'BEGIN {FS="\""}{print $$2}') ifeq ($(CONFIG_SUPPORT_TCON),y) @echo '**** TCON PANEL Select := '$(shell sed -n 's/.*CONFIG_\(BOE_\w\+\)/\1/p' project.h) endif ifneq ($(filter y,$(CONFIG_DTV_SUPPORT) $(CONFIG_ATV_SUPPORT)),) @echo '**** Tuner := '$(shell grep ^CONFIG_TUNERTYPE boardconfig.config | awk 'BEGIN {FS="\""}{print $$2}') endif ifeq ($(CONFIG_DTV_SUPPORT),y) @echo '**** Demod := '$(shell grep ^CONFIG_DEMODTYPE boardconfig.config | awk 'BEGIN {FS="\""}{print $$2}') endif ifeq ($(CONFIG_DVB_SYSTEM_DVBS_SUPPORT),y) @echo '**** S_Tuner := '$(shell grep ^CONFIG_S2TUNERTYPE boardconfig.config | awk 'BEGIN {FS="\""}{print $$2}') @echo '**** LNB := '$(shell grep ^CONFIG_LNBTYPE boardconfig.config | awk 'BEGIN {FS="\""}{print $$2}') endif @echo '**** AudioRom := '$(shell grep ^CONFIG_AUDIOROMTYPE menuconfig.config | awk 'BEGIN {FS="\""}{print $$2}' | sed 's/.bin//g') @echo '**** ChipID := '$(shell grep ^CONFIG_CHIPID=0x.* menuconfig.config | sed 's/CONFIG_CHIPID=0x//g') endif @echo '**** Software SVN version := '$(shell svn info $(TOP)|grep Revision|sed 's/Revision: //g') @echo '**** Modified Date Time := '$(shell svn info $(TOP)|grep Date | awk '{print $$4"\t"$$5}') @if [ -e .ver ]; then \ OLD_VERSION=`awk 'BEGIN {FS="="}; {print $$2}' .ver`; \ if [ $${OLD_VERSION} == debug ]; then \ echo '**** System version := debug'; \ else \ echo '**** System version := release';\ fi;\ fi @if [ -e mergedir/$(GET_BIN_FILENAME) ] ; then \ echo '**** BIN size := '`ls -hs mergedir/$(GET_BIN_FILENAME) | awk '{ print $$1}'`;\ fi @echo '---------------------------------------------------------' @echo ' '