CFLAGS = -std=c99 $(shell pkg-config --cflags unibilium termkey tickit) -DHAVE_UNIBILIUM
LDFLAGS = $(shell pkg-config --libs unibilium termkey tickit)
LIBTOOL = libtool
TESTSOURCES = $(sort $(wildcard t/[0-9]*.c))
TESTFILES = $(TESTSOURCES:.c=.t)

t/%.lo: t/%.c
	$(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) -o $@ -c $^

t/%.t: t/%.lo t/taplib.lo t/mockterm.lo t/taplib-tickit.lo
	$(LIBTOOL) --mode=link --tag=CC $(CC) -o $@ $^ $(LDFLAGS)

.PHONY: test
test: $(TESTFILES)
	$(LIBTOOL) --mode=execute prove -e ''
