【发布时间】:2022-12-02 23:39:56
【问题描述】:
我有这个示例(简化)makefile
all: a a.e b b.e
.SUFFIXES:
a a.e:
touch $@
b: a
ln -sf $(notdir $<) $@
b.e: a.e
ln -sf $(notdir $<) $@
clean:
rm -f a* b*
它有效。
我想使用 Pattern Rules 如下:
all: a a.e b b.e
.SUFFIXES:
a a.e:
touch $@
b%: a%
ln -sf $(notdir $<) $@
clean:
rm -f a* b*
但它失败了:
$ make
touch a
touch a.e
make: *** No rule to make target 'b', needed by 'all'. Stop.
我不知道为什么,也不知道如何让它发挥作用
【问题讨论】: