Mercurial > vec
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 2:f12b5dd4e18c | 3:3c5545b1568f |
|---|---|
| 1 _CFLAGS = -g -O2 -I../include $(CFLAGS) | 1 CFLAGS += -std=c99 -I../include |
| 2 | 2 |
| 3 _LDFLAGS = $(LDFLAGS) | 3 # binary files |
| 4 BINS = test-gcc test-generic test-host | |
| 5 OBJS = $(BINS:=.o) | |
| 4 | 6 |
| 5 .c.o: | 7 .PHONY: all clean test |
| 6 $(CC) -c $(_CFLAGS) $< -o $@ | |
| 7 | 8 |
| 8 main: main.o | 9 all: $(BINS) |
| 9 $(CC) $(_CFLAGS) -o $@ $^ $(_LDFLAGS) | 10 |
| 11 # suppress the platform-dependent hardware stuff so we only have | |
| 12 # GCC vector extensions | |
| 13 test-gcc: CFLAGS += -DVEC_SUPPRESS_HW | |
| 14 | |
| 15 # also suppress GCC extensions, leaving only the defaults | |
| 16 test-generic: CFLAGS += -DVEC_SUPPRESS_HW -DVEC_SUPPRESS_GCC | |
| 17 | |
| 18 $(OBJS): main.c | |
| 19 $(CC) $(CFLAGS) -o $@ -c $^ | |
| 20 | |
| 21 $(BINS): %: %.o | |
| 22 $(CC) $(LDFLAGS) -o $@ $^ | |
| 10 | 23 |
| 11 clean: | 24 clean: |
| 12 $(RM) main main.o | 25 $(RM) $(BINS) $(OBJS) |
| 26 | |
| 27 test: clean $(BINS) | |
| 28 ./test-gcc | |
| 29 ./test-generic | |
| 30 ./test-host |
