help-make
[Top][All Lists]
Advanced

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

Re: foreach/ordering help


From: Russell
Subject: Re: foreach/ordering help
Date: Sun, 03 Nov 2002 13:46:51 +1100

"Paul D. Smith" wrote:
> 
> %% Russell <address@hidden> writes:
> 
>   >> CSRCS = file1.c file2.c file999.c file1000.c
>   >> c.pfs:
>   >> @rm -f $@
>   >> @$(foreach f,$(CSRCS),$(shell echo $(f) >> $@))
> 
>   r> I think each line of the command is spawned as a separate
>   r> shell process. Try to keep all the commands in one line
>   r> (one process):
> 
> He's using make commands like $(foreach ...) and $(shell ...), and those
> are evaluated by make before the command script is actually invoked.
> 
> So, what you're suggesting won't help...

But wouldn't the line: @$(foreach f,$(CSRCS),$(shell echo $(f) >> $@))
end up as a series of shell commands? I thought it would then be more
logical to execute all the shell commands beginning from the start:

@rm -f $@ ; \
$(foreach f,$(CSRCS),$(shell echo $(f) >> $@))

Is this quirk of execution order stated in the manual? I'd
consider it a bug fix if that quirk wasn't so.




reply via email to

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