我正在使用Ubuntu 12.04。我编写了一个简单的hello world内核模块(hello.c)。我为它编写了以下makefile:
obj-m+=hello.o
KDIR:= /usr/src/linux-headers-3.2.0-24-generic-pae
all:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
clean:
rm -rf *.o *.ko *.mod.* *.symvers *.order
但是当我从内核进行编译时,出现了这个错误:
make[1]: Entering directory `/usr/src/linux-headers-3.2.0-24-generic-pae'
make[2]: *** No rule to make target `arch/x86/tools/relocs.c', needed
by `arch/x86/tools/relocs'. Stop.
hello.c
和makefile
位于/Documents/module_prog
目录中。我从该目录运行了make
命令。
是什么导致了这个错误,我该如何修复它?
SUBDIRS=$(PWD)
不存在。 - Salem F