gpt4 book ai didi

linux - 生成文件程序

转载 作者:太空宇宙 更新时间:2023-11-04 05:36:28 25 4
gpt4 key购买 nike

我有 3 个程序 abc.c pqr.cxyz.c我这样编译:

/usr/bin/gcc -pthread -O2 -fmessage-length=0 -pedantic-errors -std=gnu99 -Werror -Wall -Wextra -Wwrite-strings -Winit-self -Wcast-align -Wcast-qual -Wpointer-arith -Wstrict-aliasing -Wformat=2 -Wmissing-include-dirs -Wno-unused-parameter -Wshadow -Wuninitialized -Wold-style-definition filename.c -o filename

我想编写一个 makefile 来使用上述选项编译三个程序并生成三个可执行文件。我已经阅读了很多教程并阅读了手册页,所以请不要让我用 Google 搜索它。如果你能给我直接的答案,那就太好了。谢谢你! :)

最佳答案

我认为这可以做到:

CC := /usr/bin/gcc
CFLAGS += -pthread -O2 -fmessage-length=0 -pedantic-errors # and so on

.PHONY: all
all: abc pqr xyz

关于linux - 生成文件程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49961279/

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