CC	= gcc
CFLAGS	= -g
AR	= ar -rs
RM	= rm -f

all:	libindexer libfsearch testindex testfsearch

libindexer: libindexer.o
	$(AR) libindexer.a ../avl-1.4.0/avl.o libindexer.o

libindexer.o: libindexer.c
	$(CC) $(CFLAGS) -I../avl-1.4.0 libindexer.c -c -I.

libfsearch: libfsearch.o
	$(AR) libfsearch.a libfsearch.o

libfsearch.o: libfsearch.c
	$(CC) $(CFLAGS) libfsearch.c -c -I.

testindex: testindex.o libindexer.a
	$(CC) $(CFLAGS) testindex.o libindexer.a -o testindex

testfsearch: testfsearch.o libfsearch.a
	$(CC) $(CFLAGS) testfsearch.o libfsearch.a -o testfsearch

clean:
	$(RM) libindexer.o libindexer.a libfsearch.o libfsearch.a testindex.o testindex testfsearch.o testfsearch
