gpt4 book ai didi

c - Makefile 的问题

转载 作者:太空宇宙 更新时间:2023-11-04 03:06:52 24 4
gpt4 key购买 nike

使用命令“make apps”,我想生成两个可执行文件:main_test.exe 和 main_app2.exe。出于某种原因,生成 main_test.exe 的命令更多是 less completley 当我运行生成文件。最后,我得到了一个 main_app.exe 和 main_app2.exe 文件,但是没有生成的 main_test.exe 文件。有人知道为什么我的 makefile 中忽略了 objcopy 命令吗?

# make apps to generate executables

main_app.exe: main.c lib3tests.a
$(XCC) $(XCFLAGS) main.c $(XLDFLAGS) -o main_app.exe

main_test.exe: main_app.exe
$/bin/sparc-elf-objcopy --add-section .myelfsection=file.txt --change-section-address .myelfsection=0xcd000000 --set-section-flags .myelfsection=alloc,contents,load,data main_app.exe

main_app2.exe: main.c lib3tests.a
$(XCC) $(XCFLAGS) main.c $(XLDFLAGS) -o main_app2.exe

apps: main_app2.exe main_test.exe

非常感谢

最佳答案

确保在这一行的 sparc-elf-objcopy 之前有一个 TAB 字符(不是空格):

main_test.exe: main_app.exe
$/bin/sparc-elf-objcopy --add-section .myelfsection=file.txt --change-section-address .myelfsection=0xcd000000 --set-section-flags .myelfsection=alloc,contents,load,data main_app.exe

关于c - Makefile 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3968266/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com