CC =	gcc

CFLAGS = -Wall -W -Wstrict-prototypes -O2 -ansi -g -D_XOPEN_SOURCE=500

ifdef OPTIMISED
	CFLAGS +=-DOPTIMISED
endif

LIBS = -lm

all: isam_bench isam_test

isam_bench:	isam_bench.o isam.o index.o
	$(CC) $(CFLAGS) -o isam_bench isam_bench.o isam.o index.o $(LIBS)

isam_test:	isam_test.o isam.o index.o
	$(CC) $(CFLAGS) -o isam_test isam_test.o isam.o index.o $(LIBS)

isam_bench.o:	isam_bench.c isam.h
	$(CC) $(CFLAGS) -c isam_bench.c

isam_test.o:	isam_test.c isam.h
	$(CC) $(CFLAGS) -c isam_test.c

isam.o:	isam.c isam.h index.h
	$(CC) $(CFLAGS) -c isam.c

index.o:	index.c index.h
	$(CC) $(CFLAGS) -c index.c

clean:
	rm -f *.o *~ isam_bench isam_test
