-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (38 loc) · 1.9 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
NAME=x-search
.PHONY: all test check_style clean help
help:
@echo "--------------------------------------------------------------------------------"
@echo " x-search"
@echo "External string searching library written in C++ (C++20)"
@echo "Undergraduate Thesis, 2023"
@echo "Author : Leon Freist <[email protected]>"
@echo "URL : https://github.com/lfreist/x-search"
@echo "Examiner : Prof. Dr. Hannah Bast"
@echo "Supervisor: Johannes Kalmbach"
@echo "--------------------------------------------------------------------------------"
@echo "The following commands are available:"
@echo " - 'make build' build x-search into ./build/"
@echo " - 'make check_style' check the style of all source files"
@echo " - 'make test' run tests"
@echo "--------------------------------------------------------------------------------"
all: check_style build test clean
init:
git submodule update --init --recursive 2>/dev/null
build: init
cmake -B build -DCMAKE_BUILD_TYPE=Release -DRE2_BUILD_TESTING=off 2>/dev/null
cmake --build build --config Release -j $(nproc) 2>/dev/null
build_sanitizer: init
cmake -B build-thread-sanitizer -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CXX_FLAGS="-fsanitize=thread" -DCMAKE_CXX_COMPILER=/usr/bin/clang++-15 -DRE2_BUILD_TESTING=off
cmake --build build-thread-sanitizer -j $(nproc) 2>/dev/null
cmake -B build-address-sanitizer -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CXX_FLAGS="-fsanitize=address" -DCMAKE_CXX_COMPILER=/usr/bin/clang++-15 -DRE2_BUILD_TESTING=off
cmake --build build-address-sanitizer -j $(nproc) 2>/dev/null
test: build_sanitizer
ctest -C Release --test-dir build-thread-sanitizer
ctest -C Release --test-dir build-address-sanitizer
check_style:
bash ./format_check.sh
clean:
rm -rf build
rm -rf build-benchmark
rm -rf build-address-sanitizer
rm -rf build-thread-sanitizer