Makefile 708 Bytes
Newer Older
wadaniel's avatar
wadaniel committed
1 2 3 4 5 6 7 8
CC=g++
LD=$(CC)

KORALICFLAGS=`python3 -m korali.cxx --cflags`
KORALILIBS=`python3 -m korali.cxx --libs`

CFLAGS = -Wall -Wfatal-errors -std=c++14 -I ./includes/
CFLAGS += -O3
9
CFLAGS += -fopenmp -D _OPENMP
wadaniel's avatar
wadaniel committed
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33

OBJECTS = main_ssa.o SSA_CPU.o

.DEFAULT: all

all: ssa cmaes

ssa: $(OBJECTS) SSA_CPU.cpp ./includes/SSA_CPU.hpp
	$(CC) $(CFLAGS) -c SSA_CPU.cpp -o SSA_CPU.o
	$(LD) $(OBJECTS) -o ssa $(CFLAGS)

cmaes: $(OBJECTS) main_cmaes.cpp ./includes/objective.hpp 
	$(CC) -c main_cmaes.cpp -o main_cmaes.o $(KORALICFLAGS) $(KORALILIBS) $(CFLAGS)
	$(LD) main_cmaes.o SSA_CPU.o -o cmaes $(KORALICFLAGS) $(KORALILIBS) $(CFLAGS)

%.o: %.cpp
	$(CC) $(CFLAGS) -c $^ -o $@
	
clean:
	rm -f *.o
	rm -f ssa
	rm -f cmaes