36
|
1 CPPFLAGS += -g -O2 -I../include -Wall -Wpedantic -Werror=strict-aliasing
|
|
2 CFLAGS += $(CPPFLAGS) -std=c99
|
|
3 CXXFLAGS += $(CPPFLAGS) -std=c++11
|
|
4
|
|
5 HEADERS = ../include/vec/vec.h \
|
|
6 ../include/vec/impl/ppc/altivec.h \
|
|
7 ../include/vec/impl/x86/avx2.h \
|
|
8 ../include/vec/impl/x86/avx512f.h \
|
|
9 ../include/vec/impl/x86/mmx.h \
|
|
10 ../include/vec/impl/x86/sse2.h \
|
|
11 ../include/vec/impl/x86/sse41.h \
|
|
12 ../include/vec/impl/cpu.h \
|
|
13 ../include/vec/impl/fallback.h \
|
|
14 ../include/vec/impl/generic.h \
|
|
15 test_align.h \
|
|
16 test_arith.h \
|
|
17 test_compare.h \
|
|
18 test_shift.h
|
|
19 BINS = test-generic test-host test-cxx
|
|
20 OBJS = vec-generic.o vec-host.o test.o test-cxx.o
|
|
21
|
|
22 .PHONY: all clean test
|
|
23
|
|
24 all: $(BINS)
|
|
25
|
|
26 vec-generic.o: ../src/vec.c $(HEADERS)
|
|
27 $(CC) $(CFLAGS) -DVEC_SUPPRESS_HW=1 -c -o $@ $<
|
|
28
|
|
29 vec-host.o: ../src/vec.c $(HEADERS)
|
|
30 $(CC) $(CFLAGS) -c -o $@ $<
|
|
31
|
|
32 test.o: test.c
|
|
33 $(CC) $(CFLAGS) -c -o $@ $<
|
|
34
|
|
35 test-cxx.o: test.cc
|
|
36 $(CXX) $(CXXFLAGS) -c -o $@ $<
|
|
37
|
|
38 test-generic: vec-generic.o test.o
|
|
39 $(CC) $(LDFLAGS) -o $@ $^
|
|
40
|
|
41 test-host: vec-host.o test.o
|
|
42 $(CC) $(LDFLAGS) -o $@ $^
|
|
43
|
|
44 test-cxx: test-cxx.o $(HEADERS)
|
|
45 $(CXX) $(LDFLAGS) -o $@ $<
|
|
46
|
|
47 clean:
|
|
48 $(RM) $(BINS) $(OBJS)
|
|
49
|
|
50 test: clean $(BINS)
|
|
51 ./test-generic
|
|
52 ./test-host
|
|
53 ./test-cxx
|