When looking at build systems, many of them (SCons, bjam, cmake, Tundra, etc.) have a built-in #include scanner. However, gcc and icc offer the -MMD (or -MD ) option, which displays the names of the header files on which the C ++ file depends.
The -MMD dependency -MMD seems reliable. If you add #include to the C file, its timestamp will change so that the build system recompiles it. If you add #include to the header file, its timestamp will change and will recompile all affected C files.
Turn on the scanning systems, but -MMD will seem reliable. Which is better and why?
source share