-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
67 lines (41 loc) · 1.38 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
FC = gfortran
# GIT tag usage
# >>> git tag -a v1.4 -m "my version 1.4"
GIT_VERSION := $(shell git describe --abbrev=4 --dirty --always --tags)
ifeq ($(FC),gfortran)
#FFLAGS = -O2
FFLAGS = -O0 -Wall -fcheck=all
#FFLAGS = -O0 -Wall -fcheck=all -fbacktrace -ffpe-trap=zero,overflow,underflow
#FFLAGS = -O0 -Wall -Wextra -Wimplicit-interface -fPIC -fmax-errors=1 -g -fcheck=all -fbacktrace
#FFLAGS = -O3 -Wall -Wextra -Wimplicit-interface -fcheck=all -fbacktrace -ffpe-trap=zero,overflow,underflow,denormal
FFLAGS += -cpp -DVERSION=\"$(GIT_VERSION)\"
endif
ifeq ($(FC),ifort)
FFLAGS = -O2
#FFLAGS = -Ofast
FFLAGS += -fpp -DVERSION=\"$(GIT_VERSION)\"
endif
# add hdf5 support
LDLIBS = -lhdf5_fortran -lhdf5
# add include and library paths on Mac (for Macports paths)
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
LDINC = -I/opt/local/include
LDFLAGS = -L/opt/local/lib
endif
# add include and library paths on my linux mint laptop
UNAME_N := $(shell uname -n)
ifeq ($(UNAME_N),justintnb-lm)
LDINC = -I/usr/include/hdf5/serial
LDFLAGS = -L/usr/lib/x86_64-linux-gnu/hdf5/serial
endif
.PHONY: clean docs
hdf5_test.x: constants.o hdf5_utils.o main.o
$(FC) $(FFLAGS) $(LDINC) -o $@ $^ $(LDFLAGS) $(LDLIBS)
main.o: constants.o hdf5_utils.o
%.o : %.f90
$(FC) $(FFLAGS) $(LDINC) -c -o $@ $<
docs:
cd docs; doxygen HDF5_utils.doxy
clean:
rm -f *.o *.mod *.x