Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!caen!hellgate.utah.edu!dog.ee.lbl.gov!nosc!crash!nusdecs!rwhite From: rwhite@nusdecs.uucp (0257014-Robert White(140)) Newsgroups: comp.unix.programmer Subject: Re: Makefiles -- .c and .h Message-ID: <1990Nov16.202048.14636@nusdecs.uucp> Date: 16 Nov 90 20:20:48 GMT References: <9011151442.AA02010@decpa.pa.dec.com> Organization: National University San Diego Lines: 21 In article <9011151442.AA02010@decpa.pa.dec.com> ellis@ultra.dec.com (David Ellis 15-Nov-1990 0915) writes: >If we use a single .c.o rule for compiling all the source files, then it >seems that a change in a .h file that is #include'd in a .c file will The simplest thing to do is to take the line someobj.o: someobj.c and turn it into: someobj.o: someobj.c someheader.h When the header is older than the .o then everything is as it should be but when the header is changed the object is out of date wrt the source(s) and it is recompiled. An automatic way to generate this sort of dependancy list is to get make cc output the included file list instead of compiling an object. Take that output and massage it into a dependancy list. Rob.