help-make
[Top][All Lists]
Advanced

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

Re: MAKECMDGOALS


From: Paul Smith
Subject: Re: MAKECMDGOALS
Date: Mon, 01 Feb 2021 11:53:41 -0500
User-agent: Evolution 3.36.4-0ubuntu1

On Mon, 2021-02-01 at 15:33 +0100, Sébastien Hinderer wrote:
> Shouldn't make set this variable to theempty string rather than not
> setting it at all?

Maybe that would have been a way to do it, back when this feature was
added.  However, it has downsides as you can infer from my email; for
example if we set it to the empty string then using:

    MAKECMGOALS ?= default

would not work.  However, since setting MAKECMDGOALS is useless anyway
this may not be that important.

At this point I think it would be a backward-compat issue to change
this, as some makefiles could be relying on the difference somehow.


My suspicion is that your question is kind of an XY problem and the
real issue you care about isn't whether MAKECMDGOALS is unset or has an
empty value anyway; I think the thing you really care about is that
make gives a warning if MAKECMDGOALS is not set and you reference it,
if you set warn-undefined-variables.

I think the right way to handle that is not to change the value of
MAKECMDGOALS, but instead to declare that this variable is one of the
special-case variables that are not warned about if they are used
without being set.

You can file an enhancement request for this here:

https://savannah.gnu.org/bugs/?func=additem&group=make




reply via email to

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