假设我想要一个非常简单的 makefile,其中包含要链接的库(假设 -lm
)
CFLAGS=-Wall -g
LIBS=-lm
如何让 $(LIBS)
到达命令的正确部分,而无需在 makefile 中手动构造命令并打破一堆隐式规则?
I couldn't find anything in the manual
是否可以简单地用自己编写的规则替换隐式规则?
最佳答案
遵循 link你给的,有LDFLAGS
:
LDFLAGS
Extra flags to give to compilers when they are supposed to invoke the linker, ‘ld’.
关于c - 简单的 makefile 库变量 - 替换隐式规则,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12627104/