Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 07 Sep 2003 15:27:03 -0600 (MDT)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        ru@FreeBSD.org
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/usr.bin/make cond.c
Message-ID:  <20030907.152703.84145645.imp@bsdimp.com>
In-Reply-To: <20030907124533.GA21121@sunbay.com>
References:  <20030907104614.GC10526@sunbay.com> <20030907.053010.130739333.imp@bsdimp.com> <20030907124533.GA21121@sunbay.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <20030907124533.GA21121@sunbay.com>
            Ruslan Ermilov <ru@FreeBSD.org> writes:
: On Sun, Sep 07, 2003 at 05:30:10AM -0600, M. Warner Losh wrote:
: > In message: <20030907104614.GC10526@sunbay.com>
: >             Ruslan Ermilov <ru@FreeBSD.org> writes:
: > : On Sat, Sep 06, 2003 at 07:16:10PM -0700, Warner Losh wrote:
: > : > imp         2003/09/06 19:16:10 PDT
: > : > 
: > : >   FreeBSD src repository
: > : > 
: > : >   Modified files:
: > : >     usr.bin/make         cond.c 
: > : >   Log:
: > : >   Keep up with minor changes to NetBSD.  Consider a variable empty when
: > : >   not define.
: > : >   
: > : >   Obtained From: NetBSD (rev 1.18; sjg)
: > : >   
: > : >   Revision  Changes    Path
: > : >   1.27      +1 -1      src/usr.bin/make/cond.c
: > : > 
: > : Does it mean that ``.if empty(FOO)'' will not cause an error
: > : now when FOO is not defined?  If so, what is the motivation
: > : for this change?
: > 
: > The NetBSD folks needed it for something, I'm not sure what.  Since it
: > was easy, didn't brea anything and cross BSD make divergence has been
: > a problem in the past, I went ahead and added it.
: > 
: This change is in NetBSD for only 29 hours, the reasoning is
: not well understood, and our make(1)'s are so much different
: that I don't really think this particular one makes them
: really closer.

It keeps them from getting further apart.  That NetBSD does it the
same way and it doesn't break anything that's working today is
sufficient.  Who cares why they want to do it that way?  It is
arbitrary what you do in this case anyway.  However, read further.

: It also seems counter-intuitive to me --
: undefined variable doesn't have _any_ value, so we cannot
: say if it's empty or not.

Yes, you can.  $(FOO) evaluates to "" when FOO is not defined.
Therefore it is empty, just as if it were defined to be "".

It looks like about 70 places in the tree would be simpler.  There's
only five place where empty is used bare, and in all of those cases it
is known that the variable is defined...  It looks to me like the .mk
an Makefile files in our tree could be a lot simpler if we keep it.

Finally, the change doesn't make make any larger or longer to
compile.   It could make the .mk files smaller, but I doubt that
anybody could measure a difference > .1%, but given that most of the
empty usages are in .mk files, some in loops,  I could be wrong.

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030907.152703.84145645.imp>