1.问题发现

我在编写内核模块的时候make

zqh@linux:~/lichee/Driver learn/module param$ make
make ARCH=arm     CROSS_COMPILE=arm-linux-gnueabihf- -C /home/zqh/lichee/linux-zero-4.14.y   M=/home/zqh/lichee/Driver_learn/module param    modules
make[1]: Entering directory '/home/zqh/lichee/linux-zero-4.14.y'
make[1]: *** No rule to make target 'param'.  Stop.
make[1]: Leaving directory '/home/zqh/lichee/linux-zero-4.14.y'
Makefile:12: recipe for target 'all' failed
make: *** [all] Error 2

2.问题解决

我发现这个应该是我的文件夹有个空格导致的。我把module param改成module_param就可以了

zqh@linux:~/lichee/Driver_learn/module_param$ make
make ARCH=arm     CROSS_COMPILE=arm-linux-gnueabihf- -C /home/zqh/lichee/linux-zero-4.14.y   M=/home/zqh/lichee/Driver_learn/module_param    modules
make[1]: Entering directory '/home/zqh/lichee/linux-zero-4.14.y'
  CC [M]  /home/zqh/lichee/Driver_learn/module_param/hello.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/zqh/lichee/Driver_learn/module_param/hello.mod.o
  LD [M]  /home/zqh/lichee/Driver_learn/module_param/hello.ko
make[1]: Leaving directory '/home/zqh/lichee/linux-zero-4.14.y'