[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Execute command for each file in list?
From: |
Sam Ravnborg |
Subject: |
Re: Execute command for each file in list? |
Date: |
Wed, 18 Jun 2008 15:36:44 +0200 |
User-agent: |
Mutt/1.4.2.1i |
On Wed, Jun 18, 2008 at 05:11:39AM -0700, 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!
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