tech-pkg archive

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

Re: MAKE_JOBS_SAFE=[number]



On Thu, Oct 04, 2012 at 05:36:12AM +0000, David Holland wrote:
>  > Actually, yacc runs are often a problem. A lot of people out there do not
>  > understand make, and they think that:
>  > 
>  > file.c file.h:     file.y
>  >    some yacc rule
>  > 
>  > is going to work.
>  > 
>  > Not so, since that expands to two separate targets, and yacc may very well
>  > be generating file.c while file.h is being used elsewhere. Oops.
> 
> This issue is the subject of periodic flamewars, because even though
> the label on bmake's koolaid packets says what you've described, the
> historical and traditional make behavior is that what you've cited is
> in fact a correct yacc rule.

Well, posix says so. Go fix posix.

the one thing that can save you is that make -j is not historical, nor
totally standardized, so you have some leeway (a lot) in the order in
which you apply rules, and there's nothing that prevents you from being
smart there.

But in truth, if you want to write makefiles that work, you have to be
conservative in there. Again, because posix says it's two rules, so some
make out there are going to interpret it as two rules, and then you're hosed,
so you really have to create an intermediate stamp file if you want to be
sure things work fine.



Home | Main Index | Thread Index | Old Index