help-make
[Top][All Lists]
Advanced

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

Re: creating multiple outputs with a tool in one step


From: James McElhannon
Subject: Re: creating multiple outputs with a tool in one step
Date: Mon, 8 Feb 2010 05:26:44 -0500



--------------------------------------------------
From: "James McElhannon" <address@hidden>
Sent: Monday, February 08, 2010 5:14 AM
To: "Oleksandr Gavenko" <address@hidden>; <address@hidden>
Subject: Re: creating multiple outputs with a tool in one step

Let me change my description of what I'm trying to do.

I have a tool, mytool, that has a very long startup time (let's say startup is 5 seconds, and processing takes is 1 second per file). When I run it manually, I can feed it a list of files that I have to process:

mytool a.yyy b.yyy c.yyy, etc.

The runtime would be (5 sec + 3 * 1 sec) = 8 sec.

I can certainly do each one separately, but the time is much greater:

mytool a.yyy
mytool b.yyy
mytool c.yyy

The runtime would be (5 sec + 1 sec) * 3 = 18 sec.

In reality, I have around 50 of these files: (5 sec + (1 sec * 50 sec)) = 55 sec vs. (5 sec + 1 sec) * 50 = 300 sec.

Currently, I have it working one at a time. I have a dummy file, extension .zzz, that I use. If .zzz is out of date compared to .yyy, then mytool runs.

I also have a dummy file, makehasrun, that is dependent on *.zzz. That gets me the entire list that has to be re-made (remaking only those .yyy that are out of date, but one at a time as above).

(I know there who hate the idea of a dummy file, but I don't mind if it's faster (to create and debug this make file) and easier to maintain.)

Thanks again,
James

--------------------------------------------------
From: "Oleksandr Gavenko" <address@hidden>
Sent: Monday, February 08, 2010 4:01 AM
To: <address@hidden>
Subject: Re: creating multiple outputs with a tool in one step

On 2010.02.06 19:53, Maxim Yegorushkin wrote:
On 25/01/10 08:59, Oleksandr Gavenko wrote:
On 2010.01.24 16:04, James McElhannon wrote:
> Suppose I have a file A that is dependent on B and C. I have a tool,
> mytool, that can create B and C at one time from their respective
> sources. When making A, I would want make to do "mytool B C" as one > of
> its steps.

Sorry GNU make does not support this directly.

It does. See example 3 on
http://www.gnu.org/software/make/manual/make.html.gz#Pattern-Examples

Wow, I thing than know all, but not!

From manual:

Pattern rules may have more than one target. Unlike normal rules, this does not act as many different rules with the same prerequisites and commands. If a pattern rule has multiple targets, make knows that the rule's commands are responsible for making all of the targets.

So

%.tab.c %.tab.h: %.y
    bison -d $<

for my.tab.c and my.tab.h run bison only once!

--
С уважением, Александр Гавенко.


_______________________________________________
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]