Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Sep 2002 16:35:23 +0200
From:      Roman Neuhauser <neuhauser@bellavista.cz>
To:        Chuck Robey <chuckr@chuckr.org>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: two make questions
Message-ID:  <20020923143523.GA30361@freepuppy.bellavista.cz>
In-Reply-To: <20020923095217.O332-100000@april.chuckr.org>
References:  <20020923133431.GZ30361@freepuppy.bellavista.cz> <20020923095217.O332-100000@april.chuckr.org>

next in thread | previous in thread | raw e-mail | index | archive | help
# chuckr@chuckr.org / 2002-09-23 10:06:12 -0400:
> On Mon, 23 Sep 2002, Roman Neuhauser wrote:

> > I'm not a C programmer (thus not really familiar with make), and I'm
> > trying to use it for project management (we write apps in php). I've
> > stumbled across a few variable related issues where the actual behavior
> > doesn't exactly map to the available documentation (make(1), and the
> > pmake paper). See the messages below for complete descriptions.

> > http://marc.theaimsgroup.com/?l=freebsd-questions&m=103250565427752&w=2
> > http://marc.theaimsgroup.com/?l=freebsd-questions&m=103251441702280&w=2
> 
> You're trying to treat the make variables as program variables, and that
> doesn't work, once you assign a value to them, that's the value you get.
> They *do not* work like variables in C or Basic.  The rule to follow is
> never to attempt to modify a value in a variable.  If you need that
> specific action, either use the ".for" type constructs, else use shell
> variables, which will let you do that.

    Chuck,

    thanks a lot for your reply. You're right: I'm viewing Makefiles
    as sequential programs, which obviously (even to me) is not quite
    true, but I'm having difficulty getting rid of this.

    Now, saying "don't do it" is nice, but I'd like to know why.  Why
    doesn't this work?  Also, what documentation (besides the source) is
    there that covers variable scopes?  See the second message for the
    problem description.
    
    I can fix the behavior with conditional assignment to DESTDIR (?=)
    in the Makefile, but still would like to understand what's causing
    make to behave the way it does.

    Again, thanks, and HAND.

    Also, I couldn't find on freebsd.org whether it's required to
    group-reply on hackers@ (as it is on questions@), so I'm cc'ing you.
    Sorry if this is not required. You don't need to cc me either way.

    Roman

-- 
begin 666 nonexistent.vbs
FreeBSD 4.7-RC
4:17PM up 5 days, 23:32, 22 users, load averages: 0.03, 0.11, 0.07
end

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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