home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gossip.pyramid.com!pyramid!infmx!hartman
- From: hartman@informix.com (Robert Hartman)
- Newsgroups: comp.unix.shell
- Subject: Re: Problem with sh-commands from a Makefile
- Message-ID: <1993Jan21.184558.27566@informix.com>
- Date: 21 Jan 93 18:45:58 GMT
- References: <1993Jan20.211940.18612@odin.diku.dk>
- Sender: news@informix.com (Usenet News)
- Organization: Informix Software, Inc.
- Lines: 21
-
- In article <1993Jan20.211940.18612@odin.diku.dk> turin@diku.dk (S|ren Turin) writes:
- >Hi netters.
- > ...
- >
- >all :
- > (for dir in $(DIRS) ; do cd ${dir} ; make VARS=$(VARS) ; done)
- >
- >The problem is that ${dir} evaluates to "" ($dir evaluates to "ir",
- >FYI) so make never descends into any of the relevant subdirectories.
-
- You need to delay the expansion of $dir by prepending a second $.
- Try this:
-
- all:
- for dir in $(DIRS); do cd $$dir ; ... ; done
- ^^
-
- make expands $$ to $, and then the shell sees $dir, which it expands
- correctly.
-
- -r
-