我正在使用 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
Run Code Online (Sandbox Code Playgroud)
但是当我从内核制作时出现了这个错误:
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.
Run Code Online (Sandbox Code Playgroud)
hello.c
并且makefile
在/Documents/module_prog
. 我make
从那个目录跑了。
是什么导致了这个错误,我该如何解决?
归档时间: |
|
查看次数: |
24765 次 |
最近记录: |