The same `-include deps` and generate `.deps` trick used in phobos could be used for dmd, at least with gcc/clang.