#
# Makefile for tdb directory
#

CFLAGS = -DSTANDALONE -DTDB_DEBUG -g -DHAVE_MMAP=1 -Iinclude
CC = gcc

PROGS = bin/tdbtest bin/tdbtool bin/tdbtorture
TDB_OBJ = common/tdb.o common/spinlock.o

default: $(PROGS)

bin/tdbtest: tools/tdbtest.o $(TDB_OBJ)
	$(CC) $(CFLAGS) -o bin/tdbtest tools/tdbtest.o $(TDB_OBJ) -lgdbm

bin/tdbtool: tools/tdbtool.o $(TDB_OBJ)
	$(CC) $(CFLAGS) -o bin/tdbtool tools/tdbtool.o $(TDB_OBJ)

bin/tdbtorture: tools/tdbtorture.o $(TDB_OBJ)
	$(CC) $(CFLAGS) -o bin/tdbtorture tools/tdbtorture.o $(TDB_OBJ)

bin/tdbdump: tools/tdbdump.o $(TDB_OBJ)
	$(CC) $(CFLAGS) -o bin/tdbdump tools/tdbdump.o $(TDB_OBJ)

bin/tdbbackup: tools/tdbbackup.o $(TDB_OBJ)
	$(CC) $(CFLAGS) -o bin/tdbbackup tools/tdbbackup.o $(TDB_OBJ)

clean:
	rm -f $(PROGS) common/*.o tools/*.o *~ *.bak */*~ */*.bak *% core test.db test.tdb test.gdbm