================ @@ -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 ---------------- tarunprabhu wrote:
Do other Fortran compilers have comparable functionality. How do they handle `USE` statements? Do you know which of these is used, for instance, by cmake? Do you know how these options are used in practice? Are they used in build systems for Fortran applications, for instance? Being consistent with `clang` is desirable, but not when it is not reasonable. Obviously, that judgement is very subjective. I think your initial instinct might have been correct, and we should not support `-M/-MM`. IIUC, the primary difference between `-MD`, and `-M/-MM` is that the latter implies `-E`. Is that correct? Since preprocessing in Fortran is not really the same as preprocessing in C/C++, I wonder how relevant it is. https://github.com/llvm/llvm-project/pull/209379 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
