-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
51 lines (35 loc) · 1.64 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
MAKEFLAGS+="-j 4"
FC=gfortran
EFLAGS=-pedantic -Wall -Wextra -Wdo-subscript -Waliasing -Winteger-division -Wsurprising -Wuse-without-only -Wunsafe-loop-optimizations -Wconversion # Error flags
FFLAGS=-ffree-line-length-none -ffree-form -std=gnu # Fortran-language flags
DFLAGS=-g -fcheck=all,no-array-temps -ffpe-trap=invalid,zero,overflow,underflow,denormal -Wrealloc-lhs # Debugging flags
PFLAGS=-march=native -Og # Performance flags
# PFLAGS=-march=native -O3 -funroll-loops # Extreme performance flags
all: main.x
# ~~ LINKING ~~
main.x: main.o analysis_m.o init_conditions_mod.o integrators_mod.o mathutils_m.o thermodynamics_mod.o thermostats_m.o writers_mod.o interfaces_m.o readers_mod.o
$(FC) $(EFLAGS) $(FFLAGS) $(DFLAGS) $(PFLAGS) $^ -o $@
# ~~ COMPILING ~~
main.o: main.F90
$(FC) $(EFLAGS) $(FFLAGS) $(DFLAGS) $(PFLAGS) -c $^
analysis_m.o: analysis_m.F90
$(FC) $(EFLAGS) $(FFLAGS) $(DFLAGS) $(PFLAGS) -c $^
init_conditions_mod.o: init_conditions_mod.F90
$(FC) $(EFLAGS) $(FFLAGS) $(DFLAGS) $(PFLAGS) -c $^
integrators_mod.o: integrators_mod.F90
$(FC) $(EFLAGS) $(FFLAGS) $(DFLAGS) $(PFLAGS) -c $^
mathutils_m.o: mathutils_m.F90
$(FC) $(EFLAGS) $(FFLAGS) $(DFLAGS) $(PFLAGS) -c $^
thermodynamics_mod.o: thermodynamics_mod.F90
$(FC) $(EFLAGS) $(FFLAGS) $(DFLAGS) $(PFLAGS) -c $^
thermostats_m.o: thermostats_m.F90
$(FC) $(EFLAGS) $(FFLAGS) $(DFLAGS) $(PFLAGS) -c $^
writers_mod.o: writers_mod.F90
$(FC) $(EFLAGS) $(FFLAGS) $(DFLAGS) $(PFLAGS) -c $^
interfaces_m.o: interfaces_m.f90
$(FC) $(EFLAGS) $(FFLAGS) $(DFLAGS) $(PFLAGS) -c $^
readers_mod.o: readers_mod.f90
$(FC) $(EFLAGS) $(FFLAGS) $(DFLAGS) $(PFLAGS) -c $^
.PHONY: clean
clean:
rm *.o