On Miércoles 08 Septiembre 2010 12:06:33 Gerald Lutter escribió:
> Hello List,
> 
> I'm using make (3.81) from cygwin and I encountered the following "problem"
> with a rule that looks like this:
> 
> $(targetlist): $(sourcelist)
>       do something that generates $(targetlist) from $(sourcelist)
> 
> Now in my case the receipe is executed several times (number of entries
> inside the target list). I think this depends on the evaluation of multiple
> target rules described inside the gnu make manual. But the receipe builds
> all three files together and therefore the command does not have to be
> executed more than one time.
> 
> My question is now, is there a possibility to change this behaviour or do I
> have to reduce the number of targets to prevent this?

You can use a control file like this:

$(targetlist) : controlfile

controlfile : $(sourcelist)
        do something that generates $(targetlist) from $(sourcelist)
        touch controlfile

That way, the 'something' is invoked only once, and all files in $(targetlist) 
are marked as up-to-date later, as controlfile is

Hope this helps

Noel
er Envite

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to