From owner-freebsd-questions@FreeBSD.ORG Wed May 6 09:15:13 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56D08106566C for ; Wed, 6 May 2009 09:15:13 +0000 (UTC) (envelope-from mel.flynn+fbsd.questions@mailing.thruhere.net) Received: from mailhub.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id ECF498FC08 for ; Wed, 6 May 2009 09:15:12 +0000 (UTC) (envelope-from mel.flynn+fbsd.questions@mailing.thruhere.net) Received: from sarevok.dnr.servegame.org (mailhub.rachie.is-a-geek.net [192.168.2.11]) by mailhub.rachie.is-a-geek.net (Postfix) with ESMTP id A4FD47E837; Wed, 6 May 2009 01:15:10 -0800 (AKDT) From: Mel Flynn To: freebsd-questions@freebsd.org Date: Wed, 6 May 2009 11:15:07 +0200 User-Agent: KMail/1.11.2 (FreeBSD/8.0-CURRENT; KDE/4.2.2; i386; ; ) References: <20090506083152.GA48658@mech-cluster238.men.bris.ac.uk> In-Reply-To: <20090506083152.GA48658@mech-cluster238.men.bris.ac.uk> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200905061115.07888.mel.flynn+fbsd.questions@mailing.thruhere.net> Cc: Anton Shterenlikht Subject: Re: make - reassign variable using if-then ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2009 09:15:13 -0000 On Wednesday 06 May 2009 10:31:53 Anton Shterenlikht wrote: > I've this simple makefile: > > VAR=one > > all : main > > main : > @echo ${.CURDIR} > .if ${.CURDIR} > @echo ${VAR} > VAR=two > @echo ${VAR} > .endif > > When I output VAR second time, the value is still "one", and not the > new value "two". Why? Because it is expanded before being passed to the shell. Sh sees: echo one VAR=two echo one What are you really trying to accomplish? -- Mel