Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ucsd!orion.cf.uci.edu!uci-ics!venera.isi.edu!aero!sm.unisys.com!csun!polyslo!ttwang From: ttwang@polyslo.CalPoly.EDU (Thomas Wang) Newsgroups: comp.lang.c Subject: Re: Recursive #includes Keywords: recursive includes, modularity Message-ID: <8626@polyslo.CalPoly.EDU> Date: 27 Feb 89 02:59:01 GMT References: <570@marob.MASA.COM> <9727@smoke.BRL.MIL> <573@marob.MASA.COM> Reply-To: ttwang@polyslo.CalPoly.EDU (Thomas Wang) Distribution: na Organization: Cal Poly State University -- San Luis Obispo Lines: 30 In article <573@marob.MASA.COM> samperi@marob.masa.com (Dominick Samperi) writes: >In article <9727@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) 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@polyslo.calpoly.edu