From: Jason Green Newsgroups: comp.os.msdos.djgpp Subject: Re: example of autodependency in make.exe Date: Thu, 15 Jun 2000 00:15:07 +0100 Organization: Customer of Planet Online Lines: 25 Message-ID: <1l3gksouhgros12ac5lv7ri464n9ns2fpd@4ax.com> References: <01BFD5E6 DOT 4D7E9940 AT LEON DOT caresystems DOT com DOT au> <200006132348 DOT TAA26312 AT envy DOT delorie DOT com> NNTP-Posting-Host: modem-229.phosphorus.dialup.pol.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: newsg3.svr.pol.co.uk 961024536 10798 62.136.14.229 (14 Jun 2000 23:15:36 GMT) NNTP-Posting-Date: 14 Jun 2000 23:15:36 GMT X-Complaints-To: abuse AT theplanet DOT net X-Newsreader: Forte Agent 1.7/32.534 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com DJ Delorie wrote: > I do this, but it only really works if the sources and objects are all > in the same directory as the Makefile: > > %.o : %.c (or whatever rule) > gcc -MMD ... It's worth noting that `CPPFLAGS += -MMD' will achieve the same result for all the built-in rules to compile C/C++. > DEPS=$(wildcard *.d) > ifneq ($(DEPS),) > include $(DEPS) > endif Hmm, is there any reason not to do the following?: -include $(wildcard *.d) The original poster could also search the mail archives for a previous thread where I posted a similar scheme: Subject: OT: `make clean' wants to rebuild `.d' files