简体   繁体   English

在使用gnu make时如何解决错误同时包含:和::条目

[英]How to address the error has both : and :: entries while using gnu make

I am trying to port a new module into my project. 我正在尝试将新模块移植到我的项目中。 The module has its own make file. 该模块具有其自己的make文件。 I have no background or experience with the make build system, so I decided to use the following command: 我没有make构建系统的背景或经验,因此我决定使用以下命令:

make -f Makefile -f ../newmodule/tbt/makefile

But I get the following errors: 但是我收到以下错误:

../newmodule/tbt/makefile:14: make/macros.mk: No such file or directory ../newmodule/tbt/makefile:66: *** target file `all' has both : and :: entries. ../newmodule/tbt/makefile:14:make / macros.mk:无此类文件或目录../newmodule/tbt/makefile:66:***目标文件all都具有:和::条目。 Stop. 停止。

Please correct me if I am wrong; 如果我错了,请纠正我; it is my understanding that my first error is because I issued make from my main project, and I need to somehow configure it to look into the directory of ../newmodule/tbt/make to find macros.mk . 据我了解,我的第一个错误是因为我从主项目中发布了make,并且我需要以某种方式对其进行配置以查看../newmodule/tbt/make的目录以查找macros.mk Would anyone be able to suggest an effective way of addressing this issue? 任何人都可以提出解决此问题的有效方法吗? What is the best way to include the contents of ../newmodule/tbt/make folder? 包括../newmodule/tbt/make文件夹内容的最佳方法是什么?

My 2nd error seems to be exactly what make complains about, which is having : and :: in the two make files for the target "all" . 我的第二个错误似乎正是make抱怨的地方,在目标文件"all"的两个make文件中都有:和::。 I can not follow the 2nd make file very closely, but there is not much to the lines that have this target. 我不能非常仔细地跟踪第二个make文件,但是具有此目标的行并不多。 I am thinking of changing it to My_all , and configure this new variable as the default target of the new module. 我正在考虑将其更改为My_all ,并将此新变量配置为新模块的默认目标。 I am not even sure if my terminology is correct. 我什至不确定我的术语是否正确。 "all" is called the default target for make right? “全部”被称为make right的默认目标吗? I have reviewed most of the make file document, but it is 5 am, and I do not recall some things. 我已经查看了大部分制作文件文档,但是已经是凌晨5点了,我不记得有什么事情了。

I came across this error during compilation of some package under OpenWrt. 我在OpenWrt下编译某些软件包时遇到了此错误。 The problem was in the VERSION declaration in the Makefile. 问题出在Makefile的VERSION声明中。

So, check if you have declared anything with unnecessary spaces or comments after some variable. 因此,请检查是否在某个变量之后声明了带有不必要空格或注释的任何内容。

Removing the comment or space after variables should work. 在变量后删除注释或空格应该起作用。

尝试运行两个单独的make -f myMakefile命令,每个模块目录中的命令一个,以便相对路径正确工作,因为您已经发现执行make时当前目录可能是问题的一部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM