automake
[Top][All Lists]
Advanced

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

Re: Conditional variable based on silent or not silent?


From: Stefano Lattarini
Subject: Re: Conditional variable based on silent or not silent?
Date: Sat, 08 Jun 2013 16:48:26 +0200

On 06/08/2013 02:58 PM, Diego Elio Pettenò wrote:
> On 08/06/2013 12:58, Nate Bargmann wrote:
>>
>> As 'make V=1' can be used to override the silent rules created from
>> 'configure',
>>
Actually, it silences the rules created by Automake; the "V=1" can be
to override, at make runtime, the verbosity level set at configure
runtime.  Is this what you intended?

>> is it possible to write the variable with the ability to be
>> conditional at make time?  In other words, does make set some sort
>> of environment variable that I can test for to set my variable?
>
Well, Automake-generated Makefiles set an 'AM_V_P' variable that
can be used to poll, in the shell code of the user-defined recipes,
whether make is being run in quiet mode or not.  That is documented
in the manual.  Is that what you are asking for?  But even if it is,
see below before proceeding to use it.

>> If not, I
>> am comfortable with quieting Swig manually.
> 
> I think you're missing the point of silent rules. Silent rules do not
> silence the compiler's warnings, but are rather designed so that
> _exactly those_ warnings are easier to notice...
> 
Diego is perfectly right here.  So, while the above suggestion of mine
should make it possible to obtain the effect you wanted, you should be
aware that doing so is a bad idea, since it mostly defies the purpose
of silent-rules.  What you need is another switch, orthogonal to those
related to silent-rules, that the user can tweak to enable/disable
warnings from Swig at will.

Some GNU projects (e.g., coreutils) do something similar to give
the user control on the activation of GCC warnings, by providing
a custom configure '--enable-gcc-warnings'; you might want to look
at that idiom for inspiration.

HTH,
  Stefano



reply via email to

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