驱动代码编译不过在,怎么回事啊?

make
make -C /work/system/linux-2.6.22.6 M=`pwd` modules
make[1]: Entering directory '/work/system/linux-2.6.22.6'
Makefile:1443: *** mixed implicit and normal rules: deprecated syntax

  ERROR: Kernel configuration is invalid.
         include/linux/autoconf.h or include/config/auto.conf are missing.
         Run 'make oldconfig && make prepare' on kernel src to fix it.


  WARNING: Symbol version dump /work/system/linux-2.6.22.6/Module.symvers
           is missing; modules will have no dependencies and modversions.

  CC [M]  /work/hardware/drive/led_drive/test/first_drv.o
cc1: fatal error: include/linux/autoconf.h: No such file or directory
compilation terminated.
scripts/Makefile.build:208: recipe for target '/work/hardware/drive/led_drive/test/first_drv.o' failed
make[2]: *** [/work/hardware/drive/led_drive/test/first_drv.o] Error 1
Makefile:1198: recipe for target '_module_/work/hardware/drive/led_drive/test' failed
make[1]: *** [_module_/work/hardware/drive/led_drive/test] Error 2
make[1]: Leaving directory '/work/system/linux-2.6.22.6'
Makefile:4: recipe for target 'all' failed
make: *** [all] Error 2


请先 登录 后评论

2 个回答

百问网-黄老师
擅长:嵌入式开发

1.问题标题请写清楚

2.详细描述做了哪些操作        

请先 登录 后评论
星星之火 - 嵌入式工程师
擅长:答疑助手

你需要先编译内核通过后 再编译驱动。

且驱动makefile里面的内核路径要是刚编译好的内核路径

请先 登录 后评论
  • 2 关注
  • 0 收藏,71 浏览
  • marshal 提出于 2020-10-29 15:01

相似问题