网络书屋(Web Reading Room)

A blogging framework for hackers.

Makefile编译fortran的module

makefile module compilelink
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
FC = gfortran
FFLAGS = -g -Wall -O3 --free-form
modFFLAGS =  --free-form

OPTFC = -O3 -funroll-loops -ftree-vectorize -fcray-pointer -cpp
#src = $(wildcard *.f90)
src = secdmo.f90 record.f90
obj = $(src:.f90=.o )
secd : $(obj)
    $(FC) $(FFLAGS) -o $@ $^

%.o : %.f90
    $(FC) $(modFFLAGS) $(OPTFC) -c $<

#secdmo.mod : secdmo.f
# $(FC) $(modFFLAGS) @ $<

.phony: clean

clean:
    rm -rf secd secdmo.mod funct.plo accu* fort* ./errdi* *.o