Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jul 2003 00:27:44 +0300
From:      Ruslan Ermilov <ru@FreeBSD.ORG>
To:        Juli Mallett <jmallett@FreeBSD.ORG>
Cc:        current@FreeBSD.ORG
Subject:   Re: make -U
Message-ID:  <20030730212744.GJ33188@sunbay.com>
In-Reply-To: <20030730162320.A66578@FreeBSD.org>
References:  <20030730212049.GI33188@sunbay.com> <20030730162320.A66578@FreeBSD.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Wed, Jul 30, 2003 at 04:23:20PM -0500, Juli Mallett wrote:
> * Ruslan Ermilov <ru@FreeBSD.org> [ Date: 2003-07-30 ]
> 	[ w.r.t. make -U ]
> > Sorry, I've accidentally dropped an email about `make -U'.
> > 
> > I think that it's not needed, since the functionality can
> > easily be achieved by running "make FOO=", i.e., assigning
> > an empty value.  Remember that command line variables take
> > precedence over globals, so the following makefile,
> > 
> > FOO+=	bar
> > 
> > all:
> > 	@echo ${FOO}
> > 
> > when run as ``make FOO=foo'', will print just ``foo''.
> 
> Does that work for the .if defined() case, too?  Makefiles can grow
> to be more complex than just that sort of stuff, after all :)
> 
Not sure what do you mean.  The "make -U FOO" was support to
undefine the FOO variable, as it the ``.undef FOO'' was called
at the end of makefile.  Of course, setting FOO= on a command
line still gets you a "defined" variable, but

.if defined(FOO) && !empty(FOO)

should do the trick.  Try this out with "make FOO=":

FOO=	bar

all:
.if defined(FOO) && !empty(FOO)
	@echo FOO is set
.endif


Cheers,
-- 
Ruslan Ermilov		Sysadmin and DBA,
ru@sunbay.com		Sunbay Software Ltd,
ru@FreeBSD.org		FreeBSD committer

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQE/KDhQUkv4P6juNwoRAssuAKCJhO7zOgldMvcfLNOZY8/j7FpaIQCdEmD6
HhMwY+Hmb9np9MfNzwI6u3c=
=YQZr
-----END PGP SIGNATURE-----
help

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