Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site calma.UUCP
Path: utzoo!linus!decvax!decwrl!sun!calma!radzy
From: radzy@calma.UUCP (Tim Radzykewycz)
Newsgroups: net.unix
Subject: Re: a Make question
Message-ID: <32@calma.UUCP>
Date: Wed, 30-Oct-85 11:17:36 EST
Article-I.D.: calma.32
Posted: Wed Oct 30 11:17:36 1985
Date-Received: Sun, 3-Nov-85 11:25:49 EST
References: <1596@uwmacc.UUCP>
Reply-To: radzy@calma.UUCP (Tim Radzykewycz)
Distribution: net
Organization: GE/Calma Co., R&D Systems Engineering, Milpitas, CA
Lines: 19
Keywords: make
Summary: 

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.

To get a '$' char down to the shell that actually executes the
commands, simply double it:
	DIRS = d1 d2 d3 d4 d5
    depend: ; (for dir in $(DIRS); do (cd $$dir; make depend); done)
					  ^^
This prevents make from seeing it as a variable, and it does the
right thing.
-- 
Tim (radzy) Radzykewycz, The Incredible Radical Cabbage
	calma!radzy@ucbvax.ARPA
	{ucbvax,sun,csd-gould}!calma!radzy