From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 25 11:44:02 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6BAFC37B401 for ; Fri, 25 Apr 2003 11:44:02 -0700 (PDT) Received: from mail.bellavista.cz (mail.bellavista.cz [213.235.167.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 96F8243F75 for ; Fri, 25 Apr 2003 11:44:01 -0700 (PDT) (envelope-from neuhauser@bellavista.cz) Received: from freepuppy.bellavista.cz (freepuppy.bellavista.cz [10.0.0.10]) by mail.bellavista.cz (Postfix) with ESMTP id 8F7C33AD for ; Fri, 25 Apr 2003 20:44:00 +0200 (CEST) Received: by freepuppy.bellavista.cz (Postfix, from userid 1001) id 7D12F2FDAD7; Fri, 25 Apr 2003 20:44:00 +0200 (CEST) Date: Fri, 25 Apr 2003 20:44:00 +0200 From: Roman Neuhauser To: freebsd-hackers Message-ID: <20030425184400.GS13541@freepuppy.bellavista.cz> Mail-Followup-To: freebsd-hackers Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.1i Subject: make: variable expansion in .for/.endfor X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2003 18:44:02 -0000 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? LIST= foo bar baz .if defined(ONE) . for v in ${LIST} . if !defined(WITHOUT_${v:U}) WITH_${v:U}=yes . endif . endfor .endif .if defined(TWO) . for v in ${LIST} V=${v:U} . if !defined(WITHOUT_${V}) WITH_${V}=yes . endif . endfor .endif a: @echo \$${WITH_FOO}: ${WITH_FOO} @echo \$${WITH_BAR}: ${WITH_BAR} @echo \$${WITH_BAZ}: ${WITH_BAZ} .PHONY: a -- If you cc me or remove the list(s) completely I'll most likely ignore your message. see http://www.eyrie.org./~eagle/faqs/questions.html