On 2008-04-19 02:34Z, Van Snyder wrote:
> To compile Fortran 90 programs, I'd like to use pattern rules.  Most
> Fortran 90 compilers create a .mod file with a base name that is the
> name of the module, all in lower case.  If I've used any upper-case
> letters in the file name, even if it's otherwise identical (sans
> extension) to the module name, I apparently can't use a pattern rule.

I guess it's considered undesirable to avoid the problem by
using only lower-case source file names, so...

> For example, I have a module named foo in a source file named Foo.f90:
> 
> foo.mod Foo.o: Foo.f90
>       $(FC) -c $(FOPTS) -o Foo.o Foo.f90 -I MyModuleLibrary
> 
> and numerous other files with the same sort of rules.

Do '.mod' files remain valid if you change the capitalization
of their names, e.g. with the extra line below? (Sorry, I don't
know the language.)

> %.mod %.o: %.f90
>       $(FC) -c $(FOPTS) -o $@ $< -I MuModuleLibrary

        mv `echo $*.mod | tr '[:upper:]' '[:lower:]'` $*.mod

or just create an extra dummy file with a mixed-case name,
assuming a case-sensitive file system:

        cp --preserve `echo $*.mod | tr '[:upper:]' '[:lower:]'` $*.mod
        # 'touch' might work just as well

and write module dependencies in terms of case-preserved
module file names like 'Foo.mod'. But maybe that's worse than
restricting source file names to lowercase?


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to