| Feed_me_spam 2004-05-24, 5:35 pm |
| Hi,
I am trying to use GNU make to compile a Fortran 90 program on my
Linux box. It seems that it doesn't recognize the suffix .f90. The
strange problem I encounter is the following: I have an identically
structured code collection in F77 which I compile with almost the same
makefile, and the compilation works. With the F90 version, the only
difference is
< MSOURCES=$(OBJECTS:.o=.f90)
---
> MSOURCES=$(OBJECTS:.o=.f)
14c24
< %.o: %.f90 %.h
---
> %.o: %.f %.h
The relevant parts in the F90 makefile are
SOURCES=$(MSOURCES) $(AUXLIB:.o=.f)
%.o: %.f90 %.h
$(FC) $(FFLAGS) $< -o $@
a.out: $(HEADERS) $(SOURCES) $(OBJECTS) libaux.a
$(FC) $(OBJECTS) $(LIBFLAG) $(LDFLAGS) -o $@
libaux.a: $(AUXLIB:.o=.f)
$(FC) $(FFLAGS_SPEC) $^
ar -vru $@ $(AUXLIB)
rm $(AUXLIB)
The F77 stuff for libaux is compiled well, but then make doesn't try
to build the objects of the main stuff from MSOURCES, but already
tries to link and of course stops with the error
/usr/bin/ld: cannot open alphaslct.o: No such file or directory
make: *** [/home/tr/tmp/a.out] Error 1
The F90 code itself compiles if I just compile everything with ifort
-c *.f90; ifort *.o, so the problem is not with the code.
Any ideas? I have already tried to insert a .SUFFIXES instruction, but
that shows no effect.
Tom
|