gnu - Makefile Secondary Expansion -
Manual Section 3.8 says:
"During the secondary expansion of clear rules, In the first condition list, all three variables ($$ & lt; $$$, and $$ +) expand to empty string. " My question: why Manual misleading, possibly due to typo, first of two sentences: Blockquote> $$ & lt; The variable reviews the first condition in this rule for the first rule. $$ ^ and $$ + Evaluate the list of all the necessary conditions for those rules that have already appeared for the same goal (without $$ + iterations and $$ ^). You can verify that it correctly describes the behavior by running two makefiles: 1 Output is: Showing Make Now output is: here Clear prerequisites are collected from the $ Assess $ @ and
$$% , respectively, for the target's file name, and when the goal is a collection member, the name of the target member.
$$ < / Code> variable reviews the first condition in the first rule of this goal. Evaluate the list of all the necessary conditions for the
$$ ^ and
$$ + rules Same goal from (without
$$ + duplication and
$$ ^ ). The following examples will help clarify these behaviors:
< Code> .SECONDEXPANSION: foo: foo.1 times.1 $$ $ <$$ ^ $$ + # line # 1 foo: foo.2 bar.2 $$ <$$ ^ $$ + # line # 2 foo: foo.3 bar.3 $$ <$$ ^ $$ + # line # 3
$$
. SECONDEXPANSION: foo: foo.1 $$ & lt; @echo $ +
foo.1
$ $ & Lt; is expanded to empty string then:
. SECONDEXPANSION: foo: foo.1 foo: foo.2 $$ & lt; @echo $ +
foo.2 foo.1 foo.1
foo and
foo.1 and
foo with the first and second rules of the target, which account for the initial output
foo.2 foo.1 and additionally, in the second rule
$$
foo.1 , which is the last
foo.1 of the account or output.
Comments
Post a Comment