我目前正在编写一个能够编译不同目标(如调试、开发、发布)的生成文件。链接和编译规则如下所示:
$(DEVELOPMENT_OUT): $(subst rep,development,$(OBJS))
g++ -o $(DEVELOPMENT_OUT) $(subst rep,development,$(OBJS))
obj/development/%.o: src/%.cpp
g++ -c -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
现在,我得到这个输出:
make: *** No rule to make target 'obj/development/Main.o', needed by 'bin/Development.exe'. Stop.
但是模式规则不应该适用于 Main.o 吗?
我使用GNU Make 3.82.90
MinGW。