www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/11/29/14:21:46

Xref: news-dnh.mv.net comp.os.msdos.djgpp:3489
Path: news-dnh.mv.net!mv!barney.gvi.net!news.sprintlink.net!newsfeed.internetmci.com!EU.net!peer-news.britain.eu.net!zippy.dct.ac.uk!yama.mcc.ac.uk!news.york.ac.uk!tower.york.ac.uk!slh100
Newsgroups: comp.os.msdos.djgpp
Subject: Re: makedepend program ??
From: Shawn Hargreaves <slh100 AT york DOT ac DOT uk>
Date: Tue, 28 Nov 1995 11:24:00 +0000
References: <DI739q DOT 3w2 AT jade DOT mv DOT net> <492bn2$en6 AT snlsu1>
Organization: The University of York, UK
Nntp-Posting-Host: tower.york.ac.uk
Lines: 27
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Dj-Gateway: from newsgroup comp.os.msdos.djgpp

On 23 Nov 1995, Dom De Vitto wrote:

> : gcc has a much more powerful feature.  In your Makefile, add the "-MD"
> : or "-MMD" options to gcc.  Then, add this at the end of your Makefile:
> 
> But requires you to run make twice to be sure everything is built.
> 
> How about adding something like this too?
> 
>   ifeq ($(SECOND_RUN),)
>   make SECOND_RUN=1
>   endif

That isn't neccessary. The only way the dependencies for a C file can 
change is if you alter the C file itself or include a header from within 
a header, and in both cases making the change will cause a rebuild which 
will update the dependencies. The only case when this breaks down is if 
there is no *.d file at all, and that can be worked around by having *.d 
dependencies for all your source files, eg.

%.o : %.c %.d
	gcc $(CFLAGS) etc...


Shawn Hargreaves                        If God is omnipotent, can he make a
http://www.york.ac.uk/~slh100/          rock so heavy that he cannot lift it?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019