[m-dev.] Diff: Fix missing dependency in generated .dep files

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Mar 18 03:12:21 AEDT 1999


On 17-Mar-1999, Warwick Harvey <wharvey at cs.monash.edu.au> wrote:
> The generated `.dep' file for a program does not declare the dependency of 
> the `_init.c' file on the other `.c' files which comprise the program.

Yes, but that's because the `_init.c' file normally does *not* depend
on the other `.c' files which comprise the program. 
Your proposed change would force `_init.c' to be rebuilt every time
anything at all has changed, for every program.  For most programs,
that's not necessary, and it slows down mmakes, so it's undesirable.

The exception comes only if you use the `--extra-inits' option to c2init.
Then the `_init.c' file does depend on the other `.c' files.  But
in that case, you can easily add the extra dependencies manually.

So, I suggest you do not commit this change.  Instead, if you want to do
something about this, you should either

	(a) improve the documentation of the `--extra-inits' c2init
	    option to make it clear that if you use it then you need to
	    add the extra dependencies manually; or

	(b) - add an `--extra-inits' option to mmc,
	    - have `mmc --generate-dependencies' spit out the extra
	      dependencies only if `--extra-inits' is specified,
	    - and change the documentation for `--extra-inits' in c2init to
	      say that you need to include `--extra-inits' in MCFLAGS as
	      well as C2INITFLAGS so that it gets passed to
	      `mmc --generate-dependencies'.

Of the two, (a) is easier.  (b) is perhaps slightly nicer for users,
but the difference is marginal, and probably not worth the extra
implementation effort.  So I'd recommend (a).

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.



More information about the developers mailing list