如何在 Makefile 中使用带有“:”的变量?

How to use variable with ':' in a Makefile?

当我想使用 make 时遇到问题,其中包含一个链接到我的文件夹的变量。

像这样:

DIR_ST = I\ \:\ The\ Scared\ Stones

SRC_ST = $(DIR_ST)/main.c

OBJ_ST = $(SRC_ST:.c=.o)

但是当我想这样编译时:

all : $(ST)
$(ST) : $(OBJ_ST)
$(CC) $(OBJ_ST) -o strategic

我收到这个错误:

make: *** No rule to make target `I \: The Sacred Stones/main.o', needed by `binaries/strategic'.  Stop.

如何在 Makefile 中使用此文件夹的名称?

您可以将当前目录中的符号 link 放置到 'I:\ The Scared Stones 目录

建议使用 link 没有空格的名称