I'm using a makefile intending to generate dependencies automatically. But with my file, I find that although changes to the header files cause the code to be recompiled, they don't cause the dependencies to be regenerated, as I think they ought. Can anyone see what I have missed out?
.SUFFIXES : .hpp .cpp .d .o
SOURCES=main.cpp sub1.cpp sub2.cpp
OBJECTS=${SOURCES:.cpp=.o}
DEPENDENCIES=${SOURCES:.cpp=.d}
.cpp.d:
g++ -MM $< > $@
.cpp.o:
g++ $< -c `pkg-config gtkmm-2.4 --cflags --libs` -g
calculator: ${OBJECTS} ${DEPENDENCIES}
g++ ${OBJECTS} -o calculator `pkg-config gtkmm-2.4 --cflags --libs` -g
include ${DEPENDENCIES}