最近在移植uboot支持nandflash的过程中,我遇到了一个错误,困扰了我两天。经过仔细查找,终于找到了问题所在。以下是具体的错误信息:
make[1]: *** No rule to make target '.depend.s3c2440_nand', needed by '.depend'. Stop.make[1]: Leaving directory '/work/system/u-boot-2012.04.01/drivers/mtd/nand'Makefile:485: recipe for target 'drivers/mtd/nand/libnand.o' failedmake: *** [drivers/mtd/nand/libnand.o] Error 2
这个错误大致意思是在链接libnand.o时找不到s3c2440_nand的依赖文件。接着,我仔细检查了Makefile,确保已经在Makefile中添加了s3c2440_nand.c的依赖文件,如图所示:
![make[1]: *** No rule to make target ‘.depend.XXXX‘, needed by ‘.XX‘. Stop.解决](https://www.chuangxiangniao.com/wp-content/themes/justnews/themer/assets/images/lazy.png)
然后,我考虑是否是代码编写错误。对照自己修改的部分如下:
![make[1]: *** No rule to make target ‘.depend.XXXX‘, needed by ‘.XX‘. Stop.解决](https://www.chuangxiangniao.com/wp-content/themes/justnews/themer/assets/images/lazy.png)
![make[1]: *** No rule to make target ‘.depend.XXXX‘, needed by ‘.XX‘. Stop.解决](https://www.chuangxiangniao.com/wp-content/themes/justnews/themer/assets/images/lazy.png)
![make[1]: *** No rule to make target ‘.depend.XXXX‘, needed by ‘.XX‘. Stop.解决](https://www.chuangxiangniao.com/wp-content/themes/justnews/themer/assets/images/lazy.png)
![make[1]: *** No rule to make target ‘.depend.XXXX‘, needed by ‘.XX‘. Stop.解决](https://www.chuangxiangniao.com/wp-content/themes/justnews/themer/assets/images/lazy.png)
![make[1]: *** No rule to make target ‘.depend.XXXX‘, needed by ‘.XX‘. Stop.解决](https://www.chuangxiangniao.com/wp-content/themes/justnews/themer/assets/images/lazy.png)
经过多次检查,发现代码并没有错误。宏开关也都已打开,初始化、内存、寄存器等都已配置。如果是代码错误,编译不应该报这样的错误。通过Google查找了一些文章,解决方法各不相同,但问题都出在Makefile上。最后确定是Makefile的问题,可能是我没有发现。以下是参考的文章:
https://www.php.cn/link/d4366c47a957a1d968dc4fde9667a5behttps://www.php.cn/link/a0ebcccf66dc4549dbb225f31ceb4dab
仔细检查s3c2440_nand.c的文件名,也确认没有写错。
![make[1]: *** No rule to make target ‘.depend.XXXX‘, needed by ‘.XX‘. Stop.解决](https://www.chuangxiangniao.com/wp-content/themes/justnews/themer/assets/images/lazy.png)
![make[1]: *** No rule to make target ‘.depend.XXXX‘, needed by ‘.XX‘. Stop.解决](https://www.chuangxiangniao.com/wp-content/themes/justnews/themer/assets/images/lazy.png)
灵云AI开放平台
灵云AI开放平台
150 查看详情
接着,我重新复制Windows下的文件名到Makefile中,更改.o依赖的名字,发现多了一个空格。
![make[1]: *** No rule to make target ‘.depend.XXXX‘, needed by ‘.XX‘. Stop.解决](https://www.chuangxiangniao.com/wp-content/themes/justnews/themer/assets/images/lazy.png)
第一次修改时,我没有注意到这个空格,所以我将其删除了。今天才发现这里有问题,接着删除了Windows下的文件和Ubuntu下Makefile中的空格符号,编译就通过了。
![make[1]: *** No rule to make target ‘.depend.XXXX‘, needed by ‘.XX‘. Stop.解决](https://www.chuangxiangniao.com/wp-content/themes/justnews/themer/assets/images/lazy.png)
真是太大意了。这个错误困扰了我两天。第一天我仔细检查了代码,Google查找资料,但没有解决。今天再次拿出来看,才发现了这个错误。有时候错误并不能一眼看出来。换个时间再回来看,或许会有不一样的结果!
以上就是make[1]: *** No rule to make target ‘.depend.XXXX‘, needed by ‘.XX‘. Stop.解决的详细内容,更多请关注创想鸟其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/749956.html
微信扫一扫
支付宝扫一扫