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