欢迎来到天天文库
浏览记录
ID:42605557
大小:46.03 KB
页数:34页
时间:2019-09-18
《linux 顶层makefile分析》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、Linux顶层Makefile文件分析分类: Linux系列2013-05-0617:05 585人阅读 评论(0) 收藏 举报1、makemenuconfigVERSION=2PATCHLEVEL=6SUBLEVEL=26EXTRAVERSION=NAME=RotaryWombat#*DOCUMENTATION*#Toseealistoftypicaltargetsexecute"makehelp"#Moreinfocanbelocatedin./README#Commentsinthisfilea
2、retargetedonlytothedeveloper,donot#expecttolearnhowtobuildthekernelreadingthisfile.#Donot:#o usemake'sbuilt-inrulesandvariables# (thisincreasesperformanceandavoidshard-to-debugbehaviour);#o print"Enteringdirectory...";MAKEFLAGS+=-rR--no-print-direc
3、tory #-r禁止使用build-in规则#--no-print-directory是:不要再屏幕上打印"Enteringdirectory.."#记住变量SHELL,MAKEFLAGS在整个make的执行过程中#始终被自动的传递给所有的子make #Weareusingarecursivebuild,soweneedtodoalittlethinking#togettheorderingright.##Mostimportantly:sub-Makefilesshouldonlyevermodif
4、yfilesin#theirowndirectory.Ifinsomedirectorywehaveadependencyon#afileinanotherdir(whichdoesn'thappenoften,butit'soften#unavoidablewhenlinkingthebuilt-in.otargetswhichfiny#turnintovmlinux),wewillcallasubmakeinthatotherdir,and#afterthatwearesurethateveryt
5、hingwhichisinthatotherdir#isnowuptodate.##Theonlycaseswhereweneedtomodifyfileswhichhaveglobal#effectsarethusseparatedoutanddonebeforetherecursive#descendingisstarted.Theyarenowexplicitlylistedasthe#preparerule.#Toputmorefocusonwarnings,belessverboseasde
6、fault#Use'makeV=1'toseethefullcommands ifdefV #v=1 ifeq("$(originV)","commandline") KBUILD_VERBOSE=$(V) #把V的值作为KBUILD_VERBOSE的值 endifendififndefKBUILD_VERBOSE #即默认我们是不回显的 #回显即在命令执行前显示要执行的命令 KBUILD_VERBOSE=0 endif#函数origin并不操作变量的值,只是告诉
7、你你的这个变量是哪里来的。#语法是:$(origin;)#origin函数的返回值有:#"undefined"从来没有定义过、“default”是一个默认的定义、“#"environment"是一个环境变量、#"file"这个变量被定义在Makefile中#"commandline"这个变量是被命令行定义的#"override"是被override指示符重新定义的#"automatic"是一个命令运行中的自动化变量#Callasourcecodechecker(bydefault,"sparse")a
8、spartofthe#Ccompilation.调用一个静态分析工具作为c编译器的#部分#Use'makeC=1'toenablecheckingofonlyre-compiledfiles.#Use'makeC=2'toenablecheckingof*all*sourcefiles,regardless#ofwhethertheyarere-compiledornot.##Seethefile"Documentation/sparse.txt"for
此文档下载收益归作者所有