forked from intel/x86-simd-sort
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
27 lines (22 loc) · 849 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
CXX ?= g++
SRCDIR = ./src
TESTDIR = ./tests
BENCHDIR = ./benchmarks
UTILS = ./utils
SRCS = $(wildcard $(SRCDIR)/*.hpp)
TESTS = $(wildcard $(TESTDIR)/*.cpp)
TESTOBJS = $(patsubst $(TESTDIR)/%.cpp,$(TESTDIR)/%.o,$(TESTS))
TESTOBJS := $(filter-out $(TESTDIR)/main.o ,$(TESTOBJS))
GTEST_LIB = gtest
GTEST_INCLUDE = /usr/local/include
CXXFLAGS += -I$(SRCDIR) -I$(GTEST_INCLUDE) -I$(UTILS)
LD_FLAGS = -L /usr/local/lib -l $(GTEST_LIB) -l pthread
all : test bench
$(TESTDIR)/%.o : $(TESTDIR)/%.cpp $(SRCS)
$(CXX) -march=icelake-client -O3 $(CXXFLAGS) -c $< -o $@
test: $(TESTDIR)/main.cpp $(TESTOBJS) $(SRCS)
$(CXX) tests/main.cpp $(TESTOBJS) $(CXXFLAGS) $(LD_FLAGS) -o testexe
bench: $(BENCHDIR)/main.cpp $(SRCS)
$(CXX) $(BENCHDIR)/main.cpp $(CXXFLAGS) -march=icelake-client -O3 -o benchexe
clean:
rm -f $(TESTDIR)/*.o testexe benchexe