help-make
[Top][All Lists]
Advanced

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

Re: Cancelling command line arguments for the whole of project


From: Masahiro Yamada
Subject: Re: Cancelling command line arguments for the whole of project
Date: Fri, 22 May 2020 01:32:18 +0900

On Thu, May 21, 2020 at 9:33 PM Paul Smith <address@hidden> wrote:
>
> On Thu, 2020-05-21 at 16:36 +0900, Masahiro Yamada wrote:
> > Is there an elegant way to cancel
> > a command line argument?
> >
> > https://www.gnu.org/software/make/manual/make.html#Override-Directive
> >
> > explains how to override command arguments,
> > but it works only in the current Makefile.
>
> The handling of passing content down to recursive make is discussed in
> this section of the manual:
>
> https://www.gnu.org/software/make/manual/html_node/Options_002fRecursion.html
>
> Here you will discover that overridden variables are contained in the
> make variable MAKEOVERRIDES.
>
> Since later settings of variables take precedence over earlier
> settings, if you want to change them you simply need to add the new
> setting like so:
>
>   # This cancels FOO only in this Makefile
>   override FOO=
>   # This resets FOO for recursive invocations
>   MAKEOVERRIDES += FOO=$(FOO)


Awesome!
I did not know this tip.


Thank you!


-- 
Best Regards
Masahiro Yamada



reply via email to

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