2014-10 u-boot config.mk分析

/**

******************************************************************************

* @author ? ?Maoxiao Hu

* @version ? V1.0.0

* @date ? ? ? Dec-2014

******************************************************************************

* < COPYRIGHT 2014 ISE of SHANDONG UNIVERSITY >

*******************************************************************************

**/

?

Based on u-boot-2014-10.

config.mk的内容并不长,这里全部贴出来吧。

这里以已经执行完make trats_defconfig,在顶层目录已经生成了.config文件为例,说明config.mk中各变量的取值。

?

?15?PLATFORM_RELFLAGS?:=

?16?PLATFORM_CPPFLAGS?:=

?17?PLATFORM_LDFLAGS?:=

?18?LDFLAGS?:=

?19?LDFLAGS_FINAL?:=

?20?OBJCOPYFLAGS?:=

?21?#########################################################################

?22?

?23?ARCH?:=?$(CONFIG_SYS_ARCH:"%"=%)

?24?CPU?:=?$(CONFIG_SYS_CPU:"%"=%)

?25?BOARD?:=?$(CONFIG_SYS_BOARD:"%"=%)

?26?ifneq?($(CONFIG_SYS_VENDOR),)

?27?VENDOR?:=?$(CONFIG_SYS_VENDOR:"%"=%)

?28?endif

?29?ifneq?($(CONFIG_SYS_SOC),)

?30?SOC?:=?$(CONFIG_SYS_SOC:"%"=%)

?31?endif

?32?

?33?# Some architecture config.mk files need to know what CPUDIR is set to,

?34?# so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.

?35?# Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains

?36?# CPU-specific code.

?37?CPUDIR=arch/$(ARCH)/cpu$(if?$(CPU),/$(CPU),)

?38?

?39?sinclude$(srctree)/arch/$(ARCH)/config.mk??# include architecture dependend rules

?40?sinclude$(srctree)/$(CPUDIR)/config.mk ? ??# include? CPU? specific rules

?41?

?42?ifdef?? SOC

?43?sinclude$(srctree)/$(CPUDIR)/$(SOC)/config.mk??# include? SoC? specific rules

?44?endif

?45?ifneq?($(BOARD),)

?46?ifdef?? VENDOR

?47?BOARDDIR?=?$(VENDOR)/$(BOARD)

?48?else

?49?BOARDDIR?=?$(BOARD)

?50?endif

?51?endif

?52?ifdef?? BOARD

?53?sinclude$(srctree)/board/$(BOARDDIR)/config.mk?# include board specific rules

?54?endif

?55?

?56?ifdef?FTRACE

?57?PLATFORM_CPPFLAGS?+= -finstrument-functions -DFTRACE

?58?endif

?59?

?60?#########################################################################

?61?

?62?RELFLAGS?:=?$(PLATFORM_RELFLAGS)

?63?

?64?OBJCOPYFLAGS?+= --gap-fill=0xff

?65?

?66?PLATFORM_CPPFLAGS?+=?$(RELFLAGS)

?67?PLATFORM_CPPFLAGS?+= -pipe

?68?

?69?LDFLAGS?+=?$(PLATFORM_LDFLAGS)

?70?LDFLAGS_FINAL?+= -Bstatic

?71?

?72?export PLATFORM_CPPFLAGS

?73?export RELFLAGS

?74?export LDFLAGS_FINAL

?75?export CONFIG_STANDALONE_LOAD_ADDR

?

?

config.mk被顶层Makefile包含,通过:

include$(srctree)/config.mk

这句话。

?

ARCH?:=?$(CONFIG_SYS_ARCH:"%"=%)

ARCH = “arm”

CPU?:=?$(CONFIG_SYS_CPU:"%"=%)

CPU = “armv7”

BOARD?:=?$(CONFIG_SYS_BOARD:"%"=%)

BOARD = “trats”

?

ifneq?($(CONFIG_SYS_VENDOR),)

?VENDOR?:=?$(CONFIG_SYS_VENDOR:"%"=%)

endif

在这里CONFIG_SYS_VENDOR = “samsung” 所以 VENDOR = “samsung”

?

ifneq?($(CONFIG_SYS_SOC),)

SOC?:=?$(CONFIG_SYS_SOC:"%"=%)

endif

在这里CONFIG_SYS_SOC = “exynos” 所以 SOC = “exynos”

?

CPUDIR=arch/$(ARCH)/cpu$(if?$(CPU),/$(CPU),)

替换已知变量:

CPUDIR=arch/arm/cpu/arm

?

sinclude$(srctree)/arch/$(ARCH)/config.mk??# include architecture dependend rules

sinclude$(srctree)/$(CPUDIR)/config.mk ? ??# include? CPU? specific rules

替换已知变量:

sinclude$(srctree)/arch/arm/config.mk??# include architecture dependend rules

sinclude$(srctree)/arch/arm/cpu/arm/config.mk ? ??# include? CPU? specific rules

?

?

?42?ifdef?? SOC

?43?sinclude$(srctree)/$(CPUDIR)/$(SOC)/config.mk??# include? SoC? specific rules

?44?endif

已定义SOC,替换已知变量:

?43?sinclude$(srctree)/arch/arm/cpu/arm/exynos/config.mk??# include? SoC? specific rules

?

