This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: GFortran Preprocessing
On Thursday 23 April 2009 19:41:31 Steve Kargl wrote:
> On Thu, Apr 23, 2009 at 01:23:14PM -0400, Randolph, Christian [USA] wrote:
> > I have a mixed-language project I am trying to compile using GFortran
> > 4.3 on a PC running Fedora 10. I have some preprocessor directives in
> > both .f and .f90 files. Is there a blanket option I can use to force
> > the compiler to use the preprocessor for these files? There are
> > hundreds of files and I do not want to have to rename them to either .F
> > or .F90. The make files are setup to use a common set of compiler
> > options so I cannot easily use the "-x f77-cpp-input" and "-x
> > f95-cpp-input" options piecemeal.
>
> Fix your Makefiles.
>
> FC = gfortran
> F77PP = -x f77-cpp-input
> F95PP = -x f95-cpp-input
>
> .SUFFIXES: .f90 .f
>
> .f90.o:
> ${FC} ${F77PP} -c ${FFLAGS} $<
>
> .f.o:
> ${FC} ${F95PP} -c ${FFLAGS} $<
Or update to the recently-released gcc-4.4.0 and use use '-cpp' :)