forked from google/highway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
30 lines (22 loc) · 977 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
.DELETE_ON_ERROR:
OBJS := runtime_dispatch.o nanobenchmark.o
TEST_NAMES := arithmetic_test compare_test convert_test hwy_test logical_test memory_test nanobenchmark_test swizzle_test
TESTS := $(foreach i, $(TEST_NAMES), bin/$(i))
CXXFLAGS += -I. -fmerge-all-constants -std=c++17 -O2 \
-Wno-builtin-macro-redefined -D__DATE__="redacted" \
-D__TIMESTAMP__="redacted" -D__TIME__="redacted" \
-Wall -Wextra -Wformat-security -Wno-unused-function \
-Wnon-virtual-dtor -Woverloaded-virtual -Wvla
.PHONY: all
all: $(TESTS) benchmark test
.PHONY: clean
clean: ; @rm -rf $(OBJS) bin/ benchmark.o
$(OBJS): %.o: hwy/%.cc
$(CXX) -c $(CXXFLAGS) $< -o $@
benchmark: $(OBJS) hwy/benchmark.cc
mkdir -p bin && $(CXX) $(CXXFLAGS) $(OBJS) hwy/benchmark.cc -o bin/benchmark
$(TESTS): $(OBJS)
mkdir -p bin && $(CXX) $(CXXFLAGS) $(subst bin/,hwy/tests/,$@).cc $(OBJS) -o $@
.PHONY: test
test: $(TESTS)
for name in $^; do echo ---------------------$$name && $$name; done