diff test/Makefile @ 3:3c5545b1568f

*: much better alignment support & tests
author Paper <paper@tflc.us>
date Tue, 22 Oct 2024 23:27:15 -0400
parents f12b5dd4e18c
children
line wrap: on
line diff
--- a/test/Makefile	Tue Oct 22 22:39:05 2024 -0400
+++ b/test/Makefile	Tue Oct 22 23:27:15 2024 -0400
@@ -1,12 +1,30 @@
-_CFLAGS = -g -O2 -I../include $(CFLAGS)
+CFLAGS += -std=c99 -I../include
 
-_LDFLAGS = $(LDFLAGS)
+# binary files
+BINS = test-gcc test-generic test-host
+OBJS = $(BINS:=.o)
+
+.PHONY: all clean test
+
+all: $(BINS)
 
-.c.o:
-	$(CC) -c $(_CFLAGS) $< -o $@
+# suppress the platform-dependent hardware stuff so we only have
+# GCC vector extensions
+test-gcc: CFLAGS += -DVEC_SUPPRESS_HW
 
-main: main.o
-	$(CC) $(_CFLAGS) -o $@ $^ $(_LDFLAGS)
+# also suppress GCC extensions, leaving only the defaults
+test-generic: CFLAGS += -DVEC_SUPPRESS_HW -DVEC_SUPPRESS_GCC
+
+$(OBJS): main.c
+	$(CC) $(CFLAGS) -o $@ -c $^
+
+$(BINS): %: %.o
+	$(CC) $(LDFLAGS) -o $@ $^
 
 clean:
-	$(RM) main main.o
\ No newline at end of file
+	$(RM) $(BINS) $(OBJS)
+
+test: clean $(BINS)
+	./test-gcc
+	./test-generic
+	./test-host