0
내 프로젝트 중 하나에 다소 일반적인 Makefile이 필요하지만 Makefiles에 define
의 응답이없는 것 같습니다. 감소 최소한으로 대상이 일반적으로 생성되지 않습니다.
TARGETS = target1 target2
define TARGET_template =
$(1):
@echo "Hi there, I'm $(1)!"
endef
.PHONY: all
all: $(TARGETS)
$(foreach TARGET, $(TARGETS), $(eval $(call TARGET_template, $(TARGET))))
을 내가 make all
을 실행할 경우, 나는 콘솔 출력이 될 것으로 기대 것 :
Hi there, I'm target1!
Hi there, I'm target2!
하지만 그 대신 내가 할
make: *** No rule to make target `target1', needed by `all'. Stop.
내가 뭘 잘못하고 있니? GNU make를 사용하고 있습니다 3.81