This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Help with -M dependency generation


On Thu, Jan 6, 2011 at 14:33, Tobias Burnus <burnus@net-b.de> wrote:
>> I have a problem getting the generation of Makefile dependencies with
>> -M working with GCC 4.6.0 20110101.
>>
>> For example, with the following two files
>> [...]
>>>
>>> gfortran -cpp -M hello.f90
>>
>> hello.f90:2.13:
>> ? ? use modul
>> ? ? ? ? ? ? ?1
>> Fatal Error: Can't open module file 'modul.mod' for reading at (1): No
>> such file or directory
>
> Well, that's a hen-and-egg problem. One way is to simply run:
>
> ?gfortran -cpp -M ?*.f90
>
> several times until no such errors appear - then you have generated all
> required .mod files and this "-M" produces the correct, final result.
> Depending on the number of files, module dependencies and ?the file naming
> (as "*.f90" globs the files alphabetically), you might need only few (e.g.
> two runs in your case) or several. For one project of mine (488 files), I
> need to run gfortran about a dozen times.

Hi,

is the contents of the .mod file actually used in any way to generate
the dependency? Is it too simplistic to assume that the module name
should be sufficient to generate a dependency on the .mod file of the
same name?

I know at least one program, Makedepf90
(http://personal.inet.fi/private/erikedelmann/makedepf90/) which can
generate these dependencies solely from the source code. Does that
mean the dependencies obtained such a way are possibly
incomplete/incorrect?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]