-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (35 loc) · 1.01 KB
/
Makefile
File metadata and controls
54 lines (35 loc) · 1.01 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
TARGET := a.out
SRC_DIR := src_2_body
# SRC_DIR := src_4_body
BIN_DIR := bin
BUILD_DIR := build
SRC := $(shell find $(SRC_DIR) -type f -name *.cpp)
OBJ := $(SRC:$(SRC_DIR)/%.cpp=$(BUILD_DIR)/%.o)
DEP := $(OBJ:.o=.d)
INC_DIR := $(shell find $(SRC_DIR) -type d)
INC_FLAG := $(addprefix -I,$(INC_DIR))
CXX := g++
ARMADILLO_LIB := -larmadillo
LAPACK_LIB := -llapack
BLAS_LIB := -lblas
GMP_LIB := -lgmp
GMPXX_LIB := -lgmpxx
GSL_LIB := -lgsl
BOOST_LIB := -lboost_mpi -lboost_serialization -lboost_filesystem -lboost_system
FFT_LIB := -lfftw3
ALL_LIBS :=
CXX_WARNINGS := -Wall -pedantic-errors
CXX_DEBUG :=
CXX_OPTIM := -O3
CXX_DEP := -MMD
CXXFLAGS := -std=c++11 $(CXX_DEBUG) $(CXX_WARNINGS) $(CXX_OPTIM) $(CXX_DEP) $(INC_FLAG)
$(BIN_DIR)/$(TARGET): $(OBJ)
@mkdir -p $(@D)
$(CXX) $(CXXFLAGS) $(OBJ) -o $@ $(ALL_LIBS)
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp
@mkdir -p $(@D)
$(CXX) $(CXXFLAGS) -c -o $@ $<
.PHONY: clean
clean:
$(RM) -rf $(BUILD_DIR)/* $(BIN_DIR)/$(TARGET) $(BUILD_DIR) $(BIN_DIR)
-include $(DEP)