<p></p>
<blockquote>
<p>What problem is this actually solving?</p>
</blockquote>
<p>Allow me to demonstrate:</p>
<pre><code>$ echo && cat Makefile.bad && echo && EMBED=foobar make -f Makefile.bad && echo && cat Makefile.good && EMBED=foobar make -f Makefile.good
EMBED := $(EMBEDDED_IMAGE)
.PHONY: all
all:
echo "EMBEDDED_IMAGE: $(EMBEDDED_IMAGE)"
echo "EMBED: $(EMBED)"
echo "EMBEDDED_IMAGE: "
EMBEDDED_IMAGE:
echo "EMBED: "
EMBED:
EMBED ?= $(EMBEDDED_IMAGE)
.PHONY: all
all:
echo "EMBEDDED_IMAGE: $(EMBEDDED_IMAGE)"
echo "EMBED: $(EMBED)"
echo "EMBEDDED_IMAGE: "
EMBEDDED_IMAGE:
echo "EMBED: foobar"
EMBED: foobar
</code></pre>
<p>When the definition of the shell variable <code>EMBED</code> precedes <code>make</code>, <code>Makefile.good</code> shows the effect and <code>Makefile.bad</code> does not.</p>
<blockquote>
<p>Any variables specified in the <code>make</code> command line will override assignments within the Makefile. Building with <code>make EMBED=...</code> works with no problems already.</p>
</blockquote>
<p>You're not wrong: <code>make EMBED=...</code> works. What doesn't work is <code>EMBED=... make</code> or any combination of exporting a shell variable for later consumption by a <code>make</code> invocation. For reasons that I have yet to dig out of the GNU Make manual, consuming that variable definition only works when it appears as a argument to the <code>make</code> command.</p>
<p>Strictly speaking, it's not incorrect to accept only variable assignments that happen to follow the command, but it will confuse others (like me) that assume the <code>EMBED</code> should behave like a shell variable when the immediate assignment prevents exactly that.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/ipxe/ipxe/pull/115#issuecomment-645707277">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAFNGVAMEVVQ42QKUWVKXPDRXFR7JANCNFSM4OBAKZ5A">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAFNGVBTN4UT4CZPY5JGL6DRXFR7JA5CNFSM4OBAKZ5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEZ6LMDI.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/ipxe/ipxe/pull/115#issuecomment-645707277",
"url": "https://github.com/ipxe/ipxe/pull/115#issuecomment-645707277",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>