Surely the -MMD solution with -include $(objects:.o=.d) does the trick
cleaner than the method mentioned in the manual.
Edward, are you rewriting the Make manual? I hope that you do include an
example, besides the explanation below.
You guys have been most helpful.
Cheers
Edward Welbourne
On Wed, Apr 28, 2010 at 7:12 AM, Edward Welbourne wrote:
>> It's also unnecessary - you don't need a rule for %.d at all. You can
>> just generate the dependencies as a side-effect of compilation using
>> -MMD or similar.
>
> Well, if a .d file gets deleted while its .o file exists, you do need
>
> It's also unnecessary - you don't need a rule for %.d at all. You can
> just generate the dependencies as a side-effect of compilation using
> -MMD or similar.
Well, if a .d file gets deleted while its .o file exists, you do need
to regenerate it - or regenerate the .o (which may cause wasteful
On 4/28/10, Robert Jørgensgaard Engdahl wrote:
>
> Hello GNU Make bug-list subscribers
>
> On
>
> http://www.gnu.org/software/make/manual/make.html#Automatic-Prerequisites
>
> The rule for automatically generating prerequisites is
>
> %.d: %.c
> @set -e; rm -f $@; \
> $
Hello GNU Make bug-list subscribers
On
http://www.gnu.org/software/make/manual/make.html#Automatic-Prerequisites
The rule for automatically generating prerequisites is
%.d: %.c
@set -e; rm -f $@; \
$(CC) -M $(CPPFLAGS) $< > $...@.; \
sed 's,\($*\)\.