Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!think.com!snorkelwacker.mit.edu!apple!apple.com!rmh From: rmh@apple.com (Rick Holzgrafe) Newsgroups: comp.sys.mac.programmer Subject: Re: MPW Make file weirdness Message-ID: <11416@goofy.Apple.COM> Date: 4 Dec 90 01:23:52 GMT References: <11406@goofy.Apple.COM> Sender: usenet@Apple.COM Distribution: na Organization: Apple Computer, Inc. Lines: 39 In article <11406@goofy.Apple.COM> mdtaylor@Apple.COM (Mark Taylor) writes: > But then it occurs to me that, say, file2.h itself #includes a basic header > file, called, say, basic.h. I would like my makefile to reflect this > dependency. So I create one dependency rule in my makefile that says, simply: > > file2.h basic.h > > This doesn't work as I expect. Right. An production says to re-make the stuff on the left whenever it's older than the stuff on the right... but you don't want to re-make file2.h. You want to re-make file2.c.o. So the correct thing to do, as you tried, is: file2.c.o file2.h basic.h Agreed, it's a pain; fully correct makefiles are always a pain. You can reduce the pain either by careful use of macros (as Garance just suggested, I think) or by using a tool to generate dependencies automatically. There's one called "MakeMake" on the Developer's CD (ever since vol. 3, I think) that automates building and maintaining entire makefiles, including full dependency lists. It's not all things to all people, but it's pretty good if I say so myself. (I'm a co-author of it along with scott douglass.) If you're interested in MakeMake, see if you can find a friend with a reasonably recent Developer's CD ("A Disc Called Wanda" or later version) to get it from. Please don't ask me to E-mail it, as it's a largish MPW tool and would consume a lot of bandwidth (as well as a lot of my limited time). ========================================================================== Rick Holzgrafe | {sun,voder,nsc,mtxinu,dual}!apple!rmh Software Engineer | AppleLink HOLZGRAFE1 rmh@apple.com Apple Computer, Inc. | "All opinions expressed are mine, and do 20525 Mariani Ave. MS: 3-PK | not necessarily represent those of my Cupertino, CA 95014 | employer, Apple Computer Inc."