Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Apr 2003 14:53:36 +0300
From:      Peter Pentchev <roam@ringlet.net>
To:        freebsd-hackers <freebsd-hackers@freebsd.org>
Subject:   Re: make: variable expansion in .for/.endfor
Message-ID:  <20030426115336.GF761@straylight.oblivion.bg>
In-Reply-To: <20030425184400.GS13541@freepuppy.bellavista.cz>
References:  <20030425184400.GS13541@freepuppy.bellavista.cz>

next in thread | previous in thread | raw e-mail | index | archive | help

--WIyZ46R2i8wDzkSu
Content-Type: text/plain; charset=windows-1251
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Apr 25, 2003 at 08:44:00PM +0200, Roman Neuhauser wrote:
> Try the following makefile: it works if called with -DONE, but does not
> if called with -DTWO. Should I treat it as a bug and file a PR?
>=20
> LIST=3D foo bar baz
>=20
> .if defined(ONE)
> .  for v in ${LIST}
> .    if !defined(WITHOUT_${v:U})
> WITH_${v:U}=3Dyes
> .    endif
> .  endfor
> .endif
>=20
> .if defined(TWO)
> .  for v in ${LIST}
> V=3D${v:U}
> .    if !defined(WITHOUT_${V})
> WITH_${V}=3Dyes
> .    endif
> .  endfor
> .endif
>=20
> a:
> 	@echo \$${WITH_FOO}: ${WITH_FOO}
> 	@echo \$${WITH_BAR}: ${WITH_BAR}
> 	@echo \$${WITH_BAZ}: ${WITH_BAZ}
>=20
> .PHONY: a

I think this is a known bug, and it seems to even be documented
in the BUGS section of -STABLE's make(1) manual page.

G'luck,
Peter

--=20
Peter Pentchev	roam@ringlet.net    roam@sbnd.net    roam@FreeBSD.org
PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
If I had finished this sentence,

--WIyZ46R2i8wDzkSu
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQE+qnM/7Ri2jRYZRVMRAhGoAJ9e9+hBMh83hqG49Pr+B71cUtp5HgCeOHGM
SVxX2d2B97+U2FCOLq6MnYg=
=UljX
-----END PGP SIGNATURE-----

--WIyZ46R2i8wDzkSu--



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