Subject: Re: printing expanded variables?
To: None <tech-toolchain@NetBSD.org>
From: Alan Barrett <apb@cequrux.com>
List: tech-toolchain
Date: 09/03/2003 09:36:10
On Tue, 02 Sep 2003, Simon J. Gerraty wrote:
> FOO=fu
> BAR=bar
>
> FUBAR=${FOO} ${BAR}
>
> $ make -V FUBAR
> ${FOO} ${BAR}
> $ make -v FUBAR
> fu bar
I suggest defining "-v" as a "verbose" flag. It will not do much for now,
but could be made to do more later. (See other thread about "-v" cancelling
the effect of "@" or .SILENT rules.)
Then let "-v -V VARNAME" mean "verbosely display the value of ${VARNAME)".
The output could be something like this:
$ cat Makefile
FOO=fu
BAR=bar
FUBAR=${FOO} ${BAR}
$ make -V FUBAR
${FOO} ${BAR}
$ make -v -V FUBAR
variable: FUBAR
value: ${FOO} ${BAR}
expanded: fu bar
I prefer not to use "-E" (as was suggested in another message), because
it seems to be a waste of precious option letters.
--apb (Alan Barrett)