-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
53 lines (40 loc) · 1.22 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# The compiler
FC = f95
# flags for debugging or for maximum performance, comment as necessary
FCFLAGS = -g -fbounds-check
# flags forall (e.g. look for system .mod files, required in gfortran)
# FCFLAGS +=
# path to src files
SOURCEPATH = src
# libraries needed for linking: openMP, fortranposix, gnuplotfortran
LDFLAGS =-fopenmp -lfortranposix -lgnuplotfortran
# List of executables to be built within the package
PROGRAMS = program
# "make" builds all
all: $(PROGRAMS)
program.o: util.o \
linkedlists.o \
sphfunctions.o \
integrate.o
program: util.o \
linkedlists.o \
sphfunctions.o \
integrate.o
# General rule for building prog from prog.o; $^ (GNU extension) is
# used in order to list additional object files on which the
# executable depends
%: %.o
$(FC) $(FCFLAGS) -o $@ $^ $(LDFLAGS)
# General rules for building prog.o from prog.f90 or prog.F90; $< is
# used in order to list only the first prerequisite (the source file)
# and not the additional prerequisites such as module or include files
%.o: $(SOURCEPATH)/%.f90
$(FC) $(FCFLAGS) -c $< $(LDFLAGS)
# Utility targets
.PHONY: clean veryclean
clean:
rm -f *.o *.mod *.MOD
run:
./program
veryclean: clean
rm -f *~ $(PROGRAMS)