On Tue, 2005-05-17 at 23:06 +0100, Rick Thompson wrote:
# use a pattern rule with multiple targets (10.5.1) to ensure that
# $(ANTLR) is run only once to produce all 5 output files
X.$pp Y.$pp Z.$pp : $(GRAMMAR)
$(ANTLR) $<
then everything goes to worms, and nothing works (make complains that
there's no rule to make X.cpp; it doesn't seem to see the new rule).
Did you really mean X.$pp? The $ looks a little odd there and what this
rule defines will depend on the value of the variable p (since $p will
be expanded to its value before the rule is defined). Most likely $p is
empty and hence this rule is actually defining:
X.p Y.p Z.p : $(GRAMMAR) ; $(ANTLR) $<
which is not what you were looking for. I think you actually wanted to write:
X.%pp Y.%pp Z.%pp : $(GRAMMAR) ; $(ANTLR) $<