QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

楼主: Dragonfly

hello world module for LK26

[复制链接]
发表于 2004-9-26 16:14:27 | 显示全部楼层
make V=1是什么指令能给解释一下吗?

我以前只知道有-d,V=1我在gnu make的文档里怎么也没找到。
回复

使用道具 举报

发表于 2004-10-6 03:02:35 | 显示全部楼层
@@
什么东东
全是E文
回复

使用道具 举报

发表于 2004-12-19 12:01:41 | 显示全部楼层
写了一个简化的Makefile来编译test.c ,过程就是:
gcc test.c -c  -D__KERNEL__ -DMODULE 生成test.o
/usr/src/linux/scripts/modpost test.o 来对test.o进行处理生成test.mod.c
gcc test.mod.c -c -D__KERNEL__ -DMODULE 来生成test.mod.o
ld -r test.o test.mod.o -o test.ko 来得到最终的模块文件test.ko
Makefile内容如下:

CFLAGS = -D__KERNEL__ -DMODULE
MP=/usr/src/linux/scripts/modpost

test.ko : test.o test.mod.c
        $(CC)  $(CFLAGS) test.mod.c  -c
        $(LD) -r test.o test.mod.o -o $@
        rm -f test.mod.*

test.mod.c : test.o
        $(MP) test.o
回复

使用道具 举报

发表于 2005-4-27 11:37:11 | 显示全部楼层
good discussion.
I find the information I need.
Thanks all.
回复

使用道具 举报

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

本版积分规则

GMT+8, 2024-5-14 05:15 , Processed in 0.085412 second(s), 13 queries .

© 2021 Powered by Discuz! X3.5.

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