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
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to