-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·62 lines (50 loc) · 1.43 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
60
61
62
ARMADIR=../armadillo-12.6.5
# -I$(ARMADIR)/include
# FILES AND DIRECTORIES
SRC=$(wildcard src/*.cpp)
_OBJ=$(patsubst src/%,%,$(SRC))
DEPS=$(wildcard include/*.h)
INC=-Iinclude/ -I/usr/local/Cellar/armadillo/12.6.5/include
EXE=RV-GOMEA
EXE-dbg=RV-GOMEA-dbg
ODIR=build
OBJ=$(patsubst %.cpp,$(ODIR)/%.o,$(_OBJ))
ODIR-dbg=debug
OBJ-dbg=$(patsubst %.cpp,$(ODIR-dbg)/%.o,$(_OBJ))
# COMPILER FLAGS
CC=g++-13
CPPFLAGS=-std=c++17 -DARMA_DONT_USE_OPENMP -DARMADILLO
CPPFLAGS-rl=$(CPPFLAGS) -O2 -fopenmp -DARMA_NO_DEBUG
CPPFLAGS-dbg=$(CPPFLAGS) -O0 -DDEBUG -g -DCHECK_PARTIAL_FITNESS
CPPLIBS=-lm -L/usr/local/Cellar/armadillo/12.6.5/lib -larmadillo -lblas -llapack
.PHONY: clean test
default: $(EXE)
all: $(EXE)
debug: $(EXE-dbg)
$(ODIR)/%.o: %.cpp $(DEPS)
@mkdir -p $(ODIR)
$(CC) $(CPPFLAGS-rl) $(INC) -c -o $@ $< $(CPPLIBS)
$(ODIR)/%.o: src/%.cpp $(DEPS)
@mkdir -p $(ODIR)
$(CC) $(CPPFLAGS-rl) $(INC) -c -o $@ $< $(CPPLIBS)
$(ODIR-dbg)/%.o: %.cpp $(DEPS)
@mkdir -p $(ODIR-dbg)
$(CC) $(CPPFLAGS-dbg) $(INC) -c -o $@ $< $(CPPLIBS)
$(ODIR-dbg)/%.o: src/%.cpp $(DEPS)
@mkdir -p $(ODIR-dbg)
$(CC) $(CPPFLAGS-dbg) $(INC) -c -o $@ $< $(CPPLIBS)
$(EXE): $(OBJ) $(CECOBJ)
export ARMA_OPENMP_THREADS=1
$(CC) $(CPPFLAGS-rl) -o $@ $^ $(CPPLIBS)
$(EXE-dbg): $(OBJ-dbg) $(CECOBJ)
$(CC) $(CPPFLAGS-dbg) -o $@ $^ $(CPPLIBS)
clean:
rm -rf $(ODIR)
rm -rf $(ODIR-dbg)
rm -f *.dat
rm -f $(EXE)
rm -f $(EXE-dgb)
test:
@echo $(ODIR)
@echo $(SRC)
@echo $(OBJ)