-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (44 loc) · 1.54 KB
/
Makefile
File metadata and controls
65 lines (44 loc) · 1.54 KB
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
ROOTDIR = $(shell pwd)
BDIR = ${ROOTDIR}/bin
IDIR = ${ROOTDIR}/include
ODIR = ${ROOTDIR}/obj
SDIR = ${ROOTDIR}/src
CC = mpicxx
CPPFLAGS = -std=c++14 -O2 -I${IDIR} -DARMA_ALLOW_FAKE_GCC # -DNO_VELOCITY_REVERSAL
LDFLAGS = -larmadillo
vpath %.h ${IDIR}
vpath %.cpp ${SDIR}
TwoPara_deps =
TwoPara_deps_h = arma_helper math_helper
TwoPara2_deps =
TwoPara2_deps_h = math_helper
FSSH_deps = TwoPara2
FSSH_deps_h = arma_helper math_helper
Langevin_deps = TwoPara2
Langevin_deps_h = arma_helper math_helper
SIAM_deps =
SIAM_deps_h = arma_helper math_helper
ModelInterp_deps =
ModelInterp_deps_h = math_helper
FSSH_rlx_deps = ModelInterp
FSSH_rlx_deps_h = arma_helper math_helper
executables = $(addprefix ${BDIR}/run_, TwoPara TwoPara2 FSSH Langevin SIAM ModelInterp FSSH_rlx)
obj_run = $(patsubst ${BDIR}/%, ${ODIR}/%.o, ${executables})
gen_obj = $(patsubst %, ${ODIR}/%.o, $(1))
gen_hdr = $(patsubst %, ${IDIR}/%.h, $(1))
.PHONY: all
all : ${executables}
% : ${BDIR}/% ;
.SECONDEXPANSION:
${executables} : ${BDIR}/run_% : ${ODIR}/run_%.o ${ODIR}/%.o $$(call gen_obj,$${$$*_deps}) | ${BDIR}
${CC} $^ -o $@ ${CPPFLAGS} ${LDFLAGS}
${obj_run} : ${ODIR}/run_%.o : run_%.cpp %.h $$(call gen_hdr,$${$$*_deps_h}) arma_helper.h mpi_helper.h widgets.h | ${ODIR}
${CC} -c $< -o $@ ${CPPFLAGS}
${ODIR}/%.o : %.cpp %.h $$(call gen_hdr,$${$$*_deps_h}) | ${ODIR}
${CC} -c $< -o $@ ${CPPFLAGS}
${BDIR} ${ODIR} :
mkdir -p $@
.PRECIOUS: ${ODIR}/%.o
.PHONY: clean
clean:
rm -rf ${ODIR} ${BDIR} ${LDIR}