编译linux模块dtoped,并且不返回cuch文件或目录?使文件cann';t查找/lib/modules/<;版本>/建造

编译linux模块dtoped,并且不返回cuch文件或目录?使文件cann';t查找/lib/modules/<;版本>/建造,linux,linux-kernel,Linux,Linux Kernel,我编写了一个helloworld模块,并构建了Make文件来编译它 Makefile源代码: obj-m +=hello-1.o all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules clean: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean 通过发出make命令编译模块,并给出以下结果 make -C /lib/

我编写了一个helloworld模块,并构建了Make文件来编译它

Makefile源代码:

obj-m +=hello-1.o
all:
       make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
       make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
通过发出make命令编译模块,并给出以下结果

make -C /lib/modules/3.3.4-5.fc17.i686/build M=/home/user/MyModules/hello-1 modules
make: *** /lib/modules/3.3.4-5.fc17.i686/build: No such file or directory. Stoped.
make: *** [all] Error 2
enter code here
而文件实际上是存在的

为什么Makefile找不到该文件

  • 注意:我用的是软呢帽17

是的,我有。我安装了它
ls-l/lib/modules/3.3.4-5.fc17.i686/build/
的输出是什么?