bug-make
[Top][All Lists]
Advanced

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

Re: Conditional recipe execution


From: SF Markus Elfring
Subject: Re: Conditional recipe execution
Date: Mon, 19 Jan 2015 08:39:06 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

>> Would use cases around the standard command "split" be concrete enough
>> for further clarification?
>> https://en.wikipedia.org/wiki/Split_%28Unix%29
> 
> No.

I am bit surprised that you find such a tool as an unclear example
at the moment.

I am using my Python script which I developed as a contribution for
a discussion around the topic 'Splitting search results from a "find -print0'.
http://lists.gnu.org/archive/html/coreutils/2015-01/msg00023.html


> You need to describe your situation.  Use words, but with detail.

I would like to perform some file searches. The found files should be
analysed by dedicated programs.

A couple of programs which I use for corresponding data processing
are still single-threaded. But I want to get all processor cores
working on the search result.
So I split it into smaller files which I can give to each core
as a work unit. Is this approach just an ordinary parallel work flow?


> It sounds to me like you what you mean is you have a single recipe which
> generates multiple output files and you want those files to be
> prerequisites of other targets.

Yes, exactly.


> There are two possibilities.  The best case is that the generated files
> and the input file(s) are all related to each other through some aspect
> of the filename:

I have found that there are some software development challenges to consider
for safe parallel data processing.


> in that case you can use pattern rules and everything is simple.

I noticed a situation where such "a special case" needs to be detected.

A recipe was executed multiple times by the tool "make" for each
passed target.


> So for example the "bison" parser generator takes a file "foo.y" and
> generates "foo.tab.h" and "foo.tab.c": the names of the output files are
> related to the name of the input file through the "foo" prefix.

This is another well-known use case.


> Now listing "foo.tab.c" or "foo.tab.h" as a prerequisite will cause this
> rule to be run one time, with "foo.y" as the prerequisite and make knows
> both files are generated by a single invocation.

Are there any cases left over where the make tool will interpret a rule
specification in the way that "a single invocation" is not sufficient?


> The other possibility is that the names of the generated files have no
> relationship to the names of the input files.

There is a relationship of course. But make file pattern operators can
be inappropriate in some cases of my build scripts.


> In this case you'll have to use a "sentinel file":
> 
>     output list: .sentinel ;

I would interpret this specification as a rule with an empty recipe.
How does this approach help?

Regards,
Markus



reply via email to

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