Path: utzoo!attcan!uunet!lll-winken!ames!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!rutgers!psuvax1!gondor.cs.psu.edu!steve From: steve@gondor.cs.psu.edu (Stephen 2. Williams) Newsgroups: comp.lang.c Subject: Re: Recursive #includes Summary: he can, he can not; he can, he can not... Keywords: nested recursive includes Message-ID: <4329@psuvax1.cs.psu.edu> Date: 1 Mar 89 02:33:02 GMT References: <9736@smoke.BRL.MIL> <2538@goofy.megatest.UUCP> Sender: news@psuvax1.cs.psu.edu Reply-To: steve@gondor.cs.psu.edu (Stephen 2. Williams) Organization: Penn State University Lines: 46 In article <2538@goofy.megatest.UUCP> djones@megatest.UUCP (Dave Jones) writes: >From article <9736@smoke.BRL.MIL>, by gwyn@smoke.BRL.MIL (Doug Gwyn ): >> In article <964@philmds.UUCP> leo@philmds.UUCP (Leo de Wit) 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. >>>This is not correct, as it is never correct to declare make dependencies >>>between source files (this includes header files as well). >Sorry, but it is technically INCORRECT. > > >By what rationale can the first .h be said to depend on the second? >How is _make_ to "do something to construct the target", if not check >it out of SCCS or RCS? And if it does that, what has the second .h >got to do with the price of beans in Slobovia? Consider the following stunt (I used it in a longish project of mine): prog: a.o b.o c.o cc -o prog a.o b.o c.o a.o: master.h master.h: sub1.h sub2.h @touch master.h Notice that the master.h file is created from the two files sub1.h and sub2.h, presumably because of nested includes. Some might gripe that you are doing work where none is necessary, but it works quite well. *Technically* speaking, Dave is correct is saying that nested dependencies cannot be directly represented, but make is apparently general enough for a programmed solution. > >He's gotcha, Doug. Say, "Uncle." Say no such thing, Doug:-) Steve 2. Williams (steve%crown%journey%attmail@research.att.com)