一、RDA MAKEFILE的本地变量
在介绍多屏参之前,先看一下./code/env.conf的包含过程,通过./code/Makefile.project加载,env.conf中所有的变量,都变为makefile执行过程中的本地变量:
包括:mconfig.config、boardconfig.config、menuconfig.config文件中变量的定义,所以在任何递归的Makefile都可以引用这三个文件定义的变量,关于mconfig.config定义的屏参,在aps/customer/Makefile会通过变量$(CONFIG_PANEL_TYPE)进行引用。
include $(ROOT_DIR)/mconfig.config
include $(ROOT_DIR)/boardconfig.config
include $(ROOT_DIR)/menuconfig.config
APP_FOLDER_NAME=$(subst ",,$(CONFIG_APP_FOLDER_NAME))
CUSTOMER_NAME=$(subst ",,$(CONFIG_CUSTOMER_NAME))
SUBCUSTOMER_NAME=$(subst ",,$(CONFIG_SUBCUSTOMER_NAME))
SUBSUBCUSTOMER_NAME=$(subst ",,$(CONFIG_SUBSUBCUSTOMER_NAME))
BOARD_NAME=$(subst ",,$(CONFIG_MODEL_BOARD_NAME))
PANEL_NAME=$(subst ",,$(CONFIG_PANEL_TYPE_NAME))
APPDIR_NAME=$(CUSTOMER_NAME)/$(APP_FOLDER_NAME)
CUSTOMER_BOARD_PATH=customer/$(CUSTOMER_NAME)/$(BOARD_NAME)
FORMAL_CUSTOMER_PATH=customer/$(CUSTOMER_NAME)/sub_customer/$(SUBCUSTOMER_NAME)/$(SUBSUBCUSTOMER_NAME)
mconfig.config中多屏参的定义:
CONFIG_PANEL_TYPE_PN_FAC_1366X768="PN_FAC_1366x768"
CONFIG_PANEL_TYPE_PN_FAC_1440X900="PN_FAC_1440x900"
CONFIG_PANEL_TYPE_PN_FAC_1920X1080="PN_FAC_1920x1080"
CONFIG_PANEL_TYPE_CMO_M185B1_L02_1366X768="CMO_M185B1_L02_1366x768"
CONFIG_PANEL_CMO_M185B1_L02_1366X768_IS_DEFAULT=y
CONFIG_PANEL_TYPE_DEFAULT_FOLDER="CMO_M185B1_L02_1366x768"
CONFIG_DDC_DeafaultTable_1366x768=y
CONFIG_PANEL_TYPE_AUO_B141PW04_V1_1440X900="AUO_B141PW04_V1_1440x900"
CONFIG_PANEL_TYPE_AUO_T420HW04_V0_1920X1080="AUO_T420HW04_V0_1920x1080"
二、多屏参的形成过程
1、Makefile.pj 定义的"make mconfig"的执行过程,调用gen_customer.pl生产屏参目录下的makefile.ini文件:
customer:
./tools/gen_customer.pl -C aps/customer -E aps/external
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_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; \
cp -f aps/$${NEW_FORMAL_CUSTOMER_PATH}/project/DEFAULT.config menuconfig.config;
endif
“gen_customer.pl”主要功能是:创建make mconfig UI界面显示的信息。如下的的Kconfig文件,均由“gen_customer.pl”产生。
./code/aps/customer/radisson/public/ir/ir_map.h
./code/aps/customer/radisson/public/ir/ir_map.c
./code/aps/customer/radisson/public/ir/irinclude.in./code/aps/customer/radisson/public/ir/irsrc.in./code/aps/customer/radisson/public/ir/makefile.ini
./code/aps/customer/radisson/public/ir/Kconfig
./code/aps/customer/radisson/public/ir_tx/Kconfig
./code/aps/customer/radisson/public/ir_tx/ir_txinclude.in./code/aps/customer/radisson/public/ir_tx/ir_txsrc.in./code/aps/customer/radisson/Kconfig
./code/aps/customer/radisson/sub_customer/radisson/Kconfig
./code/aps/customer/radisson/sub_customer/radisson/radisson/Kconfig.project ./code/aps/customer/radisson/public/panel/Kconfig.panel
./code/aps/customer/radisson/public/panel/makefile.ini
./code/aps/customer/radisson/sub_customer/radisson/radisson/Kconfig
./code/aps/customer/Kconfig.external
其中“./aps/customer/radisson/public/panel/makefile.ini”,为多屏参文件。“gen_customer.pl”将迭代panel下面的所有屏参目录,生成makefile.ini如下:这个文件在编译时aps/customer/Makefile会包含“makefile.ini”,运行“tools/gen_paneltable.pl”在屏参目录生成。
CONFIG_PANEL_TYPE=\
$(CONFIG_PANEL_TYPE_AUO_B141PW04_V1_1440X900) \
$(CONFIG_PANEL_TYPE_AUO_T420HW04_V0_1920X1080) \
$(CONFIG_PANEL_TYPE_CMO_M185B1_L02_1366X768) \
$(CONFIG_PANEL_TYPE_PN_FAC_1366X768) \
$(CONFIG_PANEL_TYPE_PN_FAC_1440X900) \
$(CONFIG_PANEL_TYPE_PN_FAC_1920X1080)
这里注意:脚本的功能是将屏参文件名字大写,定义为变量名的形式,如果mconfig.config有定义,则变量有值,没有定义变量则为空。虽然makefile.ini包含了所有的屏参变量的定义,但只有在mconfig.config定义的屏参有值,在接下来的脚本gen_paneltable.pl只处理在mconfig.config中定义的屏参,这里做的很巧妙。
2、gen_paneltable.pl根据makefile.ini,处理需要生成的PanelSet_XXX.bin & PanelSet_Bak.bin
接下来的介绍aps/makefile文件的执行过程:
注意:终极目标“all”-->依赖“application”-->依赖“$(BUILD_MODULE) ”-->依赖“customer”-->命令行“@$(MAKE) -C customer gen_multipanelbin”-->执行aps/customer/Makefile:gen_multipanelbin
include Makefile.project
#define TOP DIR and LIB DIR
export TOP_DIR := $(shell /bin/pwd)
export LIB_DIR := $(TOP_DIR)/lib
AV_DEV_ONOFF=n
ifdef CONFIG_MEDIA_ENABLE
AV_DEV_ONOFF=y
endif
ifdef CONFIG_DTV_SUPPORT
AV_DEV_ONOFF=y
endif
ifeq ($(AV_DEV_ONOFF),y)
#av_dev (runav and mpdev)
BUILD_MODULE += av_dev
#INSTALL_MODULE += av_dev
endif
ifeq ($(CONFIG_NOT_USEBB),y)
BUILD_MODULE += minibox
endif
INSTALL_MODULE += application
#tool kits
ifeq ($(CONFIG_NOT_USEBB),$(filter $(CONFIG_NOT_USEBB),n))
BUILD_MODULE += toy
INSTALL_MODULE += toy
BUILD_MODULE += sf
INSTALL_MODULE += sf
endif
ifeq ($(CONFIG_CORE_DUMP),y)
BUILD_MODULE += automount
INSTALL_MODULE += automount
endif
ifeq ($(CONFIG_DRIVER_TEST_AP_BUILDIN),y)
BUILD_MODULE += test
INSTALL_MODULE += test
endif
include external/Makefile.in
BUILD_MODULE += gsl filesystem middleware app_infra test
ifeq (y, $(findstring y, ${CONFIG_OSD_GAME_SUPPORT}${CONFIG_SUPPORT_NES_GAME}))
BUILD_MODULE += game
endif
.PHONY: all clean install application customer $(BUILD_MODULE)
all: application
application: $(BUILD_MODULE)
$(MAKE) -C application all
clean:
@$(MAKE) -C application clean
@$(MAKE) -C customer clean
@$(foreach MODULES, $(BUILD_MODULE), $(MAKE) -C ./$(MODULES) clean ; )
@$(MAKE) -C sf clean
install:
ifndef CONFIG_INSTALLDIR
@$(error [ERROR] CONFIG_INSTALLDIR not define!!)
endif
$(MAKE) -C initramfs install
@$(foreach MODULES, $(INSTALL_MODULE), $(MAKE) -C ./$(MODULES) install CONFIG_INSTALLDIR=$(CONFIG_INSTALLDIR) ; )
@$(MAKE) -C customer/$(CUSTOMER_NAME)/public/sound install
$(BUILD_MODULE): customer
@$(MAKE) -C $@ all
customer:
ifdef CONFIG_SUPPORT_PANNEL_PHOTO_TEST
@$(MAKE) -C customer gen_pnltestpattern
endif
@$(MAKE) -C customer create_buildfiles
@$(MAKE) -C customer gen_multipanelbin
@$(MAKE) -C customer all
ifdef CONFIG_SUPPORT_NVM_ENABLE_AUTOUPDATEVESION_TOOL
@$(MAKE) -C customer gen_datasetting
endif
ifdef CONFIG_SUPPORT_NES_FLASH
@$(MAKE) -C customer gen_gamebin
endif
aps/customer/Makefile:gen_multipanelbin如下:调用gen_paneltable.pl
# include ir makefile
include ./$(CUSTOMER_NAME)/public/ir/makefile.ini
IR_MAP_WILLBEBUILD = \
$(foreach file, $(IR_MAP), $(addprefix build_, $(file)))
SRCS_LIST += $(IR_MAP_WILLBEBUILD)
include ./$(CUSTOMER_NAME)/public/panel/makefile.ini
#***************************************************************************
# Build binary file for drivers
#***************************************************************************
.PHONY: create_buildfiles gen_customerdata4driver all clean_loop gen_pnltestpattern gen_datasetting gen_gamebin
create_buildfiles:
ifdef CONFIG_SUPPORT_PROJECT_ID
@$(MAKE) -C ./$(CUSTOMER_NAME) create_buildfiles
@$(MAKE) -C ./$(CUSTOMER_NAME) all
endif
@../../tools/gen_customertablebefore.pl $(DRV_CUSTMERFILES_B_WITHPATH) $(DRV_CUSTMERFILES_B1_WITHPATH) $(DRV_CUSTMERFILES_B2_WITHPATH) \
$(DRV_CUSTMERFILES_C_WITHPATH) $(IR_MAP_WITHPATH)
gen_multipanelbin:
@../../tools/gen_paneltable.pl -M "$(CONFIG_PANEL_TYPE)" -P ./$(CUSTOMER_NAME)/public/panel/ 、
-B ../$(CUSTOMER_BOARD_PATH)/adaptable/ -L ./$(CUSTOMER_NAME)/sub_customer/$(SUBCUSTOMER_NAME)/$(SUBSUBCUSTOMER_NAME)/logo \
-F ./$(CUSTOMER_NAME)/public/panel/$(CONFIG_PANEL_TYPE_DEFAULT_FOLDER) \
-V `echo $(CONFIG_CHIPID) | sed 's/0x//'` --panel_ini2bin ../../tools/pnlset2bin/pnlset2bin --VIP_ini2bin ../../tools/vip2bin/vip2bin \
--lzma ../../tools/lzma460/lzma -I $(CONFIG_PANEL_TYPE_DEFAULT_FOLDER) -X "n"
“gen_paneltable.pl”根据makefile.ini定义的$(CONFIG_PANEL_TYPE)与“panel_setting.h”生成屏参目录下的“PanelSet_XXX.bin”文件,并将多屏参打包到PanelSet_Bak.bin。
三、链接到FLASH
./mergedir/mergeImage.cfg和./mergedir/flash_layout.gyp将做链接处理。
mergeImage.cfg:
BootROM=../boot/boot.bin
Option=../aps/customer/radisson/RR52C_816A/adaptable/option.bin
OUIBOOTinfo=../aps/customer/radisson/RR52C_816A/adaptable/gBootSysInfo.bin
Kernel=vmlinux.dsc
OUIMAINinfo=../aps/customer/radisson/RR52C_816A/adaptable/gMainSysInfo.bin
Custable=../aps/customer/radisson/RR52C_816A/adaptable/customertable4driver.bin
MultiPanel=../aps/customer/radisson/public/panel/PanelSet_Bak.bin
DefPanel=../aps/customer/radisson/public/panel/PanelSet_Def.bin
GammaTable=../aps/customer/radisson/public/panel/GAMMATABLE.bin
VIPTable=../aps/customer/radisson/public/panel/VIPTABLE.bin
CLUPTable=../aps/customer/radisson/public/panel/COLORLUT.bin
IRBBK00DF=../aps/customer/radisson/public/ir/dIR_BBK_BBK00DF_info.bin
IRKK=../aps/customer/radisson/public/ir/dIR_RAD_KK_info.bin
IRLC2=../aps/customer/radisson/public/ir/dIR_RAD_LC2_info.bin
KeyPad=../aps/customer/radisson/RR52C_816A/adaptable/KeypadInfo.bin
KeyPadFac=../aps/customer/radisson/RR52C_816A/adaptable/KeypadFacInfo.bin
Logo=../aps/customer/radisson/sub_customer/radisson/radisson/logo/title_logo.jpg
VIL_DATA=../aps/application/vil_data.bin
EDID=../aps/customer/radisson/sub_customer/radisson/radisson/edid/gEDIDtable.bin
HDCPKey=hdcp/HDCPKey.bin2=../aps/customer/radisson/RR52C_816A/adaptable/gKmfShareData.bin
flash_layout.gyp:
'MultiPanel': {
'order' : "7",
'depend_on' : "#CONFIG_MULTI_PANELSET#",
'max_size' : 'n',
'protect' : 'n',
'nvm_data' : "n",
'nvm_id' : "n",
'file_path' : "../aps/customer/#CONFIG_CUSTOMER_NAME#/public/panel/PanelSet_Bak.bin",
},