From owner-freebsd-questions@FreeBSD.ORG Wed May 6 08:32:03 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 9E6721065670 for ; Wed, 6 May 2009 08:32:03 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from dirg.bris.ac.uk (dirg.bris.ac.uk [137.222.10.102]) by mx1.freebsd.org (Postfix) with ESMTP id 5CF848FC1F for ; Wed, 6 May 2009 08:32:03 +0000 (UTC) (envelope-from mexas@bristol.ac.uk) Received: from seis.bris.ac.uk ([137.222.10.93]) by dirg.bris.ac.uk with esmtp (Exim 4.69) (envelope-from ) id 1M1cXm-0005aK-SK for freebsd-questions@freebsd.org; Wed, 06 May 2009 09:32:02 +0100 Received: from mech-cluster238.men.bris.ac.uk ([137.222.187.238]) by seis.bris.ac.uk with esmtp (Exim 4.67) (envelope-from ) id 1M1cXk-0002Wf-3A for freebsd-questions@freebsd.org; Wed, 06 May 2009 09:31:56 +0100 Received: from mech-cluster238.men.bris.ac.uk (localhost.men.bris.ac.uk [127.0.0.1]) by mech-cluster238.men.bris.ac.uk (8.14.3/8.14.3) with ESMTP id n468VtlW048850 for ; Wed, 6 May 2009 09:31:55 +0100 (BST) (envelope-from mexas@bristol.ac.uk) Received: (from mexas@localhost) by mech-cluster238.men.bris.ac.uk (8.14.3/8.14.3/Submit) id n468VrK6048849 for freebsd-questions@freebsd.org; Wed, 6 May 2009 09:31:53 +0100 (BST) (envelope-from mexas@bristol.ac.uk) X-Authentication-Warning: mech-cluster238.men.bris.ac.uk: mexas set sender to mexas@bristol.ac.uk using -f Date: Wed, 6 May 2009 09:31:53 +0100 From: Anton Shterenlikht To: freebsd-questions@freebsd.org Message-ID: <20090506083152.GA48658@mech-cluster238.men.bris.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-Spam-Score: -1.4 X-Spam-Level: - Subject: 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 08:32:03 -0000 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? % make /usr/home/mexas one VAR=two one And gmake gives an error: % gmake makefile:7: *** missing separator. Stop. % please help many thanks anton -- Anton Shterenlikht Room 2.6, Queen's Building Mech Eng Dept Bristol University University Walk, Bristol BS8 1TR, UK Tel: +44 (0)117 928 8233 Fax: +44 (0)117 929 4423