CFLAGS += -std=c99 -I../include

# binary files
BINS = test-gcc test-generic test-host
OBJS = $(BINS:=.o)

.PHONY: all clean test

all: $(BINS)

# suppress the platform-dependent hardware stuff so we only have
# GCC vector extensions
test-gcc: CFLAGS += -DVEC_SUPPRESS_HW

# 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) $(BINS) $(OBJS)

test: clean $(BINS)
	./test-gcc
	./test-generic
	./test-host
