Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/17/84 chuqui version 1.9 3/12/85; site unisoft.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!cmcl2!seismo!lll-crg!dual!unisoft!fnf From: fnf@unisoft.UUCP Newsgroups: net.unix Subject: Re: a Make question Message-ID: <591@unisoft.UUCP> Date: Wed, 30-Oct-85 23:18:12 EST Article-I.D.: unisoft.591 Posted: Wed Oct 30 23:18:12 1985 Date-Received: Sat, 2-Nov-85 07:38:55 EST References: <1596@uwmacc.UUCP> Reply-To: fnf@unisoft.UUCP (Fred Fish) Distribution: net Organization: UniSoft Systems, Berkeley Lines: 25 In article <1596@uwmacc.UUCP> jwp@uwmacc.UUCP (Jeffrey W Percival) writes: >Here's a simple makefile: > > DIRS = d1 d2 d3 d4 d5 > depend: ; (for dir in $(DIRS); do (cd $dir; make depend); done) > >The problem with this is that 'make' is interpreting the $d as a null >string, so the 'cd' command sees an argument of "ir". I tried >escaping the $ preceding dir, to no avail. Can anybody make the >above loop work, or suggest a better way? Thanks! Try: ========================== DIRS = d1 d2 d3 d4 d5 depend: $(DIRS) $(DIRS): FRC cd $@; make depend FRC: ========================== -Fred