1,系统编译配置文件脚本目录~/8368U.TD/build/Kconfig

  一)比喻配置屏幕分表率,比喻配置GLB_GMNCFG_ENABLE_800_480_UI

~/8368U.TD/build/Kconfig   

menu "Gemini UI Setting" choice prompt "UI Framework Selection" default GLB_GMNCFG_ENABLE_QT_FRAMEWORK config GLB_GMNCFG_ENABLE_QT_FRAMEWORK bool "Qt Framework" config GLB_GMNCFG_ENABLE_TD_FRAMEWORK bool "TD Framework" endchoice choice prompt "UI Resolution" default GLB_GMNCFG_ENABLE_1024_600_UI config GLB_GMNCFG_ENABLE_800_480_UI bool "800*480 UI" config GLB_GMNCFG_ENABLE_1024_600_UI bool "1024*600_UI" config GLB_GMNCFG_ENABLE_1280_720_UI depends on GLB_GMNCFG_ENABLE_TD_FRAMEWORK bool "1280*720 UI (Not support on Qt)"

   二)

maxiongying@dvr-server:~/8368U.TD/build$ grep -irn "GLB_GMNCFG_ENABLE_1024_600_UI"
Kconfig:277:                default GLB_GMNCFG_ENABLE_1024_600_UI
Kconfig:280:                config GLB_GMNCFG_ENABLE_1024_600_UI
Kconfig:331:                            default 1024 if GLB_GMNCFG_ENABLE_1024_600_UI
Kconfig:338:                            default 600 if GLB_GMNCFG_ENABLE_1024_600_UI
Kconfig:357:                                default 1024 if GLB_GMNCFG_ENABLE_1024_600_UI
Kconfig:364:                                default 600 if GLB_GMNCFG_ENABLE_1024_600_UI
Kconfig:1084:                default 2400 if GLB_GMNCFG_ENABLE_1024_600_UI && (GLB_GMNCFG_FB0_BUFNUM=1)
Kconfig:1085:                default 4800 if GLB_GMNCFG_ENABLE_1024_600_UI && (GLB_GMNCFG_FB0_BUFNUM=2)
Kconfig:1086:                default 7200 if GLB_GMNCFG_ENABLE_1024_600_UI && (GLB_GMNCFG_FB0_BUFNUM=3)
Kconfig:1096:                default 2400 if GLB_GMNCFG_FB1_ACTIVE && GLB_GMNCFG_ENABLE_1024_600_UI && (GLB_GMNCFG_FB1_BUFNUM=1)
Kconfig:1097:                default 4800 if GLB_GMNCFG_FB1_ACTIVE && GLB_GMNCFG_ENABLE_1024_600_UI && (GLB_GMNCFG_FB1_BUFNUM=2)
Kconfig:1098:                default 7200 if GLB_GMNCFG_FB1_ACTIVE && GLB_GMNCFG_ENABLE_1024_600_UI && (GLB_GMNCFG_FB1_BUFNUM=3)
Kconfig:1108:                default 2400 if GLB_GMNCFG_FB2_ACTIVE && GLB_GMNCFG_ENABLE_1024_600_UI && (GLB_GMNCFG_FB2_BUFNUM=1)
Kconfig:1109:                default 4800 if GLB_GMNCFG_FB2_ACTIVE && GLB_GMNCFG_ENABLE_1024_600_UI && (GLB_GMNCFG_FB2_BUFNUM=2)
Kconfig:1110:                default 7200 if GLB_GMNCFG_FB2_ACTIVE && GLB_GMNCFG_ENABLE_1024_600_UI && (GLB_GMNCFG_FB2_BUFNUM=3)
Kconfig:1163:                default 1200 if(GLB_GMNCFG_ENABLE_1024_600_UI && GLB_GMNCFG_RAL_FMT_LUT8)
Kconfig:1166:                default 4800 if(GLB_GMNCFG_ENABLE_1024_600_UI && GLB_GMNCFG_RAL_FMT_ARGB8888)
platform_cfg/4RlsCode_8368_U_demov1.4_openall_cfg/defconfig:140:CONFIG_GLB_GMNCFG_ENABLE_1024_600_UI=y
platform_cfg/pub_cfg/defconfig:140:CONFIG_GLB_GMNCFG_ENABLE_1024_600_UI=y
platform_cfg/soling_td_cfg/defconfig:140:# CONFIG_GLB_GMNCFG_ENABLE_1024_600_UI is not set

 

