2008-09-14 21:21:54 +04:00
dirs ::
@mkdir -p bin common tools
2010-09-18 10:56:10 +04:00
PROGS = bin/tdbtool$( EXEEXT) bin/tdbrestore$( EXEEXT) bin/tdbdump$( EXEEXT) bin/tdbbackup$( EXEEXT)
2008-09-14 21:21:54 +04:00
PROGS_NOINSTALL = bin/tdbtest$( EXEEXT) bin/tdbtorture$( EXEEXT)
ALL_PROGS = $( PROGS) $( PROGS_NOINSTALL)
TDB_SONAME = libtdb.$( SHLIBEXT) .1
TDB_SOLIB = libtdb.$( SHLIBEXT) .$( PACKAGE_VERSION)
2008-12-23 21:39:52 +03:00
TDB_STLIB = libtdb.a
2008-09-14 21:21:54 +04:00
2008-12-23 21:39:52 +03:00
TDB_LIB = $( TDB_STLIB)
2008-09-14 21:21:54 +04:00
bin/tdbtest$(EXEEXT) : tools /tdbtest .o $( TDB_LIB )
2010-08-13 16:53:22 +04:00
$( CC) $( CFLAGS) $( LDFLAGS) -o bin/tdbtest tools/tdbtest.o -L. -ltdb -lgdbm $( TDB_DEPS)
2008-09-14 21:21:54 +04:00
bin/tdbtool$(EXEEXT) : tools /tdbtool .o $( TDB_LIB )
2010-08-13 16:53:22 +04:00
$( CC) $( CFLAGS) $( LDFLAGS) -o bin/tdbtool tools/tdbtool.o -L. -ltdb $( TDB_DEPS)
2008-09-14 21:21:54 +04:00
bin/tdbtorture$(EXEEXT) : tools /tdbtorture .o $( TDB_LIB )
2010-08-13 16:53:22 +04:00
$( CC) $( CFLAGS) $( LDFLAGS) -o bin/tdbtorture tools/tdbtorture.o -L. -ltdb $( TDB_DEPS)
2008-09-14 21:21:54 +04:00
bin/tdbdump$(EXEEXT) : tools /tdbdump .o $( TDB_LIB )
2010-08-13 16:53:22 +04:00
$( CC) $( CFLAGS) $( LDFLAGS) -o bin/tdbdump tools/tdbdump.o -L. -ltdb $( TDB_DEPS)
2008-09-14 21:21:54 +04:00
2010-09-18 10:56:10 +04:00
bin/tdbrestore$(EXEEXT) : tools /tdbrestore .o $( TDB_LIB )
$( CC) $( CFLAGS) $( LDFLAGS) -o bin/tdbrestore tools/tdbrestore.o -L. -ltdb $( TDB_DEPS)
2008-09-14 21:21:54 +04:00
bin/tdbbackup$(EXEEXT) : tools /tdbbackup .o $( TDB_LIB )
2010-08-13 16:53:22 +04:00
$( CC) $( CFLAGS) $( LDFLAGS) -o bin/tdbbackup tools/tdbbackup.o -L. -ltdb $( TDB_DEPS)
2008-09-14 21:21:54 +04:00
2009-08-30 02:40:18 +04:00
test :: abi_checks
2008-09-14 21:21:54 +04:00
test :: bin /tdbtorture $( EXEEXT ) $( TDB_SONAME )
$( LIB_PATH_VAR) = . bin/tdbtorture$( EXEEXT)
2009-08-28 18:03:06 +04:00
abi_checks ::
@echo ABI checks:
@./script/abi_checks.sh tdb include/tdb.h
2008-09-14 21:21:54 +04:00
clean ::
rm -f test.db test.tdb torture.tdb test.gdbm
2008-12-23 21:39:52 +03:00
rm -f $( TDB_SONAME) $( TDB_SOLIB) $( TDB_STLIB) libtdb.$( SHLIBEXT)
2008-09-14 21:21:54 +04:00
rm -f $( ALL_PROGS) tdb.pc
2009-08-30 02:28:31 +04:00
rm -f tdb.exports.sort tdb.exports.check tdb.exports.check.sort
rm -f tdb.signatures.sort tdb.signatures.check tdb.signatures.check.sort
2008-09-14 21:21:54 +04:00
2008-12-18 22:49:53 +03:00
build-python :: tdb .$( SHLIBEXT )
2008-09-14 21:21:54 +04:00
2008-12-23 01:39:30 +03:00
pytdb.o : $( tdbdir ) /pytdb .c
$( CC) $( PICFLAG) -c $( tdbdir) /pytdb.c $( CFLAGS) ` $( PYTHON_CONFIG) --cflags`
2008-09-14 21:21:54 +04:00
2008-12-23 01:39:30 +03:00
tdb.$(SHLIBEXT) : libtdb .$( SHLIBEXT ) pytdb .o
2010-08-13 16:53:22 +04:00
$( SHLD) $( SHLD_FLAGS) -o $@ pytdb.o -L. -ltdb ` $( PYTHON_CONFIG) --ldflags` $( TDB_DEPS)
2008-09-14 21:21:54 +04:00
install :: installdirs installbin installheaders installlibs \
2009-12-20 20:01:24 +03:00
$( PYTHON_INSTALL_TARGET) installdocs
2010-09-18 10:56:10 +04:00
doc :: manpages /tdbbackup .8 manpages /tdbrestore .8 manpages /tdbdump .8 manpages /tdbtool .8
2009-12-20 20:01:24 +03:00
.SUFFIXES : .8.xml .8
.8.xml.8 :
-test -z " $( XSLTPROC) " || $( XSLTPROC) -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
installdocs ::
2010-01-06 16:39:43 +03:00
${ INSTALLCMD } -d $( DESTDIR) $( mandir) /man8
for I in manpages/*.8; do \
${ INSTALLCMD } -m 644 $$ I $( DESTDIR) $( mandir) /man8; \
2009-12-20 20:01:24 +03:00
done
2008-09-14 21:21:54 +04:00
install-python :: build -python
2008-12-18 22:49:53 +03:00
mkdir -p $( DESTDIR) ` $( PYTHON) -c " import distutils.sysconfig; print distutils.sysconfig.get_python_lib(1, prefix=' $( prefix) ') " `
cp tdb.$( SHLIBEXT) $( DESTDIR) ` $( PYTHON) -c " import distutils.sysconfig; print distutils.sysconfig.get_python_lib(1, prefix=' $( prefix) ') " `
2008-09-14 21:21:54 +04:00
check-python :: build -python $( TDB_SONAME )
$( LIB_PATH_VAR) = . PYTHONPATH = " .: $( tdbdir) " $( PYTHON) $( tdbdir) /python/tests/simple.py
clean ::
2008-12-18 22:49:53 +03:00
rm -f tdb.$( SHLIBEXT)
2008-09-14 21:21:54 +04:00
installdirs ::
mkdir -p $( DESTDIR) $( bindir)
mkdir -p $( DESTDIR) $( includedir)
mkdir -p $( DESTDIR) $( libdir)
mkdir -p $( DESTDIR) $( libdir) /pkgconfig
installbin :: all installdirs
cp $( PROGS) $( DESTDIR) $( bindir)
installheaders :: installdirs
cp $( srcdir) /include/tdb.h $( DESTDIR) $( includedir)
installlibs :: all installdirs
cp tdb.pc $( DESTDIR) $( libdir) /pkgconfig
2008-12-23 21:39:52 +03:00
cp $( TDB_STLIB) $( TDB_SOLIB) $( DESTDIR) $( libdir)
2009-12-17 09:39:09 +03:00
rm -f $( DESTDIR) $( libdir) /libtdb.$( SHLIBEXT)
ln -s $( TDB_SOLIB) $( DESTDIR) $( libdir) /libtdb.$( SHLIBEXT)
rm -f $( DESTDIR) $( libdir) /$( TDB_SONAME)
ln -s $( TDB_SOLIB) $( DESTDIR) $( libdir) /$( TDB_SONAME)
2008-09-14 21:21:54 +04:00
2008-12-23 21:39:52 +03:00
$(TDB_STLIB) : $( TDB_OBJ )
ar -rv $( TDB_STLIB) $( TDB_OBJ)
2008-09-14 21:21:54 +04:00
libtdb.$(SHLIBEXT) : $( TDB_SOLIB )
ln -fs $< $@
$(TDB_SONAME) : $( TDB_SOLIB )
ln -fs $< $@