uboot主Makefile分析2

本文介绍了如何在编译过程中实现静默编译,并探讨了两种编译输出管理方法:在同一文件夹下生成编译文件及指定独立的输出目录。文章通过具体实例展示了编译配置过程及其常见错误。

《朱老师物联网大讲堂》学习笔记

学习地址:www.zhulaoshi.org


# Allow for silent builds
ifeq (,$(findstring s,$(MAKEFLAGS)))
XECHO = echo
else
XECHO = :
endif

这里是关于静默编译的,

那什么是静默编译,

也就是执行脚本的时候,不去回显命令的执行,

编译时侯make -s即可,

这里-s作为MAKEFLAGS传给Makefile,


两种编译管理方法,

默认编译XX.c生成的XX.O会在同一文件夹下,这样做简单,但是会污染源文件,

如果项目涉及不同配置的版本,就无法使用这种方式来管理,

于是就出现了单独输出文件夹的方法,

即指定一个输出目录,

make O=输出目录,

或者

export BUILD DIR=输出目录,

这两种方式同时使用的话,按前一种来理解,

下面是配置代码:

#########################################################################
#
# U-boot build supports producing a object files to the separate external
# directory. Two use cases are supported:
#
# 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 second approach can also be used with a MAKEALL script
# 'export BUILD_DIR=/tmp/build'
# './MAKEALL'
#
# Command line 'O=' setting overrides BUILD_DIR environent variable.
#
# When none of the above methods is used the local build is performed and
# the object files are placed in the source directory.
#


然后我们去这么做的时候,报错了,

看readme中的介绍,

1. Add O= to the make command line invocations:


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

不过好像还是没成功,



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值