[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#27697: auto-include-dependency failure case



On Mon, Oct 12, 1998 at 06:47:14PM -0600, Jason Gunthorpe wrote:

> What I have been doing of late is generating the .d file when the .o file
> is built. Nothing depends on the .d file but if it exists it is included.
> This makes the .o file depend on all included files and the .c file
> automatically. Also the .d file depends on nothing so there is no rebuild
> rule for it.

Hmm, what a good idea.  I hadn't thought of doing it that way.

> make in it's tracks. The only remaining problem is erasing header-files
> requires a make clean :<

I hate that.  I've considered just adding a "%.h:" blank rule, but I don't
like the looks of that...

> In my make files I actually use the GNU C specific option to generate a .d
> file as it compiles from .cc to .o, it runs -REALLY- fast compared to the
> technique automake uses.

I don't know what automake does, but I've found that gcc -MM for each file
is really slow... it takes about 1/2 the time of actually compiling the
file!

In wvdial 1.10, I redesigned my own rules.mk dependencies to be much faster:
it still uses gcc -MM, but only once per directory.  It gets a list of all
headers included from any of the files in the current directory
(recursively) then processes each header only once using a rather funky awk
script.  All dependencies end up in a single .depend file, but I can do a
whole directory full of files in about the same time as it takes to create
a single .d file the old way.

You might want to look at the wvdial source (it's in slink) to see what I've
done... note that I've fixed a few minor buglets in the awk script since
wvdial 1.10, so if you want to use my script, let me know and I'll fire you
off the latest version.

Have fun,

Avery


Reply to: