tech-toolchain archive

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

Re: make -V



On Thu, 23 Aug 2012 03:59:01 +0000, David Holland writes:
> > The patch is trivial (I had it laying around - just need to find it ;-)
>
>It doesn't seem to me like a good idea to have sys.mk (which defines
>the basic behavior of make, after all) becoming platform-dependent or
>adding platform-dependent logic.

sys.mk *is* platform dependent or at least what you find in FreeBSD and
NetBSD.  The sys.mk I ship is generic, but will look for sys/NetBSD.mk
sys/Darwin.mk etc to find the platform dependent bits if available.

But the nob need not be set there, it can be set anywhere - even on the
command line:

$ FOO='${.CURDIR:H}' make -V FOO
${.CURDIR:H}
$ FOO='${.CURDIR:H}' make -V FOO .MAKE.EXPAND_VARIABLES=yes
/NetBSD/current/src/usr.bin
$ FOO='${.CURDIR:H}' make -V FOO .MAKE.EXPAND_VARIABLES=no
${.CURDIR:H}

In this case, NetBSD need do nothing, since the behavior doesn't change,
FreeBSD can reasonably set the knob in their sys.mk - so that they keep
the behavior they want/expect.

And I get to avoid rototilling their ports collection,
so everyone wins ;-)

>It seems to me like adding another command-line option is the best
>path.

That was the original proposal (and the patch I was looking for), but no
one wanted the default behavior changed.
The knob approach allows everyone to have the default behavior they want
and as shown above, setting the variable on the command line works too.

Thanks
--sjg


Home | Main Index | Thread Index | Old Index