Date: Fri, 29 Jan 1999 15:48:20 +1030 From: Greg Lehey <grog@lemis.com> To: "Scot W. Hetzel" <hetzels@westbend.net> Cc: Roland Jesse <jesse@prinz-atm.CS.Uni-Magdeburg.De>, freebsd-ports@FreeBSD.ORG Subject: Re: `for` construct in Makefiles Message-ID: <19990129154820.N8473@freebie.lemis.com> In-Reply-To: <01d401be4b39$718f7a40$0dcb2e9c@westbend.net>; from Scot W. Hetzel on Thu, Jan 28, 1999 at 09:42:49PM -0600 References: <14001.1199.669731.947141@knecht> <01d401be4b39$718f7a40$0dcb2e9c@westbend.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday, 28 January 1999 at 21:42:49 -0600, Scot W. Hetzel wrote: > From: Roland Jesse <jesse@prinz-atm.CS.Uni-Magdeburg.De> > >> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990129154820.N8473>