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

What do these parameters mean in the makeifle that generated by cubemx?

我正在学习并尝试为基于 cortex 的 Holtek 芯片编写 makefile。打算把cubemx为STM32生成的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 手册,但只找到 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.

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

它们是什么意思?

是否需要在盛群芯片的makefile中修改?

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

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

列表文件有助于理解 low-level 代码编译后的详细信息。

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

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-assembly-listing-using-gcc/

Should I modify it in the makefile of Holtek chip?

无需更改,但如果您想编译得更快一些,可以省略这些参数(在我的设置中差别不大)。