这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 嵌入式开发 » MCU » 问题求助----编译Linux2.6模块

共2条 1/1 1 跳转至

问题求助----编译Linux2.6模块

菜鸟
2005-09-21 01:08:06     打赏

我采用了最简单的用于测试的模块程序。Makefile内容如下:

ifneq ($(KERNELRELEASE),)
obj-m := test.o
else
KERNELDIR ?= /usr/src/arm/linux
default:
$(MAKE) $(MAKEARGS) -C $(KERNELDIR) SUBDIRS=$(shell pwd) modules
endif

运行make命令时,出现信息:

make -C /usr/src/arm/linux SUBDIR=/home/scripts/leds/mod modules
make[1]: Entering directory `/usr/src/arm/linux'
CHK include/linux/version.h
make[2]: `arch/arm/kernel/asm-offsets.s' is up to date.
make[2]: `include/asm-arm/mach-types.h' is up to date.
Building modules, stage 2.
MODPOST
make[1]: Leaving directory `/usr/src/arm/linux'

本来还应出现另外三行信息

CC /home/scripts/leds/mod/test.o

CC /home/scripts/leds/mod/test.mod.o
LD [M] /home/scripts/leds/mod/test.ko

但是编译时没有出现,也就是当前目录下的模块文件没有被编译,请问是怎么回事?

[align=right][color=#000066][此贴子已经被作者于2005-9-20 17:19:02编辑过][/color][/align]



关键词: 问题     求助     编译     Linux2.6     模块    

菜鸟
2005-09-23 22:55:00     打赏
2楼

问题解决了

应该是SUBDIRS=...,或者M=...

另外有一点要注意,一定要写成Makefile,不能是makefile.也是2.6的新规矩吧


共2条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]