I apologize for using the wrong automatic variable. I had the firm assumption that we were talking about "$^", not "$<" as I would never use the latter in a case where the genesis of its content is not explicit.
Am Mo., 2. Okt. 2023 um 15:08 Uhr schrieb Paul Smith <psm...@gnu.org>: > On Mon, 2023-10-02 at 09:06 +0200, Mark Piffer wrote: > > For the sake of reliability I wouldn't use pure `$<` anywhere. > > I'm not sure what you mean by "reliability" (I'm not aware of any > change to the behavior of $< in the 30+ year history of GNU make) and I > don't know what you mean by "pure $<"; what would one use instead, that > is "non-pure"? > > > And if the answer to your question "Which one, listed in another > > rule, becomes $<?" isn't "All collected prerequisites, with > > duplicates purged" > > I don't understand what this means. $< is always a single word. It's > never multiple words so it can never be "all collected prerequisites". > > Also make doesn't drop duplicates (this is necessary because sometimes, > for example for linking, duplicates are important). But that doesn't > matter for $< which is always a single word, as I mentioned. > > The behavior is straightforward: when make parses a rule _without_ a > recipe, it will append new prerequisites to the END of its targets' > list of prerequisites. > > When make parses an explicit rule that _has_ a recipe, then those > prerequisites are added to the BEGINNING of the target's list of > prerequisites. > > For implicit rules, the prerequisites on the matching rule are added to > the BEGINNING of the target's list of prerequisites when it matches. > > Then, when $< is expanded, it expands to the first prerequisite. >