这是我的实验 Makefile。
.SECONDEXPANSION:
~/hello.txt: $(shell echo '$$(@D)/')$(shell echo '$$(@F)' | sed -e 's/hello/bye/')
echo "$^"
不知何故 sed 命令不起作用,并且 Make 抱怨循环依赖
gmake: Circular /users/sim/hello.txt <- /users/me/hello.txt dependency dropped.
gmake: *** No rule to make target `echo', needed by `/users/me/hello.txt'. Stop.
我的预期行为是 GNU Make 寻找 ~/bye.txt 代替。我究竟做错了什么?
虽然我可以在这个小例子中明确指定“bye.txt”,但我仍然想知道为什么 sed 命令不适用。谢谢您的帮助。