tech-toolchain archive

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

Re: make -V



On Wed, 22 Aug 2012, Simon J. Gerraty wrote:
On Sun, 12 Aug 2012 05:14:36 +1000, matthew green writes:
No problem.  It would seem the consensus is leave things as is.
It would have been useful to not have to re-work all the freebsd ports
collection - which relies on make -V PKGNAME doing full expansion.

What if this behavior were controlled by a knob
such that the default behavior is unchanged?

This would allow a setting in sys.mk for FreeBSD to maintain
compatability for them.

How about attacking the problem from a different direction?

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.

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
        # is there a way to expand only once?

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

Then we would be able to use:

        make -V '${VARNAME:e1}' # expanded only once
        make -V '${VARNAME}'    # expanded recursively
        make -V VARNAME         # to be decided

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.

--apb (Alan Barrett)


Home | Main Index | Thread Index | Old Index