GNU make:http://www.gnu.org/software/make/manual/make.html#Rules

为了便于理解把uboot中的Makefile配置部分弄出来便于理解,这里贴出我的Makefile配置部分。我的是FREESCALE的mx6q_sabresd开发板

mx6solo_sabresd_config \
mx6solo_sabresd_mfg_config \
mx6solo_sabresd_android_config \
mx6dl_sabresd_config \
mx6dl_sabresd_mfg_config \
mx6dl_sabresd_android_1G_config \
mx6dl_sabresd_android_2G_config \
mx6q_sabresd_config \
mx6q_sabresd_android_1G_config \
mx6q_sabresd_android_2G_config \
mx6q_sabresd_mfg_config \
mx6q_sabresd_iram_config : unconfig
@[ -z "$(findstring iram_,$@)" ] || \
{ echo "TEXT_BASE = 0x00907000" >$(obj)board/freescale/mx6q_sabresd/config.tmp ; \
echo "... with iram configuration" ; \
}
@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 mx6q_sabresd freescale mx6//$(@:_config=)在做什么很了解,其实它就是将$@即目标

smdk2410_config的后面的_config替换成空

@@@@@@@@@@@@@@@@@   $1        $2                    $3                 $4          $5

 整个mkconfig的作用如下

     (1).   BOARD_NAME='mx6q_sabresd'
        (2).   ln -s asm-arm asm
                 ln -s arch-mx6 asm-arm/arch
                 ln -s proc-armv asm-arm/proc
        (3).   创建include/config.mk
        (4).   创建include/config.h

#!/bin/sh -e

# Script to create header files and links to configure
# U-Boot for a specific board.
#
# Parameters: Target Architecture CPU Board [VENDOR] [SOC]
#
# (C) 2002-2006 DENX Software Engineering, Wolfgang Denk <wd@denx.de>
#

APPEND=no # Default: Create new config file
BOARD_NAME="" # Name to print in make output

while [ $# -gt 0 ] ; do
case "$1" in
--) shift ; break ;;
-a) shift ; APPEND=yes ;;
-n) shift ; BOARD_NAME="${1%%_config}" ; shift ;;
*) break ;;
esac
done

[ "${BOARD_NAME}" ] || BOARD_NAME="$1"