maxiongying@dvr-server:~/8368U.TD/application$ grep -irn "GLB_GMNCFG_ENABLE_1024_600_UI"
reference_ui/Makefile:40:export CONFIG_GLB_GMNCFG_ENABLE_1024_600_UI
reference_ui/etc/Makefile:6:ifeq ($(CONFIG_GLB_GMNCFG_ENABLE_1024_600_UI), y)
reference_ui/build_qtap.sh:138:    if [ "$CONFIG_GLB_GMNCFG_ENABLE_1024_600_UI" == "y"  ]; then
Makefile:98:ifeq ($(CONFIG_GLB_GMNCFG_ENABLE_1024_600_UI),y)
reference_td/tdLauncher/view/Makefile:13:ifeq ($(CONFIG_GLB_GMNCFG_ENABLE_1024_600_UI),y)
reference_td/tdLauncher/sys_config.mk:82:ifeq ($(CONFIG_GLB_GMNCFG_ENABLE_1024_600_UI),y)
reference_td/pubtdLauncher/view/Makefile:12:ifeq ($(CONFIG_GLB_GMNCFG_ENABLE_1024_600_UI),y)
reference_td/pubtdLauncher/sys_config.mk:78:ifeq ($(CONFIG_GLB_GMNCFG_ENABLE_1024_600_UI),y)
reference_td/solingtdLauncher/view/Makefile:12:ifeq ($(CONFIG_GLB_GMNCFG_ENABLE_1024_600_UI),y)
reference_td/solingtdLauncher/view/activitys/homeview/src/clockview.cpp:7:#ifdef CONFIG_GLB_GMNCFG_ENABLE_1024_600_UI
reference_td/solingtdLauncher/view/activitys/homeview/src/homeview.cpp:393:#elif CONFIG_GLB_GMNCFG_ENABLE_1024_600_UI
reference_td/solingtdLauncher/view/activitys/homeview/src/homeview.cpp:699:#if CONFIG_GLB_GMNCFG_ENABLE_1024_600_UI
reference_td/solingtdLauncher/view/activitys/homeview/src/homeview.cpp:716:#if CONFIG_GLB_GMNCFG_ENABLE_1024_600_UI
reference_td/solingtdLauncher/view/activitys/homeview/src/homeview.cpp:821:#if CONFIG_GLB_GMNCFG_ENABLE_1024_600_UI
reference_td/solingtdLauncher/view/activitys/homeview/src/homeview.cpp:837:#elif CONFIG_GLB_GMNCFG_ENABLE_1024_600_UI
reference_td/solingtdLauncher/sys_config.mk:74:ifeq ($(CONFIG_GLB_GMNCFG_ENABLE_1024_600_UI),y)
ext_config/prj_extcfg.h:60:#define CONFIG_GLB_GMNCFG_ENABLE_1024_600_UI      1
ext_config/global.config:140:CONFIG_GLB_GMNCFG_ENABLE_1024_600_UI=y

 

 

 

2,在工程更目录下执行make命令,都会执行build/Makefile

~/8368U.TD/Makefile

include build/Makefile

3,build/Makefile分析

make help 会打印下面说明

   一)make uboot 会执行“build uboot source”

         make all 会执行“build uboot/ecos/kernel/sdk/app/rom source”即 分别会执行“build uboot source“、"build ecos source"..“build rom source”

         make clean 会执行“clean uboot/ecos/kernel/sdk/app” 会分别执行“clean uboot”、"clean ecos" ...”clean app“

         make disclean 会执行“clean uboot/ecos/kernel/sdk/app and platform config”

   二)make app 流程 (分析结果:相当于执行./application下的Makefile)

   I) @if [ -f $(GEMINI_APP_WRAPPER_FILE) ]; then

  相当于“./application/gemini.mk”

  II) $(MAKE) $(MAKE_JOBS) -f $(GEMINI_APP_WRAPPER_FILE) build

   相当于"make -j CPU_NUM -f ./application/gemini.mk build"

   相当于

 

