forked from fast-pack/dictionary
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (26 loc) · 1.3 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
# minimalist makefile
.SUFFIXES:
#
.SUFFIXES: .cpp .o .c .h
ifeq ($(DEBUG),1)
GENFLAGS = -fPIC -ggdb -march=native -Wall -Wextra -pedantic -Wshadow -fsanitize=undefined -fno-omit-frame-pointer -fsanitize=address -Wno-unused
else
GENFLAGS = -fPIC -O3 -march=native -Wall -Wextra -pedantic -Wshadow -Wno-unused
#GENFLAGS = -fPIC -O3 -mavx2 -Wall -Wextra -pedantic -Wshadow -Wno-unused
#GENFLAGS = -fPIC -O3 -msse2 -Wall -Wextra -pedantic -Wshadow -Wno-unused
endif # debug
CFLAGS = -std=c99 $(GENFLAGS)
CXXFLAGS = -std=c++11 $(GENFLAGS)
HEADERS=src/bpacking.h src/dict.h src/scalarcodec.h src/avx512bpacking.h src/avx512codec.h src/avx512dict.h src/avxbpacking.h src/avxcodec.h src/avxdict.h
EXECUTABLES=scalartest avxtest decodebenchmark
all: $(EXECUTABLES)
test: $(EXECUTABLES)
@(./scalartest && ./avxtest && echo "\033[0;32mAll tests ok\033[0m" ) || (echo "\033[0;31mSome tests failed\033[0m")
scalartest : ./tests/scalartest.cpp $(HEADERS)
$(CXX) $(CXXFLAGS) -o scalartest ./tests/scalartest.cpp -Isrc
avxtest : ./tests/avxtest.cpp $(HEADERS)
$(CXX) $(CXXFLAGS) -o avxtest ./tests/avxtest.cpp -Isrc
decodebenchmark : ./benchmarks/decodebenchmark.cpp ./benchmarks/benchmark.h $(HEADERS)
$(CXX) $(CXXFLAGS) -o decodebenchmark ./benchmarks/decodebenchmark.cpp -Isrc -Ibenchmarks
clean:
rm -f $(EXECUTABLES)