comparison test/Makefile.template @ 17:41dd962abdd1

*: allow compiling vec in a C++ translation unit this is stupid, but whatever
author Paper <paper@tflc.us>
date Wed, 20 Nov 2024 12:02:15 -0500
parents e05c257c6a23
children cf04071d2148
comparison
equal deleted inserted replaced
16:9da2aba90c87 17:41dd962abdd1
1 CFLAGS += -g -O2 -std=c99 -I../include 1 CPPFLAGS += -g -O2 -I../include -Wall -Wpedantic -Werror=strict-aliasing
2 CFLAGS += $(CPPFLAGS) -std=c99
3 CXXFLAGS += $(CPPFLAGS) -std=c++11
2 4
3 HEADERS = ../include/vec/vec.h \ 5 HEADERS = ../include/vec/vec.h \
4 ../include/vec/impl/ppc/altivec.h \ 6 ../include/vec/impl/ppc/altivec.h \
5 ../include/vec/impl/x86/avx2.h \ 7 ../include/vec/impl/x86/avx2.h \
6 ../include/vec/impl/x86/avx512f.h \ 8 ../include/vec/impl/x86/avx512f.h \
7 ../include/vec/impl/x86/mmx.h \ 9 ../include/vec/impl/x86/mmx.h \
8 ../include/vec/impl/x86/sse2.h \ 10 ../include/vec/impl/x86/sse2.h \
9 ../include/vec/impl/x86/sse41.h \ 11 ../include/vec/impl/x86/sse41.h \
10 ../include/vec/impl/cpu.h \ 12 ../include/vec/impl/cpu.h \
11 ../include/vec/impl/fallback.h \ 13 ../include/vec/impl/fallback.h \
12 ../include/vec/impl/generic.h 14 ../include/vec/impl/generic.h \
13 BINS = test-generic test-host 15 test_align.h \
14 OBJS = vec-generic.o vec-host.o test.o 16 test_arith.h \
17 test_compare.h
18 BINS = test-generic test-host test-cxx
19 OBJS = vec-generic.o vec-host.o test.o test-cxx.o
15 20
16 .PHONY: all clean test 21 .PHONY: all clean test
17 22
18 all: $(BINS) 23 all: $(BINS)
19 24
24 $(CC) $(CFLAGS) -c -o $@ $< 29 $(CC) $(CFLAGS) -c -o $@ $<
25 30
26 test.o: test.c 31 test.o: test.c
27 $(CC) $(CFLAGS) -c -o $@ $< 32 $(CC) $(CFLAGS) -c -o $@ $<
28 33
34 test-cxx.o: test.cc
35 $(CXX) $(CXXFLAGS) -c -o $@ $<
36
29 test-generic: vec-generic.o test.o 37 test-generic: vec-generic.o test.o
30 $(CC) $(LDFLAGS) -o $@ $^ 38 $(CC) $(LDFLAGS) -o $@ $^
31 39
32 test-host: vec-host.o test.o 40 test-host: vec-host.o test.o
33 $(CC) $(LDFLAGS) -o $@ $^ 41 $(CC) $(LDFLAGS) -o $@ $^
42
43 test-cxx: test-cxx.o
44 $(CXX) $(LDFLAGS) -o $@ $^
34 45
35 clean: 46 clean:
36 $(RM) $(BINS) $(OBJS) 47 $(RM) $(BINS) $(OBJS)
37 48
38 test: clean $(BINS) 49 test: clean $(BINS)
39 ./test-generic 50 ./test-generic
40 ./test-host 51 ./test-host
52 ./test-cxx