[Top][All Lists]

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

Re: problems with $(eval include...)

From: Ted Stern
Subject: Re: problems with $(eval include...)
Date: Thu, 26 Jun 2003 13:03:36 -0700
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.2 (usg-unix-v)

On 26 Jun 2003, Fabio Alemagna wrote:
> My goal is to have make include .d files only when they are actually
> needed, so that when make starts, it doesn't have to check whether any .c
> files (from which all the .d ones are generated) have changed, so I've
> come up with this solution:

Hi Fabio,

Use the "-" prefix with your include statements, it's much simpler:

    -include $(DEPS)

This will ignore the errors caused by a file not being found.

More generally, you can make your dependency generation a lot simpler.  See
Paul Smith's website for an essay about it:


It's under the "Advanced Auto-dependency Generation" link.

In a nutshell, you incorporate your dependency generation rule into the
compilation rule.  Touched source files will be recompiled anyway, and
untouched files with dependency information will be recompiled if necessary.

You're lucky you're doing this with C source and not Fortran 90, though ---
f90 module files are like .h files (they contain interface information) but
are automatically generated by the compiler.  Since the .mod file timestamps
are changed whenever the source file is touched and recompiled, this can lead
to unnecessary cascades of recompilation, even when the interface has not
changed.  If you ever run into a situation like this, see


 Ted Stern                                 Applications Group
 Cray Inc.                               office: 206-701-2182
 411 First Avenue South, Suite 600         cell: 206-383-1049
 Seattle, WA 98104-2860                     FAX: 206-701-2500

 Frango ut patefaciam -- I break that I may reveal
 (The Paleontological Society motto, equally apropos for debugging)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]