Makefile (Auto-Dependency Generation)
Newer versions of GCC have an -MP option which can be used with -MD. I simply added -MP and -MD to the CPPFLAGS variable for my project (I did not write a custom recipe for compiling C++) and added an “-include $(SRC:.cpp=.d)” line. Using -MD and -MP gives a dependency file which includes both the … Read more