A question on C programming style

Chris Dollin kers at hplb.hpl.hp.com
Mon Apr 15 18:32:13 AEST 1991


Steve Summit says [apropos the Nexted Include discussion]:

   ... Manual Makefile
   maintenance quickly becomes nearly impossible, so an automatic
   Makefile generating scheme, which follows the nested #include
   directives reliably, is a requirement.

Why does manual makefile maintainance ``become nearly impossible'' (presuming
that it wasn't already)? I handle this particular problem by having entries
for each .h file, treating the includes as ``dependencies'', with a ``touch''
command as the action: thus, if foo.h includes bar.h and baz.h, I have

    foo.h: bar.h baz.h
	touch foo.h

This seems to work fine (if files are spilt across separate directories, one
needs a make with VPATH or some similar extension; but this isn't really any
worse than the situation without nested includes).

Mind you, I'd much prefer automatic maintenance; I'm just pointing out that the
manual case doesn't seem *that* much harder. I'd be delighted to have the
problems pointed out for me before I have to cope with them for real ...

--

Regards, Kers.      | "You're better off  not dreaming of  the things to come;
Caravan:            | Dreams  are always ending  far too soon."



More information about the Comp.lang.c mailing list