-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile
33 lines (21 loc) · 865 Bytes
/
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
CXX = g++
BUILD_PATH = ./build
EIGEN_INCLUDE = ./eigen/
INCLUDES = -I$(EIGEN_INCLUDE) -I./
CXXFLAGS = -std=c++17 -Wall -Wextra -pthread
ZIPFLAGS = -lz -DKOAN_ENABLE_ZIP
OPTFLAGS = -Ofast -march=native -mtune=native
DEBUGFLAGS = -g -O0
build_path:
@mkdir -p $(BUILD_PATH)
% : %.cpp build_path
$(CXX) $< $(CXXFLAGS) ${ZIPFLAGS} $(OPTFLAGS) $(INCLUDES) -o $(BUILD_PATH)/$@
debug : koan.cpp build_path
$(CXX) $< $(CXXFLAGS) ${ZIPFLAGS} $(DEBUGFLAGS) $(INCLUDES) -o $(BUILD_PATH)/koan
test_utils : tests/test_utils.cpp build_path
$(CXX) $< $(CXXFLAGS) ${ZIPFLAGS} $(DEBUGFLAGS) $(INCLUDES) -I./extern/ -o $(BUILD_PATH)/test_utils
test_gradcheck : tests/test_gradcheck.cpp build_path
$(CXX) $< $(CXXFLAGS) ${ZIPFLAGS} $(DEBUGFLAGS) $(INCLUDES) -I./extern/ -o $(BUILD_PATH)/test_gradcheck
all: koan test_utils test_gradcheck
clean:
rm -rf $(BUILD_PATH)