Android 学习笔记(七) U-Boot的配置与编译

1          配置与编译

1.1       经典方法

以编译 smdk2410开发板 为例:

make distclean       // 清除所有痕迹

make smdk2410_config // 配置U-Boot参数为smdk2410的参数,对应配置参数见include/configs/smdk2410.h。这些配置参数的含义可部分参考U-Boot根目录下的Readme

make all   // 编译U-boot及内带的工具

 

另外,如下集成命令可能更加方便:

make smdk2410     // 功能同下面几个命令的集合:

make unconfig

make smdk2410_config

make       // Makefile中第一个目标为 all, 所以make 命令等同于 make all

1.2       编译到其它目录

默认U-boot将编译生成的文件与其源文件放置一起,使用如下两种方法之一可将编译生成的obj文件、最终文件等放置于其它目录下。

1.         Add O= to the make command line invocations

make O=/tmp/build distclean
make O=/tmp/build canyonlands_config
make O=/tmp/build all

Note that if the 'O=output/dir' option is used then it must be used for all invocations of make.

2.         Set environment variable BUILD_DIR to point to the desired location:

export BUILD_DIR=/tmp/build
make distclean
make canyonlands_config
make all

3. 我自己的处理方式:修改Makefile,省得经常要多敲字符

ifdef O

ifeq ("$(origin O)", "command line")

BUILD_DIR := $(O)

endif

else  # Alex.shi, 20100613

BUILD_DIR := build

endif

需要特别注意的是:命令行的"O="设置回覆盖环境变量BUILD_DIR的设置。

1.3      镜像格式

make all命令执行后,将生成如下三种镜像格式:

Ø       "u-boot.bin" is a raw binary image

Ø       "u-boot" is an image in ELF binary format

Ø       "u-boot.srec" is in Motorola S-Record format

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值