🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #1259

Re: Makefiles -- .c and .h

#1259
From: Dan Bernstein
Date: Tue, 20 Nov 1990 04:55
23 lines
1418 bytes
In article <1990Nov18.204706.7044@athena.mit.edu> jik@athena.mit.edu (Jonathan I. Kamens) writes:
>   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?

I don't know what it actually uses, but cc -M would be one solution.

> If so,
> isn't that (a) slow since it has to do it again each time the .c file changes,

It has to recompile every time the file changes. The extra time is
negligible.

> and (b) a problem with source files on which "cc -E" (or whatever command make
> uses) won't do the right thing?

If every transformation command accepted -M, it wouldn't be a problem.

One strategy to handle all cases would be to trace the executable and
keep track of what files were opened. Shared libraries could be
special-cased here. Under some tracing mechanisms this would even allow
the recursive make that some people want.

---Dan
Technical Details
Message-ID: <10168:Nov2004:55:5290@kramden.acf.nyu.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!kramden.acf.nyu.edu!brnstnd
References: <6268@minyos.xx.rmit.oz.au> <1990Nov16.171816.7173@ssd.kodak.com> <1990Nov18.204706.7044@athena.mit.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!kramden.acf.nyu.edu!brnstnd
From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein)
Newsgroups: comp.unix.programmer
Subject: Re: Makefiles -- .c and .h
Message-ID: <10168:Nov2004:55:5290@kramden.acf.nyu.edu>
Date: 20 Nov 90 04:55:52 GMT
References: <6268@minyos.xx.rmit.oz.au> <1990Nov16.171816.7173@ssd.kodak.com> <1990Nov18.204706.7044@athena.mit.edu>
Organization: IR
Lines: 23