help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why doesn't this work properly?


From: Brian Dessent
Subject: Re: Why doesn't this work properly?
Date: Fri, 31 Aug 2007 11:51:03 -0700

Rick Flower wrote:

> ====================================================
> build_teststubs: $(TESTSTUB_SOURCES)
>         $(foreach srcfile, $(TESTSTUB_SOURCES), ln -s $(srcfile) .)
> 
> all: build_teststubs $(OBJECTS)
> ====================================================
> 
> Once I run this I get output like the following :
> 
> ln -s /export/home/mylogin/foo/bar/bah/teststubs/src/foo.cc .  ln -s
> /export/home/mylogin/foo/bar/bah/teststubs/src/bar.cc .

Foreach is just a simple string processing function.  It has no idea
that "ln -s $(srcfile) ." is actually a command, so the output of the
foreach expansion is just one long list of words.  That's not a valid
command.  You need to add a delimiter to separate each ls invocation,
e.g. "$(foreach srcfile, $(TESTSTUB_SOURCES), ln -s $(srcfile) . ;)".

Brian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]