tech-toolchain archive

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

Re: bsd.lib.mk question



On Wed, Jun 8, 2011 at 2:01 AM, David Holland 
<dholland-tech%netbsd.org@localhost> wrote:
> On Tue, Jun 07, 2011 at 08:26:06AM -0700, Simon Gerraty wrote:
>  >> The best bet would be::
>  >>
>  >>     parser.h: parser.y
>  >>             ${YACC} -d -o ${.TARGET:T:R}.c ${.IMPSRC}
>  >>             mv t.tab.y ${.TARGET}
>  >>
>  >>     parser.c:       parser.h
>  >>
>  >>     file1.o:        parser.h
>  >>
>  >> This avoids the race conditions as well as the chance of cyclic
>  >> dependencies.
>
> With at least some makes, this will (possibly depending on timestamps)
> cause parser.o to be recompiled from parser.c every time you type
> make, because it's been "rebuilt" by the null rule. Furthermore, it's
> lying to make, which never works out well in the long run. The only
> correct way to handle these cases is to declare to make in some
> fashion that the recipe creates multiple files.

What's wrong with the wrapper approach which wraps those commands to
generate single output file?  This should work as long as those
command output is reproducible.


Home | Main Index | Thread Index | Old Index