-
Notifications
You must be signed in to change notification settings - Fork 46
/
Makefile.in
61 lines (44 loc) · 1.76 KB
/
Makefile.in
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
# core compiling options
CXX = @CXX@
CXX_STD = @MCMC_CXX_STD@
OPT_FLAGS = @MCMC_WARN_FLAGS@ @MCMC_OPT_FLAGS@
FPN_FLAGS = -DMCMC_FPN_TYPE=@MCMC_FPN_TYPE@
MCMC_MATLIB_FLAGS = @MCMC_MATLIB_FLAGS@
MCMC_MATLIB_INCLUDE_PATH = @MCMC_MATLIB_INCLUDE_PATH@
# install location
INSTALL_PATH=@MCMC_INSTALL_PATH@
# source directories
SDIR = .
MCMC_DIR = $(SDIR)
MCMC_SRC_DIR = $(SDIR)/src
MCMC_HEADER_DIR = $(SDIR)/include
# shared library name and flags
SHLIB = @MCMC_SHLIB_NAME@
SHLIB_FLAGS = $(CXX_STD) @MCMC_SHLIB_FLAGS@
# general flags
CXXFLAGS = $(CXX_STD) $(OPT_FLAGS) $(FPN_FLAGS) $(MCMC_MATLIB_FLAGS) -I$(MCMC_MATLIB_INCLUDE_PATH) -I$(MCMC_HEADER_DIR)
LIBS= @MCMC_BLAS_LAPACK@
# core MCMC files
SOURCES_MCMC= $(MCMC_SRC_DIR)/aees.cpp $(MCMC_SRC_DIR)/de.cpp $(MCMC_SRC_DIR)/hmc.cpp $(MCMC_SRC_DIR)/nuts.cpp $(MCMC_SRC_DIR)/rmhmc.cpp $(MCMC_SRC_DIR)/mala.cpp $(MCMC_SRC_DIR)/rwmh.cpp
OBJECTS_MCMC= $(SOURCES_MCMC:.cpp=.o)
all: $(MCMC_DIR)/$(SHLIB) $(OBJECTS_MCMC)
# build
$(MCMC_SRC_DIR)/%.o: $(MCMC_SRC_DIR)/%.cpp
$(CXX) $(CXXFLAGS) $< -c -o $@
# shared library
$(MCMC_DIR)/$(SHLIB): $(OBJECTS_MCMC)
$(CXX) $(SHLIB_FLAGS) -o $@ $^ $(LIBS)
# cleanup and install
.PHONY: clean
clean:
@rm -f *.so ./tests/*.test ./tests/*.o $(MCMC_SRC_DIR)/*.o $(MCMC_SRC_DIR)/*.gcov $(MCMC_SRC_DIR)/*.gcno $(MCMC_SRC_DIR)/*.gcda $(MCMC_SRC_DIR)/*.dSYM \
$(MCMC_SRC_DIR)/*/*.o $(MCMC_SRC_DIR)/*/*.gcov $(MCMC_SRC_DIR)/*/*.gcno $(MCMC_SRC_DIR)/*/*.gcda $(MCMC_SRC_DIR)/*/*.dSYM
.PHONY: vclean
vclean:
@rm -f *.so ./tests/*.test ./tests/*.o $(MCMC_SRC_DIR)/*.o $(MCMC_SRC_DIR)/*/*.o
@rm -rf ./include/armadillo*
.PHONY: install
install: $(SHLIB)
@cp $(MCMC_DIR)/$(SHLIB) $(INSTALL_PATH)/lib/$(SHLIB)
@mkdir -p $(INSTALL_PATH)/include/mcmc
@cp -r $(MCMC_DIR)/include/* $(INSTALL_PATH)/include/mcmc