QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1980|回复: 11

关于Makefile的问题

[复制链接]
发表于 2003-5-16 10:54:50 | 显示全部楼层 |阅读模式
是不是在编写内核程序的时候,里面的Makefile都是自己写的,都不是用工具生成的吧,因为里面的Makefile如此简洁。
还有在Makefile中出现的下面的几个变量,我不太理解他们的含义,用来干什么的,什么时候能够用到,请大虾们能够解释一下,谢谢!

all:

EXTRA_CFLAGS +=

subdir-NNNNNN

export-objs :=
发表于 2003-5-16 11:30:39 | 显示全部楼层
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.
回复

使用道具 举报

发表于 2003-5-16 11:47:18 | 显示全部楼层
这个documentation在什么地方可以得到?

斑竹在编写内核程序的时候,Makefile文件是自己写的吗?

比如我在内核中新建了一个文件夹,里面的文件都是我自己建立的,那我就一定要在这个文件夹里面建一个Makefile了,那就要白手起家写一个Makefile了。现有的linux内核中的Makefile文件都是编写者自己写的吧,因为好像这些Makefile比自动由工具生成的简洁
回复

使用道具 举报

发表于 2003-5-16 21:29:03 | 显示全部楼层
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.
回复

使用道具 举报

发表于 2003-5-28 17:42:46 | 显示全部楼层
GNU Makefile Manual is a good document
回复

使用道具 举报

发表于 2003-5-28 21:26:40 | 显示全部楼层
yes, but seldom have people read that carefully.
回复

使用道具 举报

发表于 2003-6-3 09:10:11 | 显示全部楼层
我还真是阅读了GNU makefile的一部分,可是阅读到中间,发现和内核中的不太一样,所以我认为如果针对内核的话,最好像dragonfly说的,阅读/Documentation/kbuild/makefiles.txt就可以,很不错的。
回复

使用道具 举报

发表于 2003-6-3 09:19:31 | 显示全部楼层
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.
回复

使用道具 举报

发表于 2003-6-3 09:43:13 | 显示全部楼层
GNU Makefile和Kernel 里面的makefile没有什么分歧的地方,只不过对象不同,GNU Makefile不是面向内核的,所以内核中出现的那么多的变量的名字在GNU Makefile中就不会讲到,所以看起来很不爽,也就是说看过之后,再看内核中的Makefile还是看不懂。

我想内核的应该还是遵从GNU Makefile,只不过有内核的实际情况,所以就是毛泽东思想是把马克思主义同中国实际相结合的产物的意思。   

好像没有什么可以认真对比的 个人意见   
回复

使用道具 举报

发表于 2003-6-3 09:56:44 | 显示全部楼层
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 task  and 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.     
回复

使用道具 举报

发表于 2003-6-3 11:09:19 | 显示全部楼层
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.
回复

使用道具 举报

发表于 2003-6-4 10:02:17 | 显示全部楼层
thx so much. u are a so nice guy (mm? better)
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-6-29 13:09 , Processed in 0.072742 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表