mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 751076 - fix $< and $^ for pymake; r=bsmedberg
This commit is contained in:
parent
1075e2de0f
commit
766102f43a
@ -1474,8 +1474,20 @@ class Rule(object):
|
||||
|
||||
def getcommands(self, target, makefile):
|
||||
assert isinstance(target, Target)
|
||||
# Prerequisites are merged if the target contains multiple rules and is
|
||||
# not a terminal (double colon) rule. See
|
||||
# https://www.gnu.org/software/make/manual/make.html#Multiple-Targets.
|
||||
prereqs = []
|
||||
prereqs.extend(self.prerequisites)
|
||||
|
||||
return getcommandsforrule(self, target, makefile, self.prerequisites, stem=None)
|
||||
if not self.doublecolon:
|
||||
for rule in target.rules:
|
||||
# The current rule comes first, which is already in prereqs so
|
||||
# we don't need to add it again.
|
||||
if rule != self:
|
||||
prereqs.extend(rule.prerequisites)
|
||||
|
||||
return getcommandsforrule(self, target, makefile, prereqs, stem=None)
|
||||
# TODO: $* in non-pattern rules?
|
||||
|
||||
class PatternRuleInstance(object):
|
||||
|
25
build/pymake/tests/multiple-rules-prerequisite-merge.mk
Normal file
25
build/pymake/tests/multiple-rules-prerequisite-merge.mk
Normal file
@ -0,0 +1,25 @@
|
||||
# When a target is defined multiple times, the prerequisites should get
|
||||
# merged.
|
||||
|
||||
default: foo bar baz
|
||||
|
||||
foo:
|
||||
test "$<" = "foo.in1"
|
||||
@echo TEST-PASS
|
||||
|
||||
foo: foo.in1
|
||||
|
||||
bar: bar.in1
|
||||
test "$<" = "bar.in1"
|
||||
test "$^" = "bar.in1 bar.in2"
|
||||
@echo TEST-PASS
|
||||
|
||||
bar: bar.in2
|
||||
|
||||
baz: baz.in2
|
||||
baz: baz.in1
|
||||
test "$<" = "baz.in1"
|
||||
test "$^" = "baz.in1 baz.in2"
|
||||
@echo TEST-PASS
|
||||
|
||||
foo.in1 bar.in1 bar.in2 baz.in1 baz.in2:
|
Loading…
Reference in New Issue
Block a user