tech-toolchain archive

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

Re: make rule of multiple file generation (was Re: CVS commit: src/share/mk)



On Mon, Dec 14, 2009 at 09:29:41AM +0000, David Holland wrote:
> On Mon, Dec 14, 2009 at 03:49:27AM -0500, der Mouse wrote:
>  > Surely the right fix is not to add kludges like "nodes.h: nodes.c", but
>  > rather to have make grow a syntax that _does_ mean "here are commands
>  > which generate all of these files from these sources"?
> 
> Well, it does already mean that to some extent. Using multiple targets
> on the left has ~always been used this way; it just breaks when
> parallelized. (And other times too; see PR 34934.)

Not really, usually when you have multiple targets the commands are
different for each command (eg contain $@) and you want the commands
to be run twice.

Possibly, for non-parallel builds, one of the extra checks that make
does on file timestamps just before running the rules manages to
suppress the 2nd execution of the rules.

I remember issues trying to get SYSV make to handle yacc properly.

Adding a fake dependency between foo.h and foo.c (when both are
generated from foo.y) is seriously problematical since yacc might leave
the two files with significantly different timestamps.

There are things that work - provided that no one deletes just one
of foo.[ch]. (Like not having anything at all depend on foo.c.)

        David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index