次の GNU makefile があります。
.PHONY a b c d
a: b c
b: d
c: d
d:
echo HI
ターゲット 'd' を 2 回実行したいと思います。これは、b と c の両方で依存関係として指定されているためです。残念ながら、ターゲット 'd' は 1 回しか実行されません。実行中の make の出力は、'HI HI' ではなく単に 'HI' になります。
どうすればこれを修正できますか?
ありがとう!
明確にするために、目標は次のようなものです。
subdirs = a b c
build: x y
x: target=build
x: $(subdirs)
y: target=prepare
y: $(subdirs)
$(subdirs):
$(make) -f $@/makefile $(target)