help-make
[Top][All Lists]
Advanced

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

Re: Execute command for each file in list?


From: PlebianX
Subject: Re: Execute command for each file in list?
Date: Wed, 25 Jun 2008 02:13:14 -0700 (PDT)

I've changed the file to using this method now (%.r34:%.c in my case)
I've got to apolagize also, the code in my previous post was typed off the
top of my head and things like parenthesis bugs were mostly because of that,
rather than the cause of my real problems.
Now make at least tries to run my commands, but for some reason they are
failing. I'm wondering if this is because I'm on windows? The command is
formatted exactly as it is with my current build process (hand-made batch
file :P) but for whatever reason the command misinterprets the options, as
if there were some strange symbol where space should be. I guess that's as
crazy as it sounds, leaving me stuck with .bat files. :(


Paul Smith-20 wrote:
> 
> On Wed, 2008-06-18 at 15:36 +0200, Sam Ravnborg wrote:
> 
>> > define FILE_Template
>> > $(COMPILER) $(FLAGS) $(1)
>> > endef
>> > 
>> > all:
>> >     $(foreach file, $(FILES), $(eval $call( FILE_Template,$(file))))
>> > 
>> > What's happening here that I'm missing? Thanks in advance!
>> 
>> You have some obvious paranthesis bugs.
>> But I think the need for double escaping fouls you.
>> Please read the chapter on "eval" in info make.
>> And consider if you really need to use eval here.
> 
> Sam is right; this is one of those cases where, given a hammer (and eval
> is a hammer with a particularly slippery grip), everything looks like a
> nail.
> 
> What's wrong with the tradition, portable, been-in-use-since-the-1970's
> method of doing this:
> 
> all:
>       for file in $(FILES); do $(COMPILER) $(FLAGS) $$file || exit 1; done
> 
> I mean, besides the fact that is totally wrong given -k and also given
> parallelism (-j)?
> 
> For that matter, what's wrong with the usual method which works properly
> in all situations:
> 
>         all: $(FILES:.asm=.o)
>         
>         %.o : %.asm
>               $(COMPILER) $(FLAGS) $<
> 
> -- 
> -------------------------------------------------------------------------------
>  Paul D. Smith <address@hidden>          Find some GNU make tips at:
>  http://www.gnu.org                      http://make.mad-scientist.us
>  "Please remain calm...I may be mad, but I am a professional." --Mad
> Scientist
> 
> 
> _______________________________________________
> Help-make mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-make
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Execute-command-for-each-file-in-list--tp17981392p18106061.html
Sent from the Gnu - Make - Help mailing list archive at Nabble.com.





reply via email to

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