2
Guys, I’m trying to understand a program here that I’m using in my scientific initiation, but I’m left with a doubt in a make file.
# makefile for code
OBJ1 = main.o derivs.o filter.o
code: $(OBJ1)
gfortran $(OBJ1) -o prg
.f.o:
gfortran -c -O3 $<
clean:
rm *~ *.o *.dat prg
The "code:", ".f.o" and "clean:" are the commands I have to use with make in order to execute the line that is just below them, from what I understood. What does that line mean? gfortran -c -O3 $<
Ahh, and just to see if I’m getting it right, the -o is to compile the code for a file, already the -c does it too, but is used for when we have to join one or more codes that are in different files, this is it?
Thanks in advance for the help.
I don’t really like the syntax
.f.o
in the Makefile. I prefer to use%.o : %.f
, which means the target ended in.o
depends on a file ending in.f
that has the same radical– Jefferson Quesado