On Dec 14, 12:41pm, uebay...@tombi.co.jp (Masao Uebayashi) wrote: -- Subject: Re: make rule of multiple file generation (was Re: CVS commit: sr
| > So this is fixed with an additional dependency to force serialization, | > or by fixing the script not to re-use the same temp filenames: | > | > nodes.h: nodes.c | > nodes.c nodes.h: mknodes.sh nodetypes nodes.c.pat | > ${_MKTARGET_CREATE} | > ${SCRIPT_ENV} ${HOST_SH} ${.ALLSRC:S/^nodes.c$//} ${.OBJDIR} | > [ -f nodes.h ] | | You should have written this version at first. :) Well, I did not undestand what the problem was at the time :-) | This seems work for me. I think I tried a similar one but clearly I figured | out the trick of removing nodes.c from ${.ALLSRC}. | | Next is usr.bin/ktruss. That worked ok for me with -j 4. | > Still you have not shown me why GENCMD is necessary... For me it adds | > complexity and slows things down. Fixing parallelization in Makefiles | > is simple and adequately done with the existing make features, or by | | $GENCMD provides a way to extract only one output file. It looks like | complex because it's embedded in makefile. I don't think it's really complex. | It's just redundant. :) Yes, it adds more explicit rules... My vote is to remove it and fix the Makefiles/scripts that are broken. It is pretty straight-forward. | > correcting the scripts that generate files to use unique filenames. | | Actually I like this more. We could do both, but forcing serialization is probably more efficient since it causes the script to be invoked only once and avoids races. christos