关于Makefile的问题
是不是在编写内核程序的时候,里面的Makefile都是自己写的,都不是用工具生成的吧,因为里面的Makefile如此简洁。还有在Makefile中出现的下面的几个变量,我不太理解他们的含义,用来干什么的,什么时候能够用到,请大虾们能够解释一下,谢谢!
all:
EXTRA_CFLAGS +=
subdir-NNNNNN
export-objs := i am not sure. i think there are not generated by auto conf.
pls read the Documentation/kbuild/makefile.txt to know everything plus more. 这个documentation在什么地方可以得到?
斑竹在编写内核程序的时候,Makefile文件是自己写的吗?
比如我在内核中新建了一个文件夹,里面的文件都是我自己建立的,那我就一定要在这个文件夹里面建一个Makefile了,那就要白手起家写一个Makefile了。现有的linux内核中的Makefile文件都是编写者自己写的吧,因为好像这些Makefile比自动由工具生成的简洁 in u kernel source code.
yes, i write code by myself
yes, u are right. u can see other makefile to know how to write a one. u had better write kernel module first instead of add code to kernel directly. easy for debugging.
btw, i will move this post to another kernel branch. this is only for kernel code reading. GNU Makefile Manual is a good document yes, but seldom have people read that carefully. 我还真是阅读了GNU makefile的一部分,可是阅读到中间,发现和内核中的不太一样,所以我认为如果针对内核的话,最好像dragonfly说的,阅读/Documentation/kbuild/makefiles.txt就可以,很不错的。 really? u read so carefully. i just browse it.
can u post the difference here? for example, gnu make manual page xx said ..., while linux makefile ....
then we can have a comparison and judge. thx. GNU Makefile和Kernel 里面的makefile没有什么分歧的地方,只不过对象不同,GNU Makefile不是面向内核的,所以内核中出现的那么多的变量的名字在GNU Makefile中就不会讲到,所以看起来很不爽,也就是说看过之后,再看内核中的Makefile还是看不懂。
我想内核的应该还是遵从GNU Makefile,只不过有内核的实际情况,所以就是毛泽东思想是把马克思主义同中国实际相结合的产物的意思。 :lol::lol:
好像没有什么可以认真对比的 :o 个人意见 :lol::lol: hehe. that is what i mean. kernel will not create a new make variant. it will follow the makefile. but the problem is as u said. so read that kbuild/... is easier to understand. but anyway, u need basic knowledge about make before that file.
xdwjack, can u use the main Makefile, one or two Makefile under subdir, and the Rules.make to explain how kernel compile the files? pls, accept this taskand it will force u to read it more carefully and then gain more. after that, u feedback what u learn here.
thanks in advance, and bow. :-D:-D:-D ok,I am willing to accept this task.
perhaps it will take some time (perhaps a long time) .
i will try my best to do it as soon as possible. thx so much. u are a so nice guy (mm? better)
页:
[1]