bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #42125] Explicit rules do not support multiple targets


From: Kyle Rose
Subject: [bug #42125] Explicit rules do not support multiple targets
Date: Fri, 3 Mar 2017 11:14:20 -0500 (EST)
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:51.0) Gecko/20100101 Firefox/51.0

Follow-up Comment #6, bug #42125 (project make):

I think maybe the naming is unfortunately confusing. A static pattern rule is
best regarded as a form of shorthand. I think many folks read the semantics of
search into the word "pattern", when in this case it's just substitution.

I'd be much more interested in a feature to support building multiple explicit
targets from one recipe, as mentioned in Paul's comment #1. It's
straightforward to emulate with a macro:

multi-output=$(strip $(eval $(call
multi-output-touch-others-mak,$1))$(firstword $1))

define multi-output-touch-others-mak
$(wordlist 2,$(words $1),$1): $(firstword $1)
        [ -e $$@ ] && touch $$@
endef

$(call multi-output, target1 target2 target3): blah blah blah...

but this requires the user to take extra steps to get the behavior they
usually intend. I'm not sure what syntax you could safely use to distinguish
the two cases, because clearly sometimes the user *does* want the recipe run
once per target.

(I'll further note that make *does* actually effectively support this for
serial builds, in which typically the recipe will be run only once after which
make will notice that the remaining targets are fresh and not-rerun the
recipe. IMO, this makes parallel builds even harder to debug because they
don't even run the same set of recipes as a serial build.)

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?42125>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]