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 $@: ,' > [EMAIL PROTECTED]
$(MV) [EMAIL PROTECTED] $@
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
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make