~/8368U.TD/application/gemini.mk

build: @$(PRJ_SHOWBUILDMESG) @$(RM) -rf $(PRJ_OUTPUT_FILE) @$(MAKE) ${MAKE_JOBS} $(PRJ_EXT_PARA) -C $(APP_ROOT); \ $(PRJ_CHKBUILDRESULT);

相当于:

build:

    rm -rf ./application/out/app.sqfs

 make ./application

gemini.mk:11:PRJ_OUTPUT_FILE        = $(APP_OUT_ROOT)$(APP_BIN_NAME)

core/setupenv.mak:112:APP_OUT_ROOT = $(APP_ROOT)out/

setupenv.mak:110:APP_ROOT = $(GEMINI_ROOT)application/
setupenv.mak:27:GEMINI_ROOT = $(TOPDIR)

core/setupenv.mak:115:APP_BIN_NAME = app.sqfs

 

 

~/8368U.TD/build/core/config_gemini.mak

126 PRJ_SHOWBUILDMESG = $(call sys_showmesg, GREEN, [BUILD] $(PRJ_NAME));\ 127 $(call sys_showmesg, LIBLUE, [TARGET] $(PRJ_OUTPUT_FILE)); \ 128 $(call sys_showmesg, BLUE, [GEMINI TARGET] $(TARGET_OUTPUT_FILE));

 

~/8368U.TD/application/gemini.mk

TOPDIR = ./
MAK_WRAPPER_ENV=Y
#NO_PARALLEL_BUILD=1
include $(TOPDIR)build/core/config_gemini.mak

###################################
#  Define this project parameter  #
###################################
PRJ_NAME               = "User Applcation"
PRJ_BUILD_ROOT         = $(APP_ROOT)
PRJ_OUTPUT_FILE        = $(APP_OUT_ROOT)$(APP_BIN_NAME)
TARGET_OUTPUT_FILE     = $(GEMINI_APP_IMAGE)
TARGET_OUTPUT_DEL_FILE =
PRJ_EXT_PARA           =

.PHONY: all init build install update clean distclean

all:
        @:

init:
        @$(PRJ_SHOWINITMESG)
        @$(ECHO) "#sinclude $(GEMINI_PLF_CFG_PATH)" > $(PRJ_EXT_CFG_ROOT)$(PRJ_EXT_CFG_FILE)
        @$(CALL_WRAPPER_TARGET) update_global_cfg_h 
        @$(CP) $(GEMINI_ROOT_ABS).libcxx_cfg $(PRJ_EXT_CFG_ROOT)libcxx_config
        @$(MAKE) $(PRJ_EXT_PARA) -C $(PRJ_BUILD_ROOT) $(CONFIG_GLB_GMNCFG_MODEL_APP_CFG)

build:
        @$(PRJ_SHOWBUILDMESG)
        @$(RM) -rf $(PRJ_OUTPUT_FILE)
        @$(MAKE) ${MAKE_JOBS} $(PRJ_EXT_PARA) -C $(APP_ROOT); \
        $(PRJ_CHKBUILDRESULT);

install:
        @:

update:
        @$(PRJ_BUILDUPDTAE)

distclean clean:
        @$(MAKE) ${MAKE_JOBS} $(PRJ_EXT_PARA) -C $(PRJ_BUILD_ROOT) $@; \
        $(PRJ_CHKCLEANRESULT)

 

 

 ~/8368U.TD/build/core/config_gemini.make

