-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (43 loc) · 1.46 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
CXX := g++
CXX_FLAGS := -Wall -Wextra -O3 -Wno-deprecated-copy -DHAVE_INLINE -std=c++17#-fopenmp -D_GLIBCXX_PARALLEL #-frename-registers -march=native # -fno-signed-zeros -fno-trapping-math -funroll-loops #-fprofile-dir="./gcda" -fprofile-use#-fprofile-generate #-fprofile-use #-Ofast #-std=c++17
PY := python3
BIN := bin
SRC := src
TEST_SRC:= test
INCLUDE := include
EIGEN_INCLUDE := include/eigen
SPECTRA_INCLUDE := include/spectra/include
FUNC_INCLUDE := include/func
LIB := lib
OUTPUT := output
GRAPHS := output/graphs
GCDA := gcda
JOBS := Q_job_creation/pysrc
LIBRARIES := -lgsl -lgslcblas
EXECUTABLE := main
TEST_EXECUTABLE := test
JOBS_CREATE := create_jobs_Q.py
main: $(BIN)/$(EXECUTABLE)
test: $(BIN)/$(TEST_EXECUTABLE)
build: clean_main clean_output main
./$(BIN)/$(EXECUTABLE)
run: clean_output main
./$(BIN)/$(EXECUTABLE)
check: clean_test test
./$(BIN)/$(TEST_EXECUTABLE)
$(BIN)/$(EXECUTABLE): $(SRC)/*.cpp
$(CXX) $(CXX_FLAGS) -I$(INCLUDE) -I$(EIGEN_INCLUDE) -I$(SPECTRA_INCLUDE) -I$(FUNC_INCLUDE) -L$(LIB) $^ -o $@ $(LIBRARIES)
$(BIN)/$(TEST_EXECUTABLE): $(TEST_SRC)/*.cpp
$(CXX) $(CXX_FLAGS) -I$(INCLUDE) -I$(EIGEN_INCLUDE) -I$(SPECTRA_INCLUDE) -I$(FUNC_INCLUDE) -L$(LIB) $^ -o $@ $(LIBRARIES)
clean_main:
-rm -f $(BIN)/$(EXECUTABLE)
clean_test:
-rm -f $(BIN)/$(TEST_EXECUTABLE)
clean:
-rm -f $(BIN)/* $(OUTPUT)/* $(GRAPHS)/*
clean_output:
-rm -f $(OUTPUT)/* $(GRAPHS)/*
clean_gcda:
-rm -f $(GCDA)/*
job: main
$(PY) $(JOBS)/$(JOBS_CREATE)