Cleanup of make dependencies to fix the parallell build races.
Actually the problem was quite basic, and also manifested itself on
the call to cf_gen.
The problematic rules look like:
target1 target2: some.dependency
command wich makes both of target1 and target2
this is incompatible with make -j, as make assumes the command only
builds one of the targets (the one available in $@).
There are two ways to work around this. One is to make the command
only build one of the targets (as done in fs/ and repl/), the other to chain
dependencies between the two targets with some "magic" to have the first
target in the chain rebuilt in case it alone gets removed..
target1: target2
@sh -c "test -f target1 || command to regenerate the targets"
target2: dependency
command to regenerate the targets
Tested on RedHat Linux 6.2 (GNU Make) and FreeBSD 4.0.