Hi all,

I'm stuck for several hours in trying to write a rule for managing fortran modules. My difficulty is that the Cray compiler requires a  module name written in upper case.

example: if file is "toto_m.f90", it contains a module called "toto_m" and the module file will be "TOTO_M.mod".

How can I write a generic rule for building TOTO_M.mod from toto_m.f90 source and put it in the LIB folder ?

Of course,the following lines will not work as the "%" token will be in uppercase on the right hand side.

# building only the mod file
LIB/%_M.mod: %_m.f90
        @echo "building $*_M.mod"
        touch $@

I have experimented this syntax, trying to convert to lowercase the "%" token but it doesn't work too.

# building only the mod file
LIB/%_M.mod: $(shell echo %|tr [A-Z] [a-z])_m.f90
        @echo "building $*_M.mod"
        touch $@

I need to distinguish *_m.f90 patterns from others as only these files are fortran modules

toto_m.f90 is a fortran file containing a module whilst toto.f90 is a simple fortran file without module

Thanks for your advices

Patrick


Reply via email to