Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!caen!umich!yale!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.lang.c Subject: Re: C + Make Message-ID: <27886:Sep1816:48:5990@kramden.acf.nyu.edu> Date: 18 Sep 90 16:48:59 GMT References: <0949@sheol.UUCP> <26567@mimsy.umd.edu> <0955@sheol.UUCP> Organization: IR Lines: 18 In article <0955@sheol.UUCP> throopw@sheol.UUCP (Wayne Throop) writes: > Now, "ideally" the construction steps (eg: compilers) and make should > talk to each other about dependencies. Exactly. This can be done rather cleanly: cc has a -F flag to output a list of all files it'll open. Every output file has a dependency list, consisting of just the commands needed to create that file. make zooms through the commands, giving each one a -F to find out what files it'll use. It continues recursively, then invokes real compiles as necessary. A file is always re-made if its dependency list has changed. For efficiency, make can cache the -F output in another spot, knowing that it must reinvoke cc -F whenever any of those files are touched. If all constructors (including make itself) have a -F flag, this scheme becomes quite reliable and modular. ---Dan