This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/49149] Dependency autogeneration with `-M` rendered useless by requiring .mod files
- From: "zbeekman at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 31 Aug 2011 22:01:06 +0000
- Subject: [Bug fortran/49149] Dependency autogeneration with `-M` rendered useless by requiring .mod files
- Auto-submitted: auto-generated
- References: <bug-49149-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49149
--- Comment #6 from Zaak <zbeekman at gmail dot com> 2011-08-31 22:01:06 UTC ---
I ma not saying gfortran is entirely broken, i'm merely claiming that there is
a bug in the dependency resolution feature. Please see GNU Make documentation
here for more information about Generating Prerequisites Automatically:
http://www.gnu.org/software/make/manual/make.html#Automatic-Prerequisites
There is nothing wrong with my makefile. GNU make looks for rules to build any
included makefiles and builds and updates them before running the rest of the
makefile. It is this very step that gives me problems too, but because it
requires the presence of types.mod before it can run the rule to make
modutils.d and myprog.d. The rule to make these files uses gfortran's
dependency resolution features which is where the problem is. The following
step is what is causing the failure:
gccbug $ gfortran -M -cpp modutils.f90 | sed '1 s/^/modutils.d /' > modutils.d
This is perfectly reasonable thing to want to do and produces the following
output:
modutils.f90:2.11:
USE types
1
Fatal Error: Can't open module file 'types.mod' for reading at (1): No such
file or directory
The whole point, again, is that we should not need the binary .mod files to
accomplish dependency resolution because these .mod files have dependencies
which must be resolved in order to create them. The source code file should be
parsed for binary objects (.o and .mod) which it produces and which it depends
on. The parsing of these source codes and the extraction of this information
should not require dependencies and should be order agnostic.
I hope you are less confused now.