2006-10-20 13:55:47 +04:00
#!gmake
2006-08-18 20:25:09 +04:00
#
# Makefile for tdb directory
#
CC = @CC@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
includedir = @includedir@
libdir = @libdir@
2006-10-20 13:55:47 +04:00
VPATH = @srcdir@:@libreplacedir@
srcdir = @srcdir@
builddir = @builddir@
CFLAGS = -I$( srcdir) /include -Iinclude -I@libreplacedir@ @CFLAGS@
.PHONY : test
2006-08-18 20:25:09 +04:00
PROGS = bin/tdbtool bin/tdbtorture
2006-10-20 13:55:47 +04:00
TDB_OBJ = @TDBOBJ@ @LIBREPLACEOBJ@
DIRS = bin common tools
2006-08-18 20:25:09 +04:00
2006-10-20 13:55:47 +04:00
all : showflags dirs $( PROGS )
showflags :
@echo 'tdb will be compiled with flags:'
@echo ' CFLAGS = $(CFLAGS)'
@echo ' LIBS = $(LIBS)'
2006-08-18 20:25:09 +04:00
.c.o :
@echo Compiling $* .c
2006-10-20 13:55:47 +04:00
@mkdir -p ` dirname $@ `
2006-08-18 20:25:09 +04:00
@$( CC) $( CFLAGS) -c $< -o $@
2006-10-20 13:55:47 +04:00
dirs :
@mkdir -p $( DIRS)
2006-08-18 20:25:09 +04:00
install : all
mkdir -p $( bindir)
mkdir -p $( includedir)
mkdir -p $( libdir)
mkdir -p $( libdir) /pkgconfig
cp $( PROGS) $( bindir)
2006-10-20 13:55:47 +04:00
cp $( srcdir) /include/tdb.h $( includedir)
2006-08-18 20:25:09 +04:00
cp tdb.pc $( libdir) /pkgconfig
2006-10-20 13:55:47 +04:00
libtdb.a : $( TDB_OBJ )
ar -rv libtdb.a $( TDB_OBJ)
bin/tdbtest : tools /tdbtest .o libtdb .a
$( CC) $( CFLAGS) -o bin/tdbtest tools/tdbtest.o -L. -ltdb -lgdbm
bin/tdbtool : tools /tdbtool .o libtdb .a
$( CC) $( CFLAGS) -o bin/tdbtool tools/tdbtool.o -L. -ltdb
bin/tdbtorture : tools /tdbtorture .o libtdb .a
$( CC) $( CFLAGS) -o bin/tdbtorture tools/tdbtorture.o -L. -ltdb
2006-08-18 20:25:09 +04:00
2006-10-20 13:55:47 +04:00
bin/tdbdump : tools /tdbdump .o libtdb .a
$( CC) $( CFLAGS) -o bin/tdbdump tools/tdbdump.o -L. -ltdb
2006-08-18 20:25:09 +04:00
2006-10-20 13:55:47 +04:00
bin/tdbbackup : tools /tdbbackup .o libtdb .a
$( CC) $( CFLAGS) -o bin/tdbbackup tools/tdbbackup.o -L. -ltdb
2006-08-18 20:25:09 +04:00
2006-10-20 13:55:47 +04:00
test : bin /tdbtorture
bin/tdbtorture
2006-08-18 20:25:09 +04:00
2006-10-20 13:55:47 +04:00
installcheck : test install
2006-08-18 20:25:09 +04:00
clean :
2006-10-20 13:55:47 +04:00
rm -f $( PROGS) *.o *.a common/*.o tools/*.o tdb.pc
rm -f test.db test.tdb torture.tdb test.gdbm
2006-08-18 20:25:09 +04:00
2006-10-20 13:55:47 +04:00
distclean : clean
rm -f *~ */*~
rm -f config.log config.status include/config.h config.cache
rm -f Makefile
2006-08-18 20:25:09 +04:00
2006-10-20 13:55:47 +04:00
realdistclean : distclean
rm -f configure include/config.h.in