Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Mar 2003 00:18:56 +0200
From:      Ruslan Ermilov <ru@FreeBSD.ORG>
To:        Alexander Leidinger <Alexander@Leidinger.net>
Cc:        arch@FreeBSD.ORG
Subject:   Re: Bug in our make or undocumented feature?
Message-ID:  <20030315221856.GB54789@sunbay.com>
In-Reply-To: <20030315165221.27d3d424.Alexander@Leidinger.net>

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

[-- Attachment #1 --]
On Sat, Mar 15, 2003 at 04:52:21PM +0100, Alexander Leidinger wrote:
> Hi,
> 
> this part of a makefile doesn't work for me:
> ---snip---
> WANTED_PORTS=	shells/zsh lang/perl5
> 
> mytarget:
> .for i in ${WANTED_PORTS}
> 	@echo "${i}"
> .if ${i} == lang/perl5  
> 	@echo "Yep, perl5."
> .endif
> .endfor
> ---snip---
> 
This is the nasty implementation of the .for operator.
It works by duplicating the lines for each argument,
substituting the value, so the above would be evaluate
like this, so that i isn't a real variable:

mytarget:
	@echo "shells/zsh"
.if shells/zsh == lang/perl5  
	@echo "Yep, perl5."
.endif
	@echo "lang/perl5"
.if lang/perl5 == lang/perl5  
	@echo "Yep, perl5."
.endif

After that, the (recently documented) rule requiring the
LHS of the test to be a variable should be applied.

P.S.  -arch was a bad choice for mailing this.


Cheers,
-- 
Ruslan Ermilov		Sysadmin and DBA,
ru@sunbay.com		Sunbay Software AG,
ru@FreeBSD.org		FreeBSD committer,
+380.652.512.251	Simferopol, Ukraine

http://www.FreeBSD.org	The Power To Serve
http://www.oracle.com	Enabling The Information Age

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQE+c6bQUkv4P6juNwoRApO1AJoCGeZcVdY0H11Za834BbbSWD7TtwCfdUUs
ptSxLDEydClutHzucH5sEL0=
=wzER
-----END PGP SIGNATURE-----
home | help

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