Mercurial > vec
diff 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 |
line wrap: on
line diff
--- a/test/Makefile.template Wed Nov 20 04:16:56 2024 -0500 +++ b/test/Makefile.template Wed Nov 20 12:02:15 2024 -0500 @@ -1,4 +1,6 @@ -CFLAGS += -g -O2 -std=c99 -I../include +CPPFLAGS += -g -O2 -I../include -Wall -Wpedantic -Werror=strict-aliasing +CFLAGS += $(CPPFLAGS) -std=c99 +CXXFLAGS += $(CPPFLAGS) -std=c++11 HEADERS = ../include/vec/vec.h \ ../include/vec/impl/ppc/altivec.h \ @@ -9,9 +11,12 @@ ../include/vec/impl/x86/sse41.h \ ../include/vec/impl/cpu.h \ ../include/vec/impl/fallback.h \ - ../include/vec/impl/generic.h -BINS = test-generic test-host -OBJS = vec-generic.o vec-host.o test.o + ../include/vec/impl/generic.h \ + test_align.h \ + test_arith.h \ + test_compare.h +BINS = test-generic test-host test-cxx +OBJS = vec-generic.o vec-host.o test.o test-cxx.o .PHONY: all clean test @@ -26,15 +31,22 @@ test.o: test.c $(CC) $(CFLAGS) -c -o $@ $< +test-cxx.o: test.cc + $(CXX) $(CXXFLAGS) -c -o $@ $< + test-generic: vec-generic.o test.o $(CC) $(LDFLAGS) -o $@ $^ test-host: vec-host.o test.o $(CC) $(LDFLAGS) -o $@ $^ +test-cxx: test-cxx.o + $(CXX) $(LDFLAGS) -o $@ $^ + clean: $(RM) $(BINS) $(OBJS) test: clean $(BINS) ./test-generic ./test-host + ./test-cxx