Please reply to the list, not privately, then everyone can help and/or see the answer.
On Wed, 2023-02-15 at 18:19 +0000, Shailan Patel wrote: > Hello im referring to this > chapter https://www.gnu.org/software/make/manual/make.html#Secondary- > Expansion > > and im referring to this example here: > > The following example will help illustrate these behaviors: > .SECONDEXPANSION: > > foo: foo.1 bar.1 $$< $$^ $$+ # line #1 > > foo: foo.2 bar.2 $$< $$^ $$+ # line #2 > > foo: foo.3 bar.3 $$< $$^ $$+ # line #3 > In the first prerequisite list, all three variables ($$<, $$^, > and $$+) expand to the empty string. In the second, they will have > values foo.1, foo.1 bar.1, and foo.1 bar.1 respectively. In the third > they will have values foo.1, foo.1 bar.1 foo.2 bar.2, and foo.1 bar.1 > foo.2 bar.2 foo.1 foo.1 bar.1 foo.1 bar.1 respectively. > please could you tell me how foo.1 bar.1 foo.2 bar.2 foo.1 foo.1 > bar.1 foo.1 bar.1 is derived? In line #1 all the variables are empty. After line #1 parsed, in line #2, the variables have values as computed in line #1: $$< is "foo.1" and $$^ is "foo.1 bar.1", and $$+ is "foo.1 bar.1". After line #2 is parsed (when we are parsing line #3) the prerequisites of "foo" are as follows: foo.1 bar.1 (from line #1) foo.2 bar.2 (new prereqs added by line #2) foo.1 ($$< in line #2) foo.1 bar.1 ($$^ in line #2) foo.1 bar.1 ($$+ in line #2)