From owner-freebsd-ports Mon Mar 11 14:55:48 2002 Delivered-To: freebsd-ports@freebsd.org Received: from alcatraz.iptelecom.net.ua (alcatraz.iptelecom.net.ua [212.9.224.15]) by hub.freebsd.org (Postfix) with ESMTP id 7120F37B417; Mon, 11 Mar 2002 14:55:35 -0800 (PST) Received: from ipcard.iptcom.net (ipcard.iptcom.net [212.9.224.5]) by alcatraz.iptelecom.net.ua (8.9.3/8.9.3) with ESMTP id AAA31133; Tue, 12 Mar 2002 00:55:32 +0200 (EET) (envelope-from sobomax@FreeBSD.org) Received: from h67.227.dialup.iptcom.net (h67.227.dialup.iptcom.net [212.9.227.67]) by ipcard.iptcom.net (8.9.3/8.9.3) with ESMTP id AAA58020; Tue, 12 Mar 2002 00:55:30 +0200 (EET) (envelope-from sobomax@FreeBSD.org) Subject: Re: .for woes From: Maxim Sobolev To: Ernst de Haan Cc: ports@FreeBSD.org In-Reply-To: <02031123024601.00964@heinz> References: <02031123024601.00964@heinz> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-6h6zXhjxz1yCcGJVqSiV" Message-Id: <1015887321.1763.42.camel@notebook> Mime-Version: 1.0 X-Mailer: Evolution/1.0.2 Date: 12 Mar 2002 00:55:25 +0200 Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --=-6h6zXhjxz1yCcGJVqSiV Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, 2002-03-12 at 00:02, Ernst de Haan wrote: > Hi, >=20 > I'm noticing some weird behaviour. This is my test Makefile: >=20 > PORTNAME=3D testport > PORTVERSION=3D 1 > FILES:=3D ${FILESDIR}/a \ > ${FILESDIR}/b > CATEGORIES=3D # > =20 > DISTFILES=3D # > EXTRACT_ONLY=3D # > =20 > do-build: > @${ECHO_CMD} "Files: ${FILES}" > .for f in ${FILES} > @${ECHO_CMD} "File $f..." > .endfor > =20 > .include >=20 > Surprisingly, the result of running 'make' is: >=20 > =3D=3D=3D> Extracting for testport-1 > =3D=3D=3D> Patching for testport-1 > =3D=3D=3D> Configuring for testport-1 > =3D=3D=3D> Building for testport-1 > Files: /usr/home/ernst/testport/files/a /usr/home/ernst/testport/file= s/b > File /a... > File /b... >=20 > How do I get the full file names within the .for ? That because expansion of the variable ${FOO} in the `.for bar in ${FOO}' statement is performed immediately at the time of parsing, while expansion of all other variables is deferred until they are actually used in target. Since in your case ${FILESDIR} isn't defined when make(1) parses .for statement it expands to "". To make your snippet working you can use one of the following two ways: 1. Include before .for statement and use `=3D' instead of `:=3D' to assign value to ${FILES}; 2. Rewrite the code to be: FILES=3D foo bar [...] do-build: [...] .for f in ${FILES} @${ECHO_CMD} "File ${FILESDIR}/$f..." .endfor -Maxim --=-6h6zXhjxz1yCcGJVqSiV Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQA8jTXYoNu5t4iCBa8RArr2AJ0WBlkBF4fUmiwarjlDlRqLacfXxACfR9r5 buOYmSRkav7UAeBNUZ6vr14= =MXGw -----END PGP SIGNATURE----- --=-6h6zXhjxz1yCcGJVqSiV-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message