Makefiles -- .c and .h

Jonathan I. Kamens jik at athena.mit.edu
Mon Nov 19 07:47:06 AEST 1990


In article <1990Nov16.171816.7173 at ssd.kodak.com>, weimer at ssd.kodak.com (Gary Weimer) writes:
|> SunOS's make has the "special-function target":
|> 
|> .KEEP_STATE:
|> 
|> which causes make to keep a record (in the file .make.state?) of which
|> include files each .c file uses (amoung other information). When make
|> is invoked after changing only one of these include files, make will
|> catch this and recompile the appropriate .c files. If a .c file is
|> changed, it needs recompiled anyway and a new list of include files
|> is generated.

  How does the SunOs make figure out which files were included by each source
file?  Does it do a "cc -E" on the source file, or something similar?  If so,
isn't that (a) slow since it has to do it again each time the .c file changes,
and (b) a problem with source files on which "cc -E" (or whatever command make
uses) won't do the right thing?  It seems to me that you're introducing a lot
of complexity into make, and it isn't clear to me that it can do the job
correctly and reliably.

-- 
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