Mk文件语法规则

Makefile 语法分析 第一部分

VERSION = 2
给变量VERSION赋值
PATCHLEVEL = 6
给变量PATCHLEVEL赋值
SUBLEVEL = 22
给变量SUBLEVEL赋值
EXTRAVERSION = .6
给变量EXTRAVERSION赋值
NAME = Holy Dancing Manatees, Batman!
给变量NAME赋值
DOCUMENTATION

# To see a list of typical targets execute "make help"
# More info can be located in ./README
# Comments in this file are targeted only to the developer, do not
# expect to learn how to build the kernel reading this file.
# Do not:
# o use make's built-in rules and variables
#    (this increases performance and avoid hard-to-debug behavour);
# o print "Entering directory ...";
MAKEFLAGS += -rR --no-print-directory

操作符“+=”的作用是给变量(“+=”前面的MAKEFLAGS)追加值。
如果变量(“+=”前面的MAKEFLAGS)之前没有定义过,那么,“+=”会自动变成“=”
如果前面有变量(“+=”前面的MAKEFLAGS)定义,那么“+=”会继承于前次操作的赋值符;
如果前一次的是“:=”,那么“+=”会以“:=”作为其赋值符
在执行make时的命令行选项参数被通过变量 “MAKEFLAGS”传递给子目录下的make程序。
对于这个变量除非使用指示符“unexport”对它们进行声明,它们在整个make的执行过程中始终被自动的传递给所有的子make。
还有个特殊变量SHELLMAKEFLAGS一样,默认情况(没有用“unexport”声明)下在整个make的执行过程中被自动的传递给所有的子make。

#
 -rR --no-print-directory
 -r disable the built-in impilict rules. 
 -R disable the built-in variable setttings. 
 --no-print-directory。

 We are using a recursive build, so we need to do a little thinking
 to get the ordering right.
#
 Most importantly: sub-Makefiles should only ever modify files in
 their own directory. If in some directory we have a dependency on
 a file in another dir (which doesn't happen often, but it's often
 unavoidable when linking the built-in.o targets which finally
 turn into vmlinux), we will call a sub make in that other dir, and
 after that we are sure that everything which is in that other dir
 is now up to date.
#
 The only cases where we need to modify files which have global
 effects are thus separated out and done before the recursive
 descending is started. They are now explicitly listed as the
 prepare rule.
 To put more focus on warnings, be less verbose
  • 0
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值