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)

> Fixing parallelization in Makefiles is simple and adequately done
> with the existing make features, or by correcting the scripts that
> generate files to use unique filenames.

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"?

It's not perfect, but it seems better to me than declaring dependencies
which do not really exist (in this case, nodes.h does not actually
depend on nodes.c).

If we need a strawman syntax for it, I'll propose

target1 target2 ... :& dependency1 dependency2 ...
        ...commands as usual...

This leads to issues with $@ and $(.TARGET), which I will propose
(again, as a total strawman) to deal with by saying that, in the
commands for a :& dependency, $@ and $(.TARGET) are not defined, and a
new local variable $(.TARGETS) is.

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML      
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

Home | Main Index | Thread Index | Old Index