"Magnus Hagander" <mha@sollentuna.net> writes:
> I originally tried the approach with
> ifeq ($(PORTNAME),win32)
> perl_archlibexp=$(subst, \,/,$(perl_archlibexp))
> ...
> but then make complained about recursive assignment of the variable. If
> there is a simple way to get around that, it wouldn't be necessary.
Use := not = ...
When you write foo = something, you are defining something that acts
like a macro rather than a constant string, and so the above is a
self-referential macro. In particular $(x) references are not expanded
yet in something that's assigned with =.
Here is an example of the difference:
x = foo
y = bar$(x)
x = baz
If you now evaluate $(y) you will get barbaz, not barfoo (in fact,
there is no need to define x before y at all in this case).
On the other hand, in
x = foo
y := bar$(x)
y is assigned barfoo, and it won't change if x is modified later.
regards, tom lane