Re: make -U

From: Juli Mallett (jmallett_at_FreeBSD.org)
Date: 07/30/03

  • Next message: Tkachenko, Artem N: "SNMP"
    Date: Wed, 30 Jul 2003 16:37:05 -0500
    To: Ruslan Ermilov <ru@FreeBSD.ORG>
    
    

    * Ruslan Ermilov <ru@FreeBSD.ORG> [ 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 <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

    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: jmallett@freebsd.org; efnet: juli; aim: bsdflata;
    i have lost my way home early - i don't care cause i won't stay there.
    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
    

  • Next message: Tkachenko, Artem N: "SNMP"

    Relevant Pages

    • Re: make -U
      ... > undefine the FOO variable, as it the ``.undef FOO'' was called ... setting FOO= on a command ... have all these contortions to do a fairly obvious thing, ...
      (freebsd-current)
    • [ANN] main-2.6.0
      ... a class factory and dsl for generating command line programs real ... option 'foo' ... improved auto usage generation when arity is used with arguments ... cast:int ...
      (comp.lang.ruby)
    • [ANN] main-2.0.0
      ... a class factory and dsl for generating command line programs real quick ... def runputs 'installing...' ... and auto-generation of usage messages can really streamline ... int(foo): the cast is int, ...
      (comp.lang.ruby)
    • [ANN] main-2.2.0
      ... a class factory and dsl for generating command line programs real quick ... def runputs 'installing...' ... and auto-generation of usage messages can really streamline ... int(foo): the cast is int, ...
      (comp.lang.ruby)
    • [ANN] main-2.5.0
      ... a class factory and dsl for generating command line programs real ... def runputs 'installing...' ... and auto-generation of usage messages can ... int(foo): the cast is int, ...
      (comp.lang.ruby)