I have a simple Makefile to compile and link a small FORTRAN code. I am quite new to using Makefile. The make file is given below. It works perfectly fine on a UNIX system (OS X) but when I try it in a Linux system it gives the following error message:
gfortran -std=f2003 -g -c m_getoptions.F03
gfortran: m_getoptions.F03: linker input file unused because linking not done
gfortran -std=f2003 -g -c m_readwf.F03
gfortran: m_readwf.F03: linker input file unused because linking not done
gfortran -std=f2003 -g -c ptdwf.F03
gfortran: ptdwf.F03: linker input file unused because linking not done
gfortran -std=f2003 -g -o TDWF ptdwf.o m_getoptions.o m_readwf.o
gfortran: ptdwf.o: No such file or directory
gfortran: m_getoptions.o: No such file or directory
gfortran: m_readwf.o: No such file or directory
make: *** [TDWF] Error 1
I have GNU make 3.81 on both systems. Any ideas.
# Makefile for PTDWF.
#
.SUFFIXES:
.SUFFIXES: .o .mod .F03
#
#
#
#
#Compiler options
#FC = $(FC)
#FC = ifort
FC = gfortran -std=f2003
FFLAGS=-g
#
OBJS=ptdwf.o m_getoptions.o m_readwf.o
TDWF: $(OBJS)
#
#
$(FC) $(FFLAGS) -o TDWF $(OBJS)
%.o:%.F03
$(FC) $(FFLAGS) -c $<
#
clean:
rm -f *.o *.mod TDWF
# DO NOT DELETE THIS LINE - used by make depend
ptdwf.o: m_getoptions.o m_readwf.o