tech-toolchain archive

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

Re: make -V

Alan Barrett writes:
>The basic issue, I think, is that we want a way, from the command line,
>to print both the recursively-expanded value of a named variable, and
>the expanded-only-once value of a named variable. Which of the two
>behaviours is invoked by "make -V" is less important than the
>availability of both behaviours.

Actually, I think the default behavior of 'make -V FOO' is key for the
reasons you cite below.

>At present, in NetBSD, we can use:
>        make -V VARNAME         # expanded only once
>        make -V '${VARNAME}'    # expanded recursively
>and in FreeBSD they have:
>        make -V VARNAME         # expanded recursively

and recently:

         make -V '${VARNAME}'    # expanded recursively

I had that added along with :tl and :tu, to ease some of the
compatability issues.

>        # is there a way to expand only once?

No but it is trivial to add - eg via a debug flag -dV

>My suggestion is to add a :modifier, such as :1, :e1, :x1, or even
>:texpandonce, to request that a variable be expanded only once.

Sorry, but wouldn't that be a rather complex solution?

>Now, moving on to which behaviour should be invoked by "make -V":
>I couldn't find anything in the NetBSD src or pkgsrc tree that relies on
>"make -V VARNAME" expanding only once. In fact, the uses of "make -V"
>that I found all seem to want the recursively-expanded value, and they
>probably work only by chance because the values don't happen to require
>expansion more than once. We have also heard that FreeBSD's ports tree
>assumes that "make -V" expands recursively. So, I suggest that we should
>change "make -V" to expand recursively.

Yes, that would be my prefered solution, and a simple debug flag -dV to
allow seeing the raw value.

The knob solution is at best a compromise - it does nothing to reduce
divergence, but if that's the most we can agree to I can live with it.


Home | Main Index | Thread Index | Old Index