-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
46 lines (34 loc) · 1.03 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
# Builds flogging as a shared library
F90=.f90
OBJ=.o
LIB = libflogging.so
SRC = src
BUILD = $(SRC)
FC = mpif90
FLAGS = -fpic -O3 -cpp -ffree-line-length-none -Iinclude
ifeq (USE_MPI,1)
FLAGS += -DUSE_MPI
endif
SOURCES = $(wildcard $(SRC)/*$(F90))
OBJS = $(patsubst $(SRC)/%$(F90), $(BUILD)/%$(OBJ), $(SOURCES))
$(LIB): $(OBJS)
$(FC) -shared -o $(LIB) $(OBJS)
$(BUILD)/%$(OBJ): $(SRC)/%$(F90)
$(FC) $(FLAGS) -c $< -o $@
$(BUILD)/flogging.o: $(BUILD)/vt100.o
# Some test executables
#
test : src/flogging.f90 tests/test.f90 src/vt100.f90 include/flogging.h
mpifort $(FLAGS) -Iinclude src/vt100.f90 src/flogging.f90 tests/test.f90 -o test
test_mpi : src/flogging.f90 tests/test_mpi.f90 src/vt100.f90 include/flogging.h
mpifort $(FLAGS) -DUSE_MPI -Iinclude src/vt100.f90 src/flogging.f90 tests/test_mpi.f90 -o test_mpi
.PHONY: clean doc
clean:
@find . -name '*.o' -delete
@find . -name '*.mod' -delete
@find . -name '*.so' -delete
@rm -f test test_mpi
doc:
ford flogging.md
doc_deploy: doc
git subtree push --prefix doc origin gh-pages