[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
generate dependency files problem
From: |
Bram Kuijper |
Subject: |
generate dependency files problem |
Date: |
Mon, 25 Jun 2007 12:37:23 +0200 |
User-agent: |
Thunderbird 2.0.0.4 (X11/20070618) |
Hi all,
As a newbie, I am trying to produce a non-recursive makefile as
suggested in Mecklenburg's "Managing projects with GNU make" (3rd
edition), chapter 6.2.
However, I'm stuck since no dependency files (*.d) are created in my
case. Dependency files are a way to get automatically hold of all
necessary header files (ie., containing the output of the g++ -M
statements).
First, I create a variable holding all the dependency files (with
*.d-suffix), based on all the source files which are in the tree:
dependencies = $(subst .cpp,.d, $(sources))
Then, I include the dependencies as follows:
ifneq "$(MAKECMDGOALS)" "clean"
include $(dependencies)
endif
However, the actual rule to make all the dependencies is never called.
This is the rule:
%.d: %.cpp
$(CPP) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -M $< | \
$(SED) 's,\($(notdir $*)\.o\) *:,$(dir $@)\1 $@: ,' > address@hidden
$(MV) address@hidden $@
What can be the problem? Since a simple g++ -M on any of my source files
will _give_ a lot of output, I can't find any clue why make won't
produce dependency files.
The complete source of my makefile is in pastebin:
http://pastebin.com/935870
thanks in advance,
Bram Kuijper
- generate dependency files problem,
Bram Kuijper <=