X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Date: Tue, 25 Dec 2001 18:18:03 +0200 From: "Eli Zaretskii" Sender: halo1 AT ZAHAV DOT NET DOT IL To: djgpp AT delorie DOT com Message-Id: <968-Tue25Dec2001181802+0200-eliz@is.elta.co.il> X-Mailer: emacs 21.1.50 (via feedmail 8 I) and Blat ver 1.8.9 In-reply-to: (message from Jason Green on Sun, 23 Dec 2001 20:42:48 +0000) Subject: Re: Should I use bash as default shell in makefiles? References: <809aeb88 DOT 0112171814 DOT 317a55ad AT posting DOT google DOT com> <200112200325 DOT fBK3P8528329 AT envy DOT delorie DOT com> <809aeb88 DOT 0112200908 DOT 59cd0b1f AT posting DOT google DOT com> <3C25C077 DOT C6469A42 AT is DOT elta DOT co DOT il> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: Jason Green > Newsgroups: comp.os.msdos.djgpp > Date: Sun, 23 Dec 2001 20:42:48 +0000 > > I've just noticed the above command is slightly different to the one I > see here, so I can't be sure we're looking at the same docs. However, I > believe you are refering to... > > > The purpose of the `sed' command is to translate (for example): > > > > main.o : main.c defs.h > > > > into: > > > > main.o main.d : main.c defs.h > > > > This makes each `.d' file depend on all the source and header files > > that the corresponding `.o' file depends on. `make' then knows it must > > regenerate the prerequisites whenever any of the source or header files > > changes. Yes, that's what I had in mind. > ...but when using `-MMD' the `.d' file will still be regenerated whenever > any of the source or header files changes. No, it's a chicken-and-egg problem: what happens if the .d file does not yet exist? Without main.d being mentioned in dependencies, Make will not bother building it. Also, I think some of the compilers don't have -MMD. GNU Make is supposed to work with compilers other than GCC ;-)