[clang] [flang] [flang][driver] Support Makefile dependency generation (PR #209379)
Thirumalai Shaktivel via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 29 05:10:52 PDT 2026
================
@@ -236,6 +236,21 @@ is `ParseSyntaxOnlyAction`, which corresponds to `-fsyntax-only`. In other
words, `flang -fc1 <input-file>` is equivalent to `flang -fc1 -fsyntax-only
<input-file>`.
+## Dependency File Generation
+Flang can emit Makefile-style dependency rules with `-M`, `-MM`, `-MD` and
+`-MMD` (paired with `-MF`, `-MT` and `-MQ` to control the output file and the
+rule target).
+
+There is one behavioural difference to be aware of regarding module
+dependencies (the `.mod` files brought in by `use` statements):
+
+* `-MD` and `-MMD` run a full compilation, so the `.mod` files opened during
+ semantic analysis are recorded and appear in the dependency rule.
+* `-M` and `-MM` run the prescanner only. They report textual dependencies
----------------
Thirumalai-Shaktivel wrote:
Sorry for the delay. I have updated the fix: 3d1e47df3b9e043237f9dbfb5c51aed981ee3e37
https://github.com/llvm/llvm-project/pull/209379
More information about the cfe-commits
mailing list