From owner-freebsd-hackers@FreeBSD.ORG Fri May 16 07:21:26 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 72C3A37B401 for ; Fri, 16 May 2003 07:21:26 -0700 (PDT) Received: from mail.bellavista.cz (mail.bellavista.cz [213.235.167.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6CEDE43FDD for ; Fri, 16 May 2003 07:21:25 -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 71A1842A for ; Fri, 16 May 2003 16:21:24 +0200 (CEST) Received: by freepuppy.bellavista.cz (Postfix, from userid 1001) id 4E5962FDAB2; Fri, 16 May 2003 16:21:24 +0200 (CEST) Date: Fri, 16 May 2003 16:21:24 +0200 From: Roman Neuhauser To: freebsd-hackers Message-ID: <20030516142124.GB1036@freepuppy.bellavista.cz> Mail-Followup-To: freebsd-hackers References: <20030425184400.GS13541@freepuppy.bellavista.cz> <20030426115336.GF761@straylight.oblivion.bg> <20030427124812.GU13541@freepuppy.bellavista.cz> <20030429103404.GA680@straylight.oblivion.bg> <20030429130143.GK13541@freepuppy.bellavista.cz> <20030516123001.GD2047@sunbay.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030516123001.GD2047@sunbay.com> User-Agent: Mutt/1.5.1i Subject: Re: 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, 16 May 2003 14:21:26 -0000 # ru@freebsd.org / 2003-05-16 15:30:01 +0300: > > > On Sun, Apr 27, 2003 at 02:48:12PM +0200, Roman Neuhauser wrote: > > > > # roam@ringlet.net / 2003-04-26 14:53:36 +0300: > > > > > 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? > > > > > > > > > > > > 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 > > > > > > > > > > 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. > > > > > > > > I don't think this is covered. Can you point out the relevant text? > Yes, BUGS section talks about a different problem [...] thanks for confirming. > FWIW, the code snippet above works perfectly under 5.x make(1). good to know > I recall this problem was fixed (perhaps, it was even me, not > sure). Sorry, but I don't have enough time to invest into > backporting the bugfix into RELENG_4, the latter is becoming > less priority for me as 5.x evolves. > > If you'll be able to extract it from HEAD (there is a huge > backlog of non-backported fixes for make(1) there), I will > happily commit it for you. i'll try to find some time, but I'll have a hard time as I don't know much of C... anyway, thanks a bunch for the reply! -- 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