automake
[Top][All Lists]
Advanced

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

Re: makes which break with `silent-rules'


From: Ralf Wildenhues
Subject: Re: makes which break with `silent-rules'
Date: Sun, 24 May 2009 15:20:04 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Hello Bruno, Bob,

* Bruno Haible wrote on Sun, May 24, 2009 at 01:12:02PM CEST:
> >  - The `silent-rules' option enables Linux kernel-style silent build output.
> >    This option requires the widely supported but non-POSIX `make' feature
> >    of recursive variable expansion,
> 
> We are talking about constructs like this:
> 
> ====== Makefile ======
> all :
>       echo $(XY_V)
> 
> XY_V = $(XY_$(V))
> XY_0 = silent
> XY_1 = verbose
> XY_ = unknown
> ======================

Yes.

> I think this is supported by POSIX. POSIX [1] says: "Macros can appear 
> anywhere
> in the makefile.".

But a few lines down it also says:

| Macro expansions using the forms $( string1) or ${ string1} shall be
| replaced by string2, as follows:
[...]
| The parentheses or braces are optional if string1 is a single character.
| The macro $$ shall be replaced by the single character '$' . If string1
| in a macro expansion contains a macro expansion, the results are
| unspecified.

IRIX make barfs if the inner macro expansion is used without $() or ${}
even for one-character macros.  IOW, IRIX make barfs over $(foo$V) but
copes with $(foo$(V)).

Compare that with the other possibility we tried to implement the
silencing feature: macro expansions on the left hand side of an
assignment:
  foo$(V) = ...

This is explicitly allowed by POSIX, but fails in practice on several
systems.  (I documented this in some message on one of the automake
lists, but am too lazy to dig it up now unless somebody asks for it.)

Cheers,
Ralf




reply via email to

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