include config.mk

all: csv-test csv-perf seq-read

csv-test: csv-test.c csv.c csv.h
	$(CC) $(CFLAGS-TEST) -DNDEBUG -o $@ csv-test.c csv.c
	./$@

coverage: csv-test
	llvm-profdata merge -sparse default.profraw -o csv-test.profdata
	llvm-cov show ./csv-test -instr-profile=csv-test.profdata

csv-perf: csv-perf.c csv.o csv.h
	$(CC) $(CFLAGS) -o $@ csv-perf.c csv.o

seq-read: seq-read.c
	$(CC) $(CFLAGS) -o $@ $<

csv.o: csv.c csv.h
	$(CC) $(CFLAGS) -DNDEBUG -o $@ -c $<

clean:
	rm csv-test csv-perf seq-read csv.o

.PHONY: all clean coverage
