Makefiles -- .c and .h

Jonathan I. Kamens jik at athena.mit.edu
Fri Nov 16 04:23:23 AEST 1990


  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 at Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8085			      Home: 617-782-0710



More information about the Comp.unix.programmer mailing list