help-make
[Top][All Lists]
Advanced

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

Re: Build Rule Race Condition


From: Greg Chicares
Subject: Re: Build Rule Race Condition
Date: Wed, 19 Aug 2009 17:03:08 +0000
User-agent: Thunderbird 2.0.0.21 (Windows/20090302)

On 2009-08-19 16:28Z, Schuster, Peter wrote:
> 
>       %.a %.b %.c: %.source
>               process $<
[...special cases:]
>       myfile1.a myfile1.b myfile1.c: myfile1.temporary
>               process myfile1.temporary
>       
>       myfile2.a myfile2.b myfile2.c: myfile2.temporary
>               process myfile2.temporary
> 
> and so on for 14 special case files.
> 
> However because they've set it up so that all these special case files
> have a naming convention of <name>_snp.source, it looks like I can still
> define a new pattern rule of
> 
>       %_snp.a %_snp.b %_snp.c: %_snp.temporary
>               process $<
> 
> This works, but only if I define the special case rule before the
> generic rule, so this seems like hackery to me.  Is this "safe" in the
> long run, or do I need to look for a better solution?

It's safe because the 'make' manual documents it:

| The order in which pattern rules appear in the makefile is important
| since this is the order in which they are considered. Of equally
| applicable rules, only the first one found is used.

Of course, you might like to add comments to your makefile warning
maintainers not to rearrange pattern rules, if you see a risk there.




reply via email to

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