make -U
Ruslan Ermilov
ru at FreeBSD.org
Sat Aug 2 10:14:02 PDT 2003
[ Moved to -arch ]
> From the message in freebsd-hackers which first introduced
> this patch:
>
> - Date: Tue, 29 Jul 2003 09:09:17 -0700
> - From: Faried Nawaz <fn at hungry.com>
> - Subject: patch to add make -U
>
> While working around a port issue (ports/55013), I discovered
> that make couldn't unset variables using make -U. I've written
> a small patch that adds -U functionality, but I haven't tested
> it extensively.
>
> http://web.nilpotent.org/tmp/make.diff.bz2 (~ 3KB unpacked)
> against yesterday's -CURRENT code.
>
The patch looks sane.
> A simple Makefile I used to test it:
>
> -- cut here --
> FOO = bar
>
> .ifdef FOO
> SAY = y
> .else
> SAY = n
> .endif
>
> all:
> echo $(SAY)
> -- cut here --
>
> Try "make -U FOO".
>
> Personally I think this is a reasonable option to implement.
> An undefined variable is not the same as a variable which is
> defined to be a null string.
>
I want that everyone understands the effect of the patch: the
-U FOO option causes the FOO variable to always be reported
by make(1) as undefined, not only in this makefile, but even
in sub-make processes, and affects all makefiles wishing to
set it -- it just doesn't let them do this, globally.
So the actual meaning of this option is "prevent variable FOO
from being set". (The implementation is somewhat different;
it causes make(1) to lie that variable being is, but the net
effect is the same.)
Given the above, do we really want this option in our make?
Cheers,
--
Ruslan Ermilov Sysadmin and DBA,
ru at sunbay.com Sunbay Software Ltd,
ru at FreeBSD.org FreeBSD committer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20030802/0096f62e/attachment.bin
More information about the freebsd-arch
mailing list