Path: utzoo!attcan!uunet!husc6!cmcl2!nrl-cmf!ames!elroy!cit-vax!jerbil From: jerbil@cit-vax.Caltech.Edu (Joe Beckenbach) Newsgroups: comp.software-eng Subject: Re: Makefile Generators Message-ID: <8963@cit-vax.Caltech.Edu> Date: 22 Dec 88 16:39:46 GMT References: <2472@mergvax> Reply-To: joe@cit-vax.caltech.edu (Joe Beckenbach) Organization: California Institute of Technology Lines: 27 [Tried replying to the original article but mailer bounced it] The X windows system has a 'makedepend' command which parses like a C preprocessor to find dependencies which might be hidden by #defines, other #includes, and #if/#ifdef/#ifndef sequences. There are tradeoffs involved of course: 1- In building 'makedepend' in X windows, apparently a section of the cpp source code is needed to ensure proper decoding and handling of #if's. 2- Each file is processed once. If included multiple times, it simply reuses what information it has. This causes problems in the unfortunate case where a #if/#else clause selects one of two #includes in one file, and the other in another: the first time through will set the choice of dependencies in stone. The man page says that the algorithm assumes that all the source files for a given makefile use the roughly the same set of -I and -D flags. The mechanism is based at bottom on cobbling together a useful framework from a Berkeley kernel-building makefile which modifies itself to add appropriate dependencies. [Sorry, can't remember where it is. I think it's in a GENERIC directory somewhere. (And I call myself a system manager. :-) ] Joe Beckenbach [aka jerbil; use joe@cit-vax.caltech.edu for mail] -- Joe Beckenbach joe@csvax.caltech.edu Caltech 256-80, Pasadena CA 91125 PRINCIPLE OF LEAST ASTONISHMENT: a common-sense rule unknown to the worlds of systems and programming