Re: make -U
At 1:39 PM + 7/31/03, Christian Weisgerber wrote: Juli Mallett <[EMAIL PROTECTED]> wrote: > Why go thru those contortions? I sometimes use "make FOO=" to > define things. -U obviously has a place, if it not existing > means I have to have all these contortions to do a fairly > obvious thing, yeah? What are the exact semantics of -U supposed to be? From the message in freebsd-hackers which first introduced this patch: - Date: Tue, 29 Jul 2003 09:09:17 -0700 - From: Faried Nawaz <[EMAIL PROTECTED]> - 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. 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. -- Garance Alistair Drosehn= [EMAIL PROTECTED] Senior Systems Programmer or [EMAIL PROTECTED] Rensselaer Polytechnic Instituteor [EMAIL PROTECTED] ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: make -U
Juli Mallett <[EMAIL PROTECTED]> wrote: > Why go thru those contortions? I sometimes use "make FOO=" to define > things. -U obviously has a place, if it not existing means I have to > have all these contortions to do a fairly obvious thing, yeah? What are the exact semantics of -U supposed to be? -- Christian "naddy" Weisgerber [EMAIL PROTECTED] ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: make -U
* Ruslan Ermilov <[EMAIL PROTECTED]> [ Date: 2003-07-30 ] [ w.r.t. Re: make -U ] > On Wed, Jul 30, 2003 at 04:23:20PM -0500, Juli Mallett wrote: > > * Ruslan Ermilov <[EMAIL PROTECTED]> [ 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 Why go thru those contortions? I sometimes use "make FOO=" to define things. -U obviously has a place, if it not existing means I have to have all these contortions to do a fairly obvious thing, yeah? Thanx, juli. -- juli mallett. email: [EMAIL PROTECTED]; efnet: juli; aim: bsdflata; i have lost my way home early - i don't care cause i won't stay there. ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: make -U
On Wed, Jul 30, 2003 at 04:23:20PM -0500, Juli Mallett wrote: > * Ruslan Ermilov <[EMAIL PROTECTED]> [ 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, [EMAIL PROTECTED] Sunbay Software Ltd, [EMAIL PROTECTED] FreeBSD committer pgp0.pgp Description: PGP signature
Re: make -U
* Ruslan Ermilov <[EMAIL PROTECTED]> [ 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 :) Thanx, juli. (who admits she missed the rest of the conversation) -- juli mallett. email: [EMAIL PROTECTED]; efnet: juli; aim: bsdflata; i have lost my way home early - i don't care cause i won't stay there. ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "[EMAIL PROTECTED]"
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''. Cheers, -- Ruslan Ermilov Sysadmin and DBA, [EMAIL PROTECTED] Sunbay Software Ltd, [EMAIL PROTECTED] FreeBSD committer pgp0.pgp Description: PGP signature