From owner-freebsd-ports Thu Jan 28 21:18:31 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA22351 for freebsd-ports-outgoing; Thu, 28 Jan 1999 21:18:31 -0800 (PST) (envelope-from owner-freebsd-ports@FreeBSD.ORG) Received: from allegro.lemis.com (allegro.lemis.com [192.109.197.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA22338 for ; Thu, 28 Jan 1999 21:18:28 -0800 (PST) (envelope-from grog@freebie.lemis.com) Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137]) by allegro.lemis.com (8.9.1/8.9.0) with ESMTP id PAA29359; Fri, 29 Jan 1999 15:48:25 +1030 (CST) Received: (from grog@localhost) by freebie.lemis.com (8.9.2/8.9.0) id PAA15095; Fri, 29 Jan 1999 15:48:20 +1030 (CST) Date: Fri, 29 Jan 1999 15:48:20 +1030 From: Greg Lehey To: "Scot W. Hetzel" Cc: Roland Jesse , freebsd-ports@FreeBSD.ORG Subject: Re: `for` construct in Makefiles Message-ID: <19990129154820.N8473@freebie.lemis.com> References: <14001.1199.669731.947141@knecht> <01d401be4b39$718f7a40$0dcb2e9c@westbend.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.1i In-Reply-To: <01d401be4b39$718f7a40$0dcb2e9c@westbend.net>; from Scot W. Hetzel on Thu, Jan 28, 1999 at 09:42:49PM -0600 WWW-Home-Page: http://www.lemis.com/~grog Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Thursday, 28 January 1999 at 21:42:49 -0600, Scot W. Hetzel wrote: > From: Roland Jesse > >> Hello, >> >> I am currently in the process of putting together the port for ACE >> 4.6. >> >> I already set up the PLIST file with all the names of the files to be installed >> (which is only a subset of work/ACE_wrappers). >> >> To install all the files, I ended up trying the following: >> >> ------- snip ------- >> INSTALLFILES!= cat pkg/PLIST >> >> do-install: >> @${MKDIR} ${PREFIX}/ACE_wrappers >> for i in ${INSTALLFILES} >> do >> cp work/${i} ${PREFIX}/ACE_wrappers/${i} >> done >> ------- snap ------- >> >> This does not work. The error message is: > > I believe you have to use $${i} in make files. As the "for .. " statement is > run in a separate shell, and the extra $ escapes the second. In addition, the continuation rules for Makefiles are different from those for the shell. You can't write this loop over several lines. You must write it as a single logical line, which requires semicolons where you wouldn't necessarily expect them: for i in ${INSTALLFILES}; do cp work/$${i} ${PREFIX}/ACE_wrappers/$${i}; done You can spread it over multiple lines with \, but you still need the semicolons: for i in ${INSTALLFILES}; \ do \ cp work/$${i} ${PREFIX}/ACE_wrappers/$${i}; \ done Greg -- See complete headers for address, home page and phone numbers finger grog@lemis.com for PGP public key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message