?45?ifneq?($(BOARD),)

?46?ifdef?? VENDOR

?47?BOARDDIR?=?$(VENDOR)/$(BOARD)

?48?else

?49?BOARDDIR?=?$(BOARD)

?50?endif

?51?endif

BOARD变量不为空,且已定义VENDOR,替换已知变量:

?47?BOARDDIR?=?samsung/trats

?

?52?ifdef?? BOARD

?53?sinclude$(srctree)/board/$(BOARDDIR)/config.mk?# include board specific rules

?54?endif

已定义BOARD,替换已知变量:

?53?sinclude$(srctree)/board/samsung/trats/config.mk?# include board specific rules

?

其它编译选项就不做解释了。

时间: 2024-10-12 16:06:37

2014-10 u-boot config.mk分析的相关文章

uboot顶层config.mk分析

## (C) Copyright 2000-2006# Wolfgang Denk, DENX Software Engineering, [email protected]## See file CREDITS for list of people who contributed to this# project.## This program is free software; you can redistribute it and/or# modify it under the terms

u-boot顶层目录config.mk分析

1. 设置obj与src ifneq ($(OBJTREE),$(SRCTREE)) ifeq ($(CURDIR),$(SRCTREE)) dir := else dir := $(subst $(SRCTREE)/,,$(CURDIR)) endif obj := $(if $(dir),$(OBJTREE)/$(dir)/,$(OBJTREE)/) src := $(if $(dir),$(SRCTREE)/$(dir)/,$(SRCTREE)/) $(shell mkdir -p $(o

关于s5pv210的配置、编译过程中相关文件的分析(Makefile、config.mk、mkconfig)

uboot为用户提供两种编译方式,一种是在uboot当前目录下进行编译,第二种方式就是将编译生成的文件输出到指定的目录下. 1) Add O= to the make command line # 'make O=/tmp/build all' # # 2) Set environement variable BUILD_DIR to point to the desired location # 'export BUILD_DIR=/tmp/build' # 'make' # # The se

u-boot的Makefile分析之顶层config.mk

版本信息: u-boot-2010-06 顶层目录下的config.mk文件主要完成如下功能的配置: 1.确定生成可执行文件过程中需要的各种工具,如编译器(arm-linux-gcc).连接器(arm-linux-ld).反汇编器(arm-linux-objdump)等 2.确定CPU.板相关的配置文件,存在于各个目录下的config.mk 3.确定编译.链接.转换等过程的操作选项 4.根据步骤3确定的编译连接选项生成需要的文件 config.mk完整内容及必要注释如下 注:config.mk文

nova boot代码流程分析(五):VM启动从neutron-dhcp-agent获取IP与MAC

1.   network和subnet创建代码流程 [[email protected] ~(keystone_user1)]# neutron net-create demo-net [[email protected] ~(keystone_user1)]# neutron subnet-create  demo-net 1.1.1.0/24 --name demo-subnet --gateway 1.1.1.1 --enable_dhcp true 这里,我们主要分析上面两个命令的代码流

Linux - Eclipse CDT + GCC 安装(2014.10.2)

Eclipse CDT + GCC 安装 (2014.10.2) 本文地址:http://blog.csdn.net/caroline_wendy 1. 安装Eclipse,在官方网站下载Eclipse标准版(Linux平台)即可,解压到当前文件夹. 2.  下载JDK,选择Linux32位,即可,解压默认目录:jdk1.8.0_20 ; 把文件夹复制到jvm中. sudo cp -r ~/jdk1.8.0_20/ /usr/lib/jvm/ ; 3. 修改配置文件(profile): # 配置

nova boot代码流程分析(三):nova与neutron的交互(2)

继续<nova boot代码流程分析(三):nova与neutron的交互(1)>的分析. #/nova/virt/libvirt/driver.py:LibvirtDriver # NOTE(ilyaalekseyev): Implementation like in multinics # for xenapi(tr3buchet) def spawn(self, context, instance, image_meta, injected_files, admin_password,

Debug目录、Release目录,bin目录、obj目录,vshost.exe.config文件、.exe.config文件分析【C#】

Debug目录.Release目录,bin目录.obj目录,vshost.exe.config文件..exe.config文件分析[C#] 2013-10-06  孤风卓影  摘自 csdn博客  阅 558  转 4 转藏到我的图书馆 微信分享: 今天写程序的时候,需要更改.exe.config文件中的引用的webservice地址,用vs调试的时候,发现会修改vshost.exe.config中的对应项,.exe.config中的对应项是不会修改的,这样会导致在软件重启的情况下,.exe.c

个人回忆录 2014.10.20 至 2015.7.30

时间过的太快.以至于对我来说都记不起来每天做了些什么事情.工作节奏太快,下班.上班 然后再下班再上班. 每天下班后都晚上9点左右.真的看不见日出看不见日落. 从2014.10.20 到现在已经快10个月了.新的工作环境以及新的同事.上司都已熟悉了.回想刚刚开始进入这个研发团队的时候. 高原反应非常强烈,总是在疑问自己为何选择这个方向—C++ 客户端开发.为何不沿用最熟悉的.NET 平台开发.当从新学习一门新技术的时候 才发现自己太笨.有点像当年的高考,时间很紧.因为没有太多的时间用在学习上.MF