build-process – 指定为多个规则的依赖项时重新执行目标

前端之家收集整理的这篇文章主要介绍了build-process – 指定为多个规则的依赖项时重新执行目标前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有以下GNU makefile:
.PHONY a b c d

a: b c
b: d
c: d
d:
    echo HI

我希望目标’d’能够运行两次 – 因为它被b和amp指定为依赖关系. C.不幸的是,目标’d’只会被执行一次.运行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)
build: x y

x: target=build
y: target=prepare

x y: 
    echo hi $(target) $@
    touch $@

另请参见GNU Makefile rule generating a few targets from a single source file,因为它是对与此问题相反的问题的答案.

猜你在找的设计模式相关文章