forked from crvs/KDTree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (30 loc) · 1.03 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
BUILDDIR=./build
builddir:
if [ -d "${BUILDDIR}" ]; then echo "Directory ${BUILDDIR} already exists"; else echo "Creating ${BUILDDIR}"; mkdir ${BUILDDIR}; fi;
clean:
rm -rf ${BUILDDIR}
cmake: builddir
cmake -S . -B ./build
cmake --build ./build
FLAGS=-Wall -std=c++20 -Wextra -Wpedantic
COMPILER=g++
RELEASE=-O3 -DNDEBUG
compile: builddir
cd ${BUILDDIR} \
&& ${COMPILER} ${FLAGS} ${RELEASE} -c ../KDTree.cpp
error: compile
cd ${BUILDDIR} \
&& ${COMPILER} ${FLAGS} ${RELEASE} -c ../tests/error_test.cpp \
&& ${COMPILER} ${FLAGS} ${RELEASE} KDTree.o error_test.o -o error_test.exe
./build/error_test.exe
toy: compile
cd ${BUILDDIR} \
&& ${COMPILER} ${FLAGS} ${RELEASE} -c ../tests/toy_test.cpp \
&& ${COMPILER} ${FLAGS} ${RELEASE} KDTree.o toy_test.o -o toy_test.exe
./build/toy_test.exe
time: compile
cd ${BUILDDIR} \
&& ${COMPILER} ${FLAGS} ${RELEASE} -c ../tests/construction_time.cpp \
&& ${COMPILER} ${FLAGS} ${RELEASE} KDTree.o construction_time.o -o construction_time.exe
./build/construction_time.exe
all: error toy time