发生错误:***多个目标模式。停止

发布于 2025-01-27 16:10:35 字数 436 浏览 3 评论 0原文

这是我第一次在此处发布,很抱歉,如果这最终出现在错误的地方。我正在尝试编译我从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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

山人契 2025-02-03 16:10:35

您可以在

此错误意味着您有一个静态模式规则,目标中具有多种模式(字符)。您的行在这里:

 $(PROJECT_OUT)/$(PROJECT).elf: $(ALL_OBJS)

知道问题是什么的唯一方法是找到project_outprojectall_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:

 $(PROJECT_OUT)/$(PROJECT).elf: $(ALL_OBJS)

The only way to know what the problem is, is to find the values of the PROJECT_OUT, PROJECT, and ALL_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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文