help-make
[Top][All Lists]
Advanced

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

Re: Rule to compile file[0-9].lf + file.file => file[0-9].view


From: bofrost
Subject: Re: Rule to compile file[0-9].lf + file.file => file[0-9].view
Date: Mon, 11 Jul 2011 00:36:38 -0700 (PDT)



Stefano Lattarini wrote:
> 
> On Saturday 09 July 2011, Lane Schwartz wrote:
>> On Sat, Jul 9, 2011 at 10:26 AM, Lane Schwartz <address@hidden>
>> wrote:
>> > # Define a rule template
>> > define COMPILE
>> >
>> > file$n.view: file$n.lf bla.file
>> >     echo "compiling"
>> >
>> > endef
>> >
>> >
>> > # Dynamically generate new makefile rules
>> > $(foreach n,1 2 3 4 5,\
>> >     $(eval COMPILE))
>> 
>> Oops. Typo. In eval, you need $COMPILE instead of COMPILE.
>>
> I think you need $(COMPILE), in fact.
> 
Thank you for your help, dynamically generating makefile rules is working
great!
I’m using following template:

define CREATEVIEW
%$n.view : ./src/dds/%$n.lf %.file
        @printf "Compiling %-44s to %-15s " $$< "$$*.view:"
        […]
endef

and generate my rules like this:

$(foreach n,0 1 2 3 4 5 6 7 8 9,$(eval ${CREATEVIEW}))

So it is automatically creating my views and my tables if they do not exist!
Best regards,
Bofrost

-- 
View this message in context: 
http://old.nabble.com/Rule-to-compile-file-0-9-.lf-%2B-file.file-%3D%3E-file-0-9-.view-tp32019482p32035396.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]