2006-08-31 09:38:48 +00:00
#!gmake
#
2005-04-23 04:30:58 +00:00
CC = @CC@
GCOV = @GCOV@
2005-05-30 15:59:08 +00:00
XSLTPROC = @XSLTPROC@
2006-01-11 16:31:57 +00:00
DOXYGEN = @DOXYGEN@
2005-04-26 10:58:54 +00:00
prefix = @prefix@
exec_prefix = @exec_prefix@
2006-09-04 12:21:42 +00:00
datarootdir = @datarootdir@
2005-04-26 10:58:54 +00:00
includedir = @includedir@
libdir = @libdir@
bindir = @bindir@
2006-02-23 09:55:50 +00:00
mandir = @mandir@
2008-09-19 15:49:39 -04:00
VPATH = @srcdir@:@libreplacedir@
2006-08-22 01:32:29 +00:00
srcdir = @srcdir@
builddir = @builddir@
2008-09-19 15:49:39 -04:00
sharedbuilddir = @sharedbuilddir@
INSTALLCMD = @INSTALL@
2006-08-22 04:19:40 +00:00
SLAPD = @SLAPD@
2006-08-22 10:46:23 +00:00
EXTRA_OBJ = @EXTRA_OBJ@
TESTS = test-tdb.sh @TESTS@
2007-11-28 00:25:47 +01:00
PACKAGE_VERSION = @PACKAGE_VERSION@
2008-02-12 12:41:21 +01:00
PYTHON = @PYTHON@
2008-02-12 00:49:36 +01:00
PYTHON_CONFIG = @PYTHON_CONFIG@
2008-02-11 23:51:59 +01:00
ldbdir = $( srcdir)
2009-09-11 23:49:36 +02:00
LIB_PATH_VAR = @LIB_PATH_VAR@
2004-04-11 01:26:22 +00:00
2009-01-15 18:05:45 -05:00
LDB_MODULESDIR = @LDB_MODULESDIR@
2007-04-30 08:53:56 +00:00
TALLOC_LIBS = @TALLOC_LIBS@
TALLOC_CFLAGS = @TALLOC_CFLAGS@
2007-04-30 10:49:42 +00:00
TALLOC_OBJ = @TALLOC_OBJ@
2007-04-30 08:53:56 +00:00
TDB_LIBS = @TDB_LIBS@
TDB_CFLAGS = @TDB_CFLAGS@
2007-04-30 10:49:42 +00:00
TDB_OBJ = @TDB_OBJ@
2007-04-30 08:53:56 +00:00
2008-12-23 04:18:31 +01:00
TEVENT_LIBS = @TEVENT_LIBS@
TEVENT_CFLAGS = @TEVENT_CFLAGS@
TEVENT_OBJ = @TEVENT_OBJ@
2008-06-15 19:16:35 +02:00
2007-04-30 08:53:56 +00:00
POPT_LIBS = @POPT_LIBS@
POPT_CFLAGS = @POPT_CFLAGS@
2007-04-30 10:49:42 +00:00
POPT_OBJ = @POPT_OBJ@
2007-04-30 08:53:56 +00:00
2007-09-11 18:24:09 +00:00
LDAP_LIBS = @LDAP_LIBS@
2007-11-06 03:19:07 +01:00
LIBDL = @LIBDL@
2007-11-05 21:57:33 +01:00
SHLIBEXT = @SHLIBEXT@
2007-11-06 01:05:19 +01:00
LD_EXPORT_DYNAMIC = @LD_EXPORT_DYNAMIC@
2007-11-16 10:21:57 +01:00
SHLD = @SHLD@
2007-11-06 02:17:05 +01:00
SHLD_FLAGS = @SHLD_FLAGS@
2007-11-05 21:57:39 +01:00
2007-11-06 02:44:06 +01:00
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
2007-11-06 02:16:55 +01:00
PICFLAG = @PICFLAG@
2006-10-22 21:18:43 +00:00
CFLAGS = -g -I$( srcdir) /include -Iinclude -I$( srcdir) -I$( srcdir) /.. \
2008-12-23 04:18:31 +01:00
$( POPT_CFLAGS) $( TALLOC_CFLAGS) $( TDB_CFLAGS) $( TEVENT_CFLAGS) \
2009-01-15 18:05:45 -05:00
-DLIBDIR= \" $( libdir) \" -DSHLIBEXT= \" $( SHLIBEXT) \" -DUSE_MMAP= 1 \
-DLDB_MODULESDIR= \" $( LDB_MODULESDIR) \" \
@CFLAGS@
2004-04-11 01:26:22 +00:00
2007-11-16 08:35:48 +01:00
MDLD = @MDLD@
MDLD_FLAGS = @MDLD_FLAGS@
2008-12-23 04:18:31 +01:00
OBJS = $( MODULES_OBJ) $( COMMON_OBJ) $( LDB_TDB_OBJ) $( TDB_OBJ) $( TEVENT_OBJ) $( TALLOC_OBJ) $( POPT_OBJ) $( LDB_MAP_OBJ) @LIBREPLACEOBJ@ $( EXTRA_OBJ)
2004-03-31 06:45:39 +00:00
2009-02-23 17:35:49 -05:00
headers = $( srcdir) /include/ldb.h $( srcdir) /include/ldb_errors.h $( srcdir) /include/ldb_handlers.h $( srcdir) /include/ldb_module.h
2007-11-26 01:29:14 +01:00
2008-09-19 15:49:39 -04:00
BINS = bin/ldbadd bin/ldbsearch bin/ldbdel bin/ldbmodify bin/ldbedit bin/ldbrename bin/ldbtest
2004-03-31 06:45:39 +00:00
2006-01-11 16:20:16 +00:00
EXAMPLES = examples/ldbreader examples/ldifreader
2006-09-06 09:44:12 +00:00
DIRS = lib bin common ldb_tdb ldb_ldap ldb_sqlite3 modules tools examples
2006-08-22 01:32:29 +00:00
2006-11-15 14:31:47 +00:00
default : all
2008-02-11 23:51:59 +01:00
i n c l u d e $( ldbdir ) / r u l e s . m k
2008-02-11 22:14:31 +01:00
2006-11-15 14:31:47 +00:00
nss : nssdir all $( NSS_LIB )
2006-10-22 22:06:08 +00:00
nssdir :
@mkdir -p $( NSSDIR)
2007-11-06 16:42:11 +01:00
SONAME = libldb.$( SHLIBEXT) .0
2008-09-19 15:49:39 -04:00
SOLIB = libldb.$( SHLIBEXT) .$( PACKAGE_VERSION)
LIBSOLIB = lib/$( SOLIB)
2007-11-06 16:42:11 +01:00
STATICLIB = lib/libldb.a
2007-11-06 16:23:18 +01:00
2008-09-19 15:49:39 -04:00
lib/$(SONAME) : $( LIBSOLIB )
2007-11-28 00:25:47 +01:00
ln -fs libldb.$( SHLIBEXT) .$( PACKAGE_VERSION) $@
2007-11-25 02:58:12 +01:00
2008-12-23 05:34:21 +01:00
lib/libldb.$(SHLIBEXT) : $( LIBSOLIB ) lib /$( SONAME )
2007-11-28 00:25:47 +01:00
ln -fs libldb.$( SHLIBEXT) .$( PACKAGE_VERSION) $@
2007-11-25 02:58:12 +01:00
2008-09-19 15:49:39 -04:00
lib/libnss_ldb.$(SHLIBEXT).2 : $( NSS_OBJ ) $( LIBSOLIB )
$( SHLD) $( SHLD_FLAGS) -o $@ $( NSS_OBJ) $( LDFLAGS) $( LIBSOLIB) @SONAMEFLAG@libnss_ldb.$( SHLIBEXT) .2
2008-02-11 21:54:13 +01:00
2008-09-19 15:49:39 -04:00
$(LIBSOLIB) : $( OBJS )
2008-12-23 04:18:31 +01:00
$( SHLD) $( SHLD_FLAGS) -o $@ $( OBJS) $( LDFLAGS) $( LIBS) $( TALLOC_LIBS) $( TDB_LIBS) $( TEVENT_LIBS) $( LIBDL) $( LDAP_LIBS) @SONAMEFLAG@$( SONAME)
2008-09-19 15:49:39 -04:00
ln -sf libldb.$( SHLIBEXT) .$( PACKAGE_VERSION) lib/libldb.$( SHLIBEXT)
2007-11-06 16:23:18 +01:00
2008-09-19 15:49:39 -04:00
all : showflags dirs $( OBJS ) $( STATICLIB ) $( LIBSOLIB ) $( BINS ) $( EXAMPLES ) manpages \
2008-01-10 15:36:35 -06:00
@PYTHON_BUILD_TARGET@
2006-09-06 07:11:09 +00:00
2008-09-19 15:49:39 -04:00
shared-build : all
${ INSTALLCMD } -d $( sharedbuilddir) /lib
${ INSTALLCMD } -m 644 $( STATICLIB) $( sharedbuilddir) /lib
${ INSTALLCMD } -m 755 $( LIBSOLIB) $( sharedbuilddir) /lib
ln -sf $( SOLIB) $( sharedbuilddir) /lib/$( SONAME)
ln -sf $( SOLIB) $( sharedbuilddir) /lib/libldb.so
${ INSTALLCMD } -d $( sharedbuilddir) /include
${ INSTALLCMD } -m 644 $( srcdir) /include/ldb.h $( sharedbuilddir) /include
${ INSTALLCMD } -m 644 $( srcdir) /include/ldb_errors.h $( sharedbuilddir) /include
${ INSTALLCMD } -m 644 $( srcdir) /include/ldb_handlers.h $( sharedbuilddir) /include
2006-08-22 03:47:32 +00:00
dirs :
@mkdir -p $( DIRS)
2004-03-31 06:45:39 +00:00
2008-02-11 21:54:13 +01:00
manpages ::
2006-08-23 04:53:47 +00:00
@$( srcdir) /docs/builddocs.sh " $( XSLTPROC) " " $( srcdir) "
2005-05-30 15:59:08 +00:00
2008-02-11 21:54:13 +01:00
doxygen ::
2006-08-22 06:49:16 +00:00
test -z " $( DOXYGEN) " || ( cd $( srcdir) && " $( DOXYGEN) " )
2006-01-11 16:31:57 +00:00
2007-11-25 02:58:12 +01:00
clean ::
2007-11-06 05:11:16 +01:00
rm -f *.o */*.o *.gcov */*.gc?? tdbtest.ldb*
2008-09-19 15:49:39 -04:00
rm -f $( BINS) $( TDB_OBJ) $( TALLOC_OBJ) $( STATICLIB) $( NSS_LIB) $( LIBSOLIB)
2007-11-25 02:58:12 +01:00
rm -f $( POPT_OBJ)
2006-08-23 00:42:33 +00:00
rm -f man/*.1 man/*.3 man/*.html
2006-01-11 16:20:16 +00:00
rm -f $( EXAMPLES)
2006-01-11 16:31:57 +00:00
rm -rf apidocs/
2006-09-06 09:44:12 +00:00
rm -rf tests/schema/
2004-03-31 06:45:39 +00:00
2007-11-25 02:58:12 +01:00
distclean :: clean
2006-09-06 09:44:12 +00:00
rm -rf bin lib
2006-09-14 20:08:21 +00:00
rm -f config.log config.status config.cache include/config.h
2006-01-11 16:04:28 +00:00
rm -f ldb.pc
2005-06-09 17:33:30 +00:00
rm -f Makefile
2007-11-25 02:58:12 +01:00
realdistclean :: distclean
2008-03-18 14:31:49 +01:00
rm -f configure include/config.h.in
2006-09-06 09:44:12 +00:00
2008-02-12 00:49:36 +01:00
check :: test @PYTHON_CHECK_TARGET @
2007-11-05 21:57:33 +01:00
2008-02-20 01:37:53 +01:00
check-soloading : sample .$( SHLIBEXT )
2009-09-11 23:49:36 +02:00
$( LIB_PATH_VAR) = lib LDB_MODULES_PATH = $( builddir) $( srcdir) /tests/test-soloading.sh
2007-11-05 21:57:33 +01:00
2008-02-11 22:14:31 +01:00
test :: all check -soloading
2009-09-11 23:49:36 +02:00
for t in $( TESTS) ; do echo STARTING $$ { t} ; $( LIB_PATH_VAR) = lib $( srcdir) /tests/$$ { t} || exit 1; done
2006-08-22 04:34:06 +00:00
2008-02-11 22:14:31 +01:00
valgrindtest :: all
2006-09-13 00:11:07 +00:00
for t in $( TESTS) ; do echo STARTING $$ { t} ; VALGRIND = "valgrind -q --db-attach=yes --num-callers=30" $( srcdir) /tests/$$ { t} || exit 1; done
2008-02-11 21:54:13 +01:00
installcheck :: install test
2005-01-02 07:49:29 +00:00
2008-01-22 17:34:44 +01:00
install :: all installdirs installheaders installlibs installbin installdocs \
2008-01-10 15:36:35 -06:00
@PYTHON_INSTALL_TARGET@
2008-02-11 21:54:13 +01:00
installdirs ::
2007-11-25 18:49:37 +01:00
mkdir -p $( DESTDIR) $( includedir) $( DESTDIR) $( libdir) $( DESTDIR) $( bindir) $( DESTDIR) $( libdir) /pkgconfig
2008-01-10 15:36:35 -06:00
2008-02-11 21:54:13 +01:00
installheaders :: installdirs
2007-11-26 01:29:14 +01:00
cp $( headers) $( DESTDIR) $( includedir)
2008-01-10 15:36:35 -06:00
2008-02-11 21:54:13 +01:00
installlibs :: installdirs
2008-09-19 15:49:39 -04:00
cp $( STATICLIB) $( LIBSOLIB) $( DESTDIR) $( libdir)
2007-05-05 20:41:21 +00:00
cp ldb.pc $( DESTDIR) $( libdir) /pkgconfig
2008-01-10 15:36:35 -06:00
2008-02-11 21:54:13 +01:00
installbin :: installdirs
2008-01-10 15:36:35 -06:00
cp $( BINS) $( DESTDIR) $( bindir)
2008-02-11 21:54:13 +01:00
installdocs :: installdirs
2007-05-05 20:41:21 +00:00
$( srcdir) /docs/installdocs.sh $( DESTDIR) $( mandir)
2005-04-26 10:58:54 +00:00
2008-02-11 21:54:13 +01:00
gcov ::
2006-08-22 01:32:29 +00:00
$( GCOV) -po ldb_sqlite3 $( srcdir) /ldb_sqlite3/*.c 2| tee ldb_sqlite3.report.gcov
$( GCOV) -po ldb_ldap $( srcdir) /ldb_ldap/*.c 2| tee ldb_ldap.report.gcov
$( GCOV) -po ldb_tdb $( srcdir) /ldb_tdb/*.c 2| tee ldb_tdb.report.gcov
$( GCOV) -po common $( srcdir) /common/*.c 2| tee common.report.gcov
$( GCOV) -po modules $( srcdir) /modules/*.c 2| tee modules.report.gcov
$( GCOV) -po tools $( srcdir) /tools/*.c 2| tee tools.report.gcov
2006-01-22 08:33:32 +00:00
2008-02-11 23:51:59 +01:00
i n c l u d e $( ldbdir ) / l d b . m k