Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 May 2009 09:31:53 +0100
From:      Anton Shterenlikht <mexas@bristol.ac.uk>
To:        freebsd-questions@freebsd.org
Subject:   make - reassign variable using if-then ?
Message-ID:  <20090506083152.GA48658@mech-cluster238.men.bris.ac.uk>

next in thread | raw e-mail | index | archive | help
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



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