Preferences

Joker_vD parent
I know I can do that. But it's fiddly, and doesn't really save time for small to medium projects: on small projects, full recompilation is fast enough that the time to regularly re-run "gcc -MMD" is actually noticeable and wasted — it simply is faster to not bother with it. And for medium projects, in my experience, the headers tend to not change all that often, and when they do it means you need to rebuild about 30-50% of all the sources so might as well rebuild 100% just to be on the safe side. I've had enough pitiful debugging experiences where the executable code does not match the source files that are fixed by doing "make clean build".

And when you change flags/compiler versions/system header versions you still need to a clean rebuild, so unless you write your makefiles the way that e.g. CMake generates them (I am willing to bet nobody does that)...


If you do lazy `-include *.d` there no time wasted for `-MMD` since it only runs as part of your main compile.

The only "gotcha" is if you delete a header but you forgot to give GCC the option that says "I might delete a header in future".

Joker_vD OP
Oooh, there is an "-MP" flag, which does... something? Anyway, it's all just a gigantic hack at this point: if we defer to gcc to figure out the accurate dependencies anyway, why do we even use make in the first place? I mean, I know the answer ("that's how it came to be, historically"), it just rubs me the wrong way since gcc, strictly speaking, is already a compiler driver that orchestrates running the internal utilities so it may as well just bloody learn how to run them all in one swell foop or whatever.

This item has no comments currently.