我已经开始编写设备驱动程序,并编写了第一个字符驱动程序,并得到了编译错误:
scripts/Makefile.build:44: /home/betatest/Public/Device-Driver-Test/first-driver/Makefile: No such file or directory
make[2]: *** No rule to make target '/home/betatest/Public/Device-Driver-Test/first-driver/Makefile'. Stop.
Makefile:1448: recipe for target '_module_/home/betatest/Public/Device-Driver-Test/first-driver' failed
make[1]: *** [_module_/home/betatest/Public/Device-Driver-Test/first-driver] Error 2
make[1]: Leaving directory '/usr/src/kernels/2.6.32-573.12.1.el6.x86_64'
makefile:19: recipe for target 'default' failed
make: *** [default] Error 2我的make文件名是"makefile"?在研究makefile时,我们认为makefile的默认名称可以是、makefile、或makefile,这对于make实用程序没有什么影响。设备驱动程序makefile的名称重要吗?设备驱动程序的Makefile名称应该强制为"Makefile“吗?如果是的话,为什么?
任何帮助都将不胜感激。
发布于 2016-01-02 14:49:44
脚本没有使用默认名称运行make。脚本给出的是不存在的-f /home/betatest/Public/Device-Driver-Test/first-driver/Makefile。
发布于 2016-01-02 20:12:16
在研究makefile时,写到make文件的默认名称可以是Makefile或makefile,但是make实用程序没有区别。
够真实的。当您调用make命令时,它知道查找Makefile或makefile中的任何一个。
但是,可能还有其他原因导致您看到这个错误。脚本有可能使用显式的make参数调用-f来查找Makefile。看看44中的scripts/Makefile.build行。
发布于 2016-01-07 03:22:19
当您使用make实用程序时,它将按照GNUmakefile、makefile和Makefile.First名称的顺序进行搜索,因为在使用GNU实用程序时应该使用它。对于makefile的非标准名称,可以使用make实用程序指定-file或make。
看起来,行44有错误.Try来编译带有-f选项的makefile。
https://stackoverflow.com/questions/34567052
复制相似问题