CC=gcc
CFLAGS=-ansi -Wall -pedantic -g
INCLUDE=-Isrc/include
LIBS=-lm

.PHONY: all clean

all: radar

clean:
	find . -name "*.o" -exec rm -rf {} ';'
	rm -f radar txtparse.test

txtparse.test: src/txtparse.c
	$(CC) $(CFLAGS) $(INCLUDE) -o $@ -DTXTPARSE_TEST $^ $(LIBS)

radar: src/FileBuf.o src/gramhash.o src/miner.o src/str.o src/vbyte.o \
       src/StrMem.o src/merger.o src/postings.o src/txtparse.o src/vec.o \
	   src/index.o src/join.o src/bias.o src/association.o src/keymemory.o
	$(CC) $(CFLAGS) $(INCLUDE) -o $@ $^ $(LIBS)

%.o: %.c
	$(CC) $(CFLAGS) $(INCLUDE) -c -o $@ $^ 