101 ifeq ($(NO_PARALLEL_BUILD), 1) 102 MAKE_JOBS = 103 else 104 CPU_NUM = $(shell grep -c processor /proc/cpuinfo) 105 JOB_LIMIT = $(shell echo "${CPU_NUM} * 5 / 4" | bc) 106 LOAD_LIMIT = $(CPU_NUM) 107 MAKE_JOBS = -j $(JOB_LIMIT) -l $(LOAD_LIMIT) 108 endif

   三)make clean 流程 (分析结果:相当于执行 找到application下的所有Makefile文件,执行里面的clean操作)

    I)分析clean app 流程

build/core/config.mak:134:COMMAND = @set fnord $$MAKEFLAGS; amf=$$2; \

 

~/8368U.TD/application/build/core/config.mak

134 COMMAND = @set fnord $$MAKEFLAGS; amf=$$2; \
135         target=`echo $@ | sed s/-recursive//`; \
136         list='$(SUBDIRS)'; for subdir in $$list; do \
137           if test -f $$subdir/Makefile; \
138           then \
139                   echo "Making $$target in $$subdir"; \
140                   (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target) \
141                    || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
142           fi; \
143         done;
144 

 

 

 

~/8368U.TD/build/Makefile

clean: outclean @if [ -f $(GEMINI_XBOOT_WRAPPER_FILE) ]; then \ $(MAKE) -f $(GEMINI_XBOOT_WRAPPER_FILE) $@; \ fi @if [ -f $(GEMINI_UBOOT_WRAPPER_FILE) ]; then \ $(MAKE) -f $(GEMINI_UBOOT_WRAPPER_FILE) $@; \ fi @if [ -f $(GEMINI_ECOS_WRAPPER_FILE) ]; then \ $(MAKE) -f $(GEMINI_ECOS_WRAPPER_FILE) $@; \ fi @if [ -f $(GEMINI_ROOTFS_WRAPPER_FILE) ]; then \ $(MAKE) -f $(GEMINI_ROOTFS_WRAPPER_FILE) $@; \ fi @if [ -f $(GEMINI_KERNEL_WRAPPER_FILE) ]; then \ $(MAKE) -f $(GEMINI_KERNEL_WRAPPER_FILE) $@; \ fi @if [ -f $(GEMINI_SDK_WRAPPER_FILE) ]; then \ $(MAKE) -f $(GEMINI_SDK_WRAPPER_FILE) $@; \ fi @if [ -f $(GEMINI_APP_WRAPPER_FILE) ]; then \ $(MAKE) -f $(GEMINI_APP_WRAPPER_FILE) $@; \ fi @$(CLEAR) @$(call sys_showmesg, GREEN, GEMINI CLEAN DONE ! ); \

 

    下面变量在/8368U.TD/build/core/setupenv.mak中

        GEMINI_APP_WRAPPER_FILE      = $(APP_ROOT)$(MAKE_WRAPPER_FILE)
  APP_ROOT = $(GEMINI_ROOT)application/

       GEMINI_ROOT = $(TOPDIR)

      TOPDIR = ./ (~/8368U.TD/build/Makefile 中)

      MAKE_WRAPPER_FILE = gemini.mk

 

~/8368U.TD/build/Makefile

