stick this somewhere in your Makefile:
depend: .depend
.depend: $(SRCS)
$(CC) -E $(CFLAGS) -M *.c *.cc> .depend
and at the very end put:
# # include a dependency file if one exists # ifeq (.depend,$(wildcard .depend)) include .depend endifnow a 'make depend' will calculate dependancies.