Bug 14188 – Add gcc-equivalent -MD options to dmd

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2015-02-16T16:41:16Z
Last change time
2021-06-27T00:34:27Z
Assigned to
No Owner
Creator
Atila Neves

Comments

Comment #0 by atila.neves — 2015-02-16T16:41:16Z
gcc can output Makefile-compatible dependency files with the -MD -MF combo, or -MMD -MF which leaves out system files (such as stdio.h). dmd has -deps, but the output format is unusable by GNU make and requires transformation. This feature is necessary in order to have Make and Ninja compatible dependency generation done by the compiler.
Comment #1 by andrej.mitrovich — 2015-02-17T12:50:41Z
Doesn't RDMD already support this feature? I thought it did..
Comment #2 by atila.neves — 2015-02-17T14:16:35Z
Huh, so it does, I just tried it out. However: 1. It has too much information, it turns out. The gcc equivalent just churns out foo.o: foo.c foo.h bar.h ... rdmd includes the compiler, the .conf file and transitive dependencies. 2. It requires rdmd to be installed. Which it probably is, but...
Comment #3 by atila.neves — 2015-02-17T16:58:35Z
Another issue is that rdmd builds an executable. I need this to be done as a single file is compiled. Just like gcc.
Comment #4 by atila.neves — 2020-07-02T09:41:33Z
*** Issue 16746 has been marked as a duplicate of this issue. ***
Comment #5 by kinke — 2021-06-27T00:34:27Z
This was fixed with the -makedeps option introduced in v2.095, by https://github.com/dlang/dmd/pull/12011 and https://github.com/dlang/dmd/pull/12049.