发生错误:***多个目标模式。停止
这是我第一次在此处发布,很抱歉,如果这最终出现在错误的地方。我正在尝试编译我从GitHub存储库中下载的一些代码,并从MSYS Shell运行。具有共同制定规则的Makefile存在问题。当我运行时,我会收到以下错误: C:\ MIOS32/include/makefile/common.mk:143:***多个目标模式。停止。
由于我是制造和制造的完整初学者,因此我找不到问题。这是Common.mk文件从第152行到154的代码:
# rule to create .elf file
$(PROJECT_OUT)/$(PROJECT).elf: $(ALL_OBJS)
@$(CC) $(CFLAGS) $(ALL_OBJS) $(LIBS) $(LDFLAGS) -o$@
LMK如果我需要上传整个Common Makefile。谢谢
this is my first time posting here, so sorry if this ends up in the wrong place. I am trying to compile some code I've downloaded from a GitHUb repository and am running make from the MSYS Shell. There is a problem with the makefile that has the common make rules. When I run make, I get the following error:
C:\Mios32/include/makefile/common.mk:143: *** multiple target patterns. Stop.
Since I'm a complete beginner with regard to make and makefile, I can't find the problem. Here's the code from common.mk file from line 152 to 154:
# rule to create .elf file
$(PROJECT_OUT)/$(PROJECT).elf: $(ALL_OBJS)
@$(CC) $(CFLAGS) $(ALL_OBJS) $(LIBS) $(LDFLAGS) -o$@
Lmk if I need to upload the whole common makefile. Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在。
此错误意味着您有一个静态模式规则,目标中具有多种模式(
%
字符)。您的行在这里:知道问题是什么的唯一方法是找到
project_out
,project
和all_objs
variables的值。毫无疑问,它们包含结肠字符和/或百分比字符。make
程序是在Unix上开发的一种工具,恰好在“驱动程序”,后斜线为目录分离器等。因此,它的语法针对:
在路径名中不期望的Unix系统,BackSlash是一个逃生字符,等等。 /linux和macOS,您必须做一些在它们之间翻译路径名的工作。使用Makefiles时,您不应使用驱动器信号合格的路径,也不应使用任何包含Whitespace的路径,并且您应始终将前向斜线(
/code>)用作目录分离器,绝不是后弹。
You can find documentation on error messages in the GNU make manual.
This error means that you have a static pattern rule, with multiple patterns (
%
characters) in the target. Your line is here:The only way to know what the problem is, is to find the values of the
PROJECT_OUT
,PROJECT
, andALL_OBJS
variables. No doubt they contain colon characters and/or percent characters.The
make
program is a tool developed on UNIX, well before "driver letters", backslash as directory separators, etc. were popularized by Microsoft. As such, its syntax is geared towards UNIX systems where:
is not expected in pathnames, backslash is an escape character, etc.If you want to build software on Windows that was developed for POSIX systems such as GNU/Linux and MacOS, you'll have to do some work translating pathnames between them. You should not use drive-letter-qualified paths when working with makefiles, and you should not use any paths containing whitespace, and you should always use forward-slashes (
/
) as directory separators, never backslashes.