TOPDIR = ./ SHELL := /bin/bash include $(TOPDIR)build/core/setupenv.mak include $(TOPDIR)build/core/Makefile.tls include $(TOPDIR)build/core/color.mak sinclude $(TOPDIR).config #Build STAGE 1->2->3->4 #STAGE1_TARGETS += consistent_check STAGE1_TARGETS += xboot STAGE1_TARGETS += uboot STAGE1_TARGETS += ecos STAGE1_TARGETS += kernel STAGE2_TARGETS += sdk STAGE3_TARGETS += app STAGE4_TARGETS += rootfs STAGE5_TARGETS += rom #zebu_hex .PHONY: all outclean clean distclean unconfig .PHONY: xboot uboot ecos kernel sdk app rootfs rom .PHONY: rls list nothing info spirom isp .PHONY: tidy astyle checkout chktcpath isp_exe #help nothing help: @$(ECHO) "" @$(ECHO) $(COLOR_GREEN)"=======================================" $(COLOR_ORIGIN); @$(ECHO) $(COLOR_GREEN)"= [Gemini] Source Code Manual !!! =" $(COLOR_ORIGIN); @$(ECHO) $(COLOR_GREEN)"=======================================" $(COLOR_ORIGIN); @$(ECHO) "" @$(ECHO) $(COLOR_YELLOW)"[build flow]"$(COLOR_ORIGIN) @$(ECHO) " $$ make x_cfg_id or x_cfg (please choice platform cfg from make list)" @$(ECHO) " $$ make all" @$(ECHO) "" @$(ECHO) $(COLOR_YELLOW)"[help option]"$(COLOR_ORIGIN) @$(ECHO) " - list : show platform config list" @$(ECHO) " - info : show currnt platform config" @$(ECHO) " - help : show this Manual" @$(ECHO) "" @$(ECHO) $(COLOR_YELLOW)"[configure option]"$(COLOR_ORIGIN) @$(ECHO) " - x_cfg : configure platform config" @$(ECHO) "" @$(ECHO) $(COLOR_YELLOW)"[build option]"$(COLOR_ORIGIN) @$(ECHO) " - uboot : build uboot source" @$(ECHO) " - ecos : build ecos source" @$(ECHO) " - kernel : build kernel source" @$(ECHO) " - sdk : build sdk source" @$(ECHO) " - app : build application source" @$(ECHO) " - rom : package FW binary" @$(ECHO) " - all : build uboot/ecos/kernel/sdk/app/rom source" @$(ECHO) "" @$(ECHO) $(COLOR_YELLOW)"[clean option]"$(COLOR_ORIGIN) @$(ECHO) " - clean : clean uboot/ecos/kernel/sdk/app" @$(ECHO) " - distclean : clean uboot/ecos/kernel/sdk/app and platform config" @$(MAKE) -s list ... #uboot build uboot: build_precheck @if [ -f $(GEMINI_UBOOT_WRAPPER_FILE) ]; then \ $(MAKE) $(MAKE_JOBS) -f $(GEMINI_UBOOT_WRAPPER_FILE) build && \ $(MAKE) $(MAKE_JOBS) -f $(GEMINI_UBOOT_WRAPPER_FILE) update; \ else \ $(ERRMSG_FOLDER_NOT_EXIST); \ fi #application build app: build_precheck @if [ -f $(GEMINI_APP_WRAPPER_FILE) ]; then \ $(MAKE) $(MAKE_JOBS) -f $(GEMINI_APP_WRAPPER_FILE) build && \ $(MAKE) $(MAKE_JOBS) -f $(GEMINI_APP_WRAPPER_FILE) update; \ else \ $(ERRMSG_FOLDER_NOT_EXIST); \ fi clean: outclean @if [ -f $(GEMINI_XBOOT_WRAPPER_FILE) ]; then \ $(MAKE) -f $(GEMINI_XBOOT_WRAPPER_FILE) $@; \ fi @if [ -f $(GEMINI_UBOOT_WRAPPER_FILE) ]; then \ $(MAKE) -f $(GEMINI_UBOOT_WRAPPER_FILE) $@; \ fi @if [ -f $(GEMINI_ECOS_WRAPPER_FILE) ]; then \ $(MAKE) -f $(GEMINI_ECOS_WRAPPER_FILE) $@; \ fi @if [ -f $(GEMINI_ROOTFS_WRAPPER_FILE) ]; then \ $(MAKE) -f $(GEMINI_ROOTFS_WRAPPER_FILE) $@; \ fi @if [ -f $(GEMINI_KERNEL_WRAPPER_FILE) ]; then \ $(MAKE) -f $(GEMINI_KERNEL_WRAPPER_FILE) $@; \ fi @if [ -f $(GEMINI_SDK_WRAPPER_FILE) ]; then \ $(MAKE) -f $(GEMINI_SDK_WRAPPER_FILE) $@; \ fi @if [ -f $(GEMINI_APP_WRAPPER_FILE) ]; then \ $(MAKE) -f $(GEMINI_APP_WRAPPER_FILE) $@; \ fi @$(CLEAR) @$(call sys_showmesg, GREEN, GEMINI CLEAN DONE ! ); \