在cubemx生成的makeifle中这些参数是什么意思?

发布于 2025-01-11 18:07:31 字数 662 浏览 2 评论 0 原文

我正在学习并尝试为基于皮质的 Holtek 芯片编写 makefile。我打算以STM32为模板修改cubemx生成的makefile,但是我对GCC和make工具不是特别熟悉。

现在我正在研究这部分。

$(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR) 
    $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@

我不知道参数 -Wa-a-adalms 的含义。我查了GCC手册,但只找到了描述-Wa 的 >:

-Wa,选项

将选项作为选项传递给汇编器。如果选项包含 逗号,以逗号分隔为多个选项。

而且我无法从这个描述中理解它的真正功能。

它们是什么意思?

需要在Holtek芯片的makefile中修改吗?

I am learning and trying to write a makefile for a cortex based Holtek's chip. I intend to modify the makefile generated by cubemx for STM32 as a template, but I am not particularly familiar with GCC and make tools.

Now I'm studying this part.

$(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR) 
    $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) 
lt; -o $@

I don't know what the parameters -Wa,-a,-ad and alms mean. I checked the GCC manual, but only found the description of -Wa:

-Wa,option

Pass option as an option to the assembler. If option contains
commas, it is split into multiple options at the commas.

And I can't understand its real function from this description.

What do they mean?

Should I modify it in the makefile of Holtek chip?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

朕就是辣么酷 2025-01-18 18:07:31

正如 Tom V 提到的,第一个参数 -Wa 用于将后续参数 -a,-ad,-alms 发送到汇编编译器 (GAS)。

参数 -a-ad-alms 用于生成列表文件(这些 .lst 文件您可以在编译期间在构建输出目录中找到。

列出文件对于了解编译后的代码的低级详细信息很有用。

您可以在此处找到有关这些选项(和其他选项)的更多详细信息:

https://ftp.gnu.org/old-gnu/Manuals/gas-2.9.1/html_chapter/as_2.html#SEC10

和这里:

https://www.systutorials.com/generate-a-mixed-source-and-assemble-listing-using-gcc/

需要在Holtek芯片的makefile中修改吗?

无需更改,但如果您想编译得更快一点,则可以省略这些参数(在我的设置中并没有太大区别)。

As mentioned by Tom V, the first parameter -Wa is used to send the subsequent parameters -a,-ad,-alms to the assembler compiler (GAS).

The arguments -a,-ad, and -alms are used to generate listing files (those .lst files you find in build output directory) during compilation.

Listing files are useful to understand low-level details of your code after being compiled.

You can find more details about these options (and others)here:

https://ftp.gnu.org/old-gnu/Manuals/gas-2.9.1/html_chapter/as_2.html#SEC10

and here:

https://www.systutorials.com/generate-a-mixed-source-and-assembly-listing-using-gcc/

Should I modify it in the makefile of Holtek chip?

No need to change, but you can omit these parameters if you want to compile a bit faster (not really a great difference in my setup).

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