Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Feb 2004 06:04:52 +0100
From:      Oliver Eikemeier <eikemeier@fillmore-labs.com>
To:        Sergey Matveychuk <sem@ciam.ru>
Cc:        ports@freebsd.org
Subject:   Re: Makefile: .if inside .for
Message-ID:  <401F2BF4.4080300@fillmore-labs.com>
In-Reply-To: <401F14D6.4020201@ciam.ru>
References:  <401F14D6.4020201@ciam.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
Sergey Matveychuk wrote:

> man make says:
>      For loops are expanded before tests, so a fragment such as:
> 
>            .for TMACHINE in ${SHARED_ARCHS}
>            .if ${TMACHINE} = ${MACHINE}
>                 ...
>            .endif
>            .endfor
> 
>      won't work, and should be rewritten the other way around.
> 
> But how can I rewrite it if I need to aggregate file names in 
> PLIST_FILES with a some condition in a loop?

Try

.for TMACHINE in ${SHARED_ARCHS}
.if ${MACHINE} == ${TMACHINE}
     ...
.endif
.endfor

or use a shell loop.



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