Modern build systems like CMake and Meson introspect Fortran source files to determine the build order of source files. This is vital for Fortran source files using modules and submodules.
Fortran module .mod file files are generated when compiling a Fortran source file. The order of compiling Fortran source files with modules is vital to avoiding build failure due to missing module files.
Fails due to improper build order:
gfortran main.f90 m1.f90 m2.F90
Proper build order (success):
gfortran m1.f90 m2.F90 main.f90
If you change the file extension to m2.f90, the build fails due to the preprocessing not being enabled:
mv m2.F90 m2.f90
gfortran m1.f90 m2.f90 main.f90
This is true on both case sensitive and case insensitive file systems.
c++ -std=c++17 case_sensitive.cpp -o case_sensitive
./case_sensitive