[ $# -lt 4 ] && exit 1
[ $# -gt 6 ] && exit 1

echo "Configuring for ${BOARD_NAME} board..."

#
# Create link to architecture specific headers

#创建到平台,开发板相关的头文件的链接
#
if [ "$SRCTREE" != "$OBJTREE" ] ; then
mkdir -p ${OBJTREE}/include    //。mkdir的-p选项允许你一次性创建多层次的目录,而不是一次只创建单独的目录。例如,我们要在当前目录创建目录Projects/a/src,使用命令
mkdir -p ${OBJTREE}/include2
cd ${OBJTREE}/include2  
rm -f asm
ln -s ${SRCTREE}/include/asm-$2 asm
LNPREFIX="../../include2/asm/"
cd ../include     //这条语句决定了下面所以的config.mk 以及config.h都是在/include这个文件夹下定义的
rm -rf asm-$2
rm -f asm
mkdir asm-$2
ln -s asm-$2 asm
else
cd ./include
rm -f asm
ln -s asm-$2 asm
fi

rm -f asm-$2/arch

if [ -z "$6" -o "$6" = "NULL" ] ; then
ln -s ${LNPREFIX}arch-$3 asm-$2/arch
else
ln -s ${LNPREFIX}arch-$6 asm-$2/arch
fi

if [ "$2" = "arm" ] ; then
rm -f asm-$2/proc
ln -s ${LNPREFIX}proc-armv asm-$2/proc
fi

#
# Create include file for Make

#cd ../include     //这条语句决定了下面所以的config.mk 以及config.h都是在/include这个文件夹下定义的
#
echo "ARCH = $2" > config.mk
echo "CPU = $3" >> config.mk
echo "BOARD = $4" >> config.mk

[ "$5" ] && [ "$5" != "NULL" ] && echo "VENDOR = $5" >> config.mk //此处的 [此中的内容相当于测试是否为空]

[ "$6" ] && [ "$6" != "NULL" ] && echo "SOC = $6" >> config.mk

/********************

***这几句很简单,就是创建config.mk,请注意,之前46行我们就已经在include目录下面了,因此这几行执行完成后,config.mk的内容就应该是下面的样子:

1 ARCH = arm
2 CPU = arm_cortexa8
3 BOARD = mx6q_sabresd
4 VENDOR = freescale
5 SOC = mx6

***********************/

#
# Create board specific header file

#最后就开始创建include/config.h:
#
if [ "$APPEND" = "yes" ] # Append to existing config file
then
echo >> config.h
else
> config.h # Create new config file
fi
echo "/* Automatically generated - do not edit */" >>config.h
echo "#include <configs/$1.h>" >>config.h
echo "#include <asm/config.h>" >>config.h

exit 0

/**********************

在这里我打开config.h给各位看下,我的是针对mx6q_sabresd开发板

1 /* Automatically generated - do not edit */
2 #include <configs/mx6q_sabresd_android_2G.h>
3 #include <asm/config.h>

***********************/

uboot顶层mkconfig分析的更多相关文章

  1. TQ210——S5PV210 uboot顶层mkconfig分析

    转自:http://blog.csdn.net/wqx521/article/details/52491300 ############################################ ...

  2. u-boot顶层Makefile分析

    1.u-boot制作命令 make forlinx_nand_ram256_config: make all; 2.顶层mkconfig分析,参考 U-BOOT顶层目录mkconfig分析 mkcon ...

  3. TQ210 —— S5PV210 uboot顶层Makefile分析

    转自:http://blog.csdn.net/wqx521/article/details/52469759 # (C) Copyright 2000-2008 # Wolfgang Denk, D ...

  4. uboot的mkconfig分析

    uboot的mkconfig是一个shell脚本.对于笔者这种Linux学习初学者,不太可能认真的把shell脚本学习一遍.但是,倘若不能理解mkconfig的含义,又很难从整体的理解uboot(我认 ...

  5. uboot 顶层makefile细节分析

    uboot的源文件众多,学习庞然大物首先找到脊椎--顶层的makfile,逐一破解.但是,uboot的makefile同样是一个庞然大物,所以也要找到它的主线.倘若过分专注部分细节,很难做到把握全局, ...

  6. uboot顶层config.mk分析

    uboot顶层目录中的config.mk定义了确定了当前执行makefile所对应的源文件目录.目标文件目录,编译的程序编译.连接的选项,以及目标文件生成的规则等等.它被包含在顶层的makefile以 ...

  7. u-boot源码分析

    Uboot源码分析 源码以u-boot-1.3.4为基准,主芯片采用at91sam9260,主要介绍uboot执行流程. uboot官网:http://www.denx.de/wiki/U-Boot/ ...

  8. u-boot.2012.10makefile分析,良心博友汇总

    声明:以下内容大部分来自网站博客文章,仅作学习之用1.uboot系列之-----顶层Makefile分析(一)1.u-boot.bin生成过程分析 2.make/makefile中的加号+,减号-和a ...

  9. uboot makefile构建分析

    前言 几年前分析过uboot的构建及启动过程,做了笔记,但最终没有转为文章.这次又有机会开发嵌入式产品了(之前一年多都是在搞x86 linux),看了下uboot的构建过程,觉得有必要写下整个分析过程 ...

随机推荐

  1. Technocup 2017 - Elimination Round 1 (Unofficially Open for Everyone, Rated for Div. 2) C

    This is an interactive problem. You should use flush operation after each printed line. For example, ...

  2. DB2 错误码解析

    DB2 错误代码大全——SQLSTATE 消息   SQLSTATE 消息本节列示 SQLSTATE 及其含义.SQLSTATE 是按类代码进行分组的:对于子代码,请参阅相应的表. 表 2. SQLS ...

  3. jQuery position() 源码解读

    position的代码比较简单... position: function() { if ( !this[ 0 ] ) { return; } var offsetParent, offset, el ...

  4. 使用express+mongoDB搭建多人博客 学习(1) 安装blog工程

    一.安装 1.安装express npm install -g expressnpm install -g express-generator 2.用ejs做模板,新建blog工程express -e ...

  5. [转]AngularJS:何时应该使用Directive、Controller、Service?

    AngularJS是一款非常强大的前端MVC框架.同时,它也引入了相当多的概念,这些概念我们可能不是太熟悉.(译者注:老外真谦虚,我大天朝的码农对这些概念那是相当熟悉啊!)这些概念有: Directi ...

  6. MySql数据库的相关操作

    SQL(Structred Query Language)结构化查询语言:和数据库交互的语言,进行数据库管理的语言. 一.数据库的操作: 1.查询所有数据库: show databases; 2.创建 ...

  7. CSS子元素设置margin-top作用于父容器?

    CSS子元素设置margin-top作用于父容器? 原因: In this specification, the expression collapsing margins means that ad ...

  8. MFC程序添加快捷键

    [问题提出]     有的程序需要自定义组合键完成一定功能,如何实现? [解决方法]     RegisterHotKey函数原型及说明:     BOOL RegisterHotKey(     H ...

  9. Power BI 连接到 Azure 账单,自动生成报表,可刷新

    开始研究Azure官网等,提供的链接都是错误的,躺了很大的一个坑,配置后根本无法获取账单信息,经过多次查询找到了方向,过来记录一下: 错误的地址(应该是适用于全球版,国内版无法这样获取): https ...

  10. 为网站设置icon图标用于显示在浏览器标签页最左侧

    icon图标,想必大家对它并不陌生吧,在浏览网页时会看到浏览器标签页的最左侧会有一个小图标,这个正是icon图标.本例为大家介绍下如何为网站设置这个图标 这句话起什么作用 ?复制代码 代码如下: &l ...