Recursive #includes

Thomas Wang ttwang at polyslo.CalPoly.EDU
Mon Feb 27 12:59:01 AEST 1989


In article <573 at marob.MASA.COM> samperi at marob.masa.com (Dominick Samperi) writes:
>In article <9727 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
>>It's easy to get the Makefile correct; just declare that a header
>>depends on the others that it #includes.

>The makefile that we are currently using is structured this way, and
>I suspect that this may be the reason that make (actually VMS MMS) 
>takes forever to get started (i.e., go through the dependencies).

There is another semi-automatic way for figuring out the dependencies.

For every .h file, put in the following stuff:

/* foo.h */
#ifndef FOOH
#define FOOH
/* !actual include! foo.h */

...

#endif

Run the .c file through CPP, then grep the output file for '!actual include!'.
This way, the dependencies can be obtained relatively painlessly.


 -Thomas Wang ("I am, therefore I am."
                 - Akira               )

                                                     ttwang at polyslo.calpoly.edu



More information about the Comp.lang.c mailing list