Path: utzoo!attcan!uunet!snorkelwacker.mit.edu!bloom-beacon!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: comp.unix.programmer Subject: Re: Makefiles -- .c and .h Message-ID: <1990Nov15.172323.23431@athena.mit.edu> Date: 15 Nov 90 17:23:23 GMT References: <9011151442.AA02010@decpa.pa.dec.com> Sender: daemon@athena.mit.edu (Mr Background) Reply-To: jik@athena.mit.edu (Jonathan I. Kamens) Organization: Massachusetts Institute of Technology Lines: 19 The somewhat standard solution to this problem is to create a program or sequence of shell commands to parse the source files and determine the dependencies on .h files, and to append those dependencies to the end of the Makefile (or, in some versions of make, to put them in a file that is included by the Makefile). There are various "makedepend" programs and scripts floating all over the place. The standard X11 distribution includes a makedepend, for example. Also, I believe there are a few Makefiles in the standard 4.3BSD distribution that have shell dependency generators based on "cc -E" on the source files built in. There may even be some stuff in the comp.sources.unix or comp.sources.misc archives to do this. -- Jonathan Kamens USnail: MIT Project Athena 11 Ashford Terrace jik@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8085 Home: 617-782-0710