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: Garrett Cooper
Subject: Re: Execute command for each file in list?
Date: Wed, 18 Jun 2008 11:24:36 -0700

Forgive me if I'm wrong, but:

a) isn't there a tab in front of the foreach already, i.e. is it necessary?
b) isn't a tab required in the define rule?

Also, isn't the parentheses supposed to be as so:

$(call

instead of:

$call (

Paul and Sam's solutions are much smarter though, as define is most
likely not what you want here...

-Garrett

On Wed, Jun 18, 2008 at 6:31 AM, PlebianX <address@hidden> wrote:
>
> Nope. Tab doesn't help at all. Can anyone confirm wether or not the script
> fragment generated by foreach is placed where the directive was in the
> original file? I can imagine that if it's just appended to the end of the
> file that this potentially wouldn't work...
>
>
>
> Boris Godin wrote:
>>
>> Missing tab?
>>
>> define FILE_Template
>> (tab here)$(COMPILER) $(FLAGS) $(1)
>> endef
>>
>> Cheers
>>
>>
>> PlebianX wrote:
>>> I'd like to run a command for each file in a list. I feel that the
>>> following
>>> SHOULD work, but appearantly I don't understand how foreach works or
>>> something, because nothing is done (the code is paraphrase for clarity).
>>>
>>> FILES = file1.asm file2.asm file3.asm
>>> COMPILER = path/to/compiler
>>> FLAGS = -mp -o2 -k -m -i/lib
>>>
>>> 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!
>>>
>>
>>
>> --
>> Boris Godin
>> *Java Developer* - Gameloft COR
>> Paraná 560, Nueva Córdoba (CP 5000)
>> Tel.: (+54 0351) 460 26 26 int. 111
>> MSN: address@hidden <mailto:address@hidden>
>>
>> --
>> This message has been scanned for viruses and
>> dangerous content by MailScanner, and is
>> believed to be clean.
>>
>>
>> _______________________________________________
>> 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--tp17981392p17982759.html
> Sent from the Gnu - Make - Help mailing list archive at Nabble.com.
>
>
>
> _______________________________________________
> Help-make mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-make
>




reply via email to

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