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-06-15 19:16:35 +02:00
VPATH = @srcdir@:@tdbdir@:@tallocdir@:@libreplacedir@:@poptdir@:@eventsdir@
2006-08-22 01:32:29 +00:00
srcdir = @srcdir@
builddir = @builddir@
2006-08-22 04:19:40 +00:00
SLAPD = @SLAPD@
2007-11-27 23:28:23 +01:00
SWIG = swig
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 22:14:31 +01:00
tdbdir = @tdbdir@
2008-02-11 23:51:59 +01:00
ldbdir = $( srcdir)
2008-02-11 22:14:31 +01:00
tallocdir = @tallocdir@
2004-04-11 01:26:22 +00:00
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-06-15 19:16:35 +02:00
EVENTS_CFLAGS = @EVENTS_CFLAGS@
EVENTS_OBJ = @EVENTS_OBJ@
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-06-15 19:16:35 +02:00
$( POPT_CFLAGS) $( TALLOC_CFLAGS) $( TDB_CFLAGS) $( EVENTS_CFLAGS) \
2007-11-05 21:57:33 +01:00
-DLIBDIR= \" $( libdir) \" -DSHLIBEXT= \" $( SHLIBEXT) \" -DUSE_MMAP= 1 @CFLAGS@
2004-04-11 01:26:22 +00:00
2007-11-16 08:35:48 +01:00
MDLD = @MDLD@
MDLD_FLAGS = @MDLD_FLAGS@
2008-06-15 19:16:35 +02:00
OBJS = $( MODULES_OBJ) $( COMMON_OBJ) $( LDB_TDB_OBJ) $( TDB_OBJ) $( EVENTS_OBJ) $( TALLOC_OBJ) $( POPT_OBJ) $( LDB_MAP_OBJ) @LIBREPLACEOBJ@ $( EXTRA_OBJ)
2004-03-31 06:45:39 +00:00
2007-11-26 01:29:14 +01:00
headers = $( srcdir) /include/ldb.h $( srcdir) /include/ldb_errors.h $( srcdir) /include/ldb_handlers.h
2005-08-21 14:26:03 +00:00
BINS = bin/ldbadd bin/ldbsearch bin/ldbdel bin/ldbmodify bin/ldbedit bin/ldbrename bin/ldbtest bin/oLschema2ldif
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
2007-11-28 00:25:47 +01:00
SOLIB = lib/libldb.$( SHLIBEXT) .$( PACKAGE_VERSION)
2007-11-06 16:42:11 +01:00
STATICLIB = lib/libldb.a
2007-11-06 16:23:18 +01:00
2007-11-25 02:58:12 +01:00
lib/$(SONAME) : $( SOLIB )
2007-11-28 00:25:47 +01:00
ln -fs libldb.$( SHLIBEXT) .$( PACKAGE_VERSION) $@
2007-11-25 02:58:12 +01:00
lib/libldb.$(SHLIBEXT) : $( SOLIB )
2007-11-28 00:25:47 +01:00
ln -fs libldb.$( SHLIBEXT) .$( PACKAGE_VERSION) $@
2007-11-25 02:58:12 +01:00
2008-02-11 21:54:13 +01:00
lib/libnss_ldb.$(SHLIBEXT).2 : $( NSS_OBJ ) $( SOLIB )
$( SHLD) $( SHLD_FLAGS) -o $@ $( NSS_OBJ) $( LDFLAGS) $( SOLIB) @SONAMEFLAG@libnss_ldb.$( SHLIBEXT) .2
2007-11-06 16:23:18 +01:00
$(SOLIB) : $( OBJS )
2007-11-27 23:49:42 +01:00
$( SHLD) $( SHLD_FLAGS) -o $@ $( OBJS) $( LDFLAGS) $( LIBS) $( TALLOC_LIBS) $( TDB_LIBS) $( LIBDL) $( LDAP_LIBS) @SONAMEFLAG@$( SONAME)
2007-11-06 16:23:18 +01:00
2008-01-10 15:36:35 -06:00
all : showflags dirs $( OBJS ) $( STATICLIB ) $( SOLIB ) $( BINS ) $( EXAMPLES ) manpages \
@PYTHON_BUILD_TARGET@
2006-09-06 07:11:09 +00:00
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*
2007-11-06 16:42:11 +01:00
rm -f $( BINS) $( TDB_OBJ) $( TALLOC_OBJ) $( STATICLIB) $( NSS_LIB) $( SOLIB)
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 )
2007-11-05 21:57:33 +01:00
LDB_MODULES_PATH = $( builddir) $( srcdir) /tests/test-soloading.sh
2008-02-11 22:14:31 +01:00
test :: all check -soloading
2006-08-22 10:46:23 +00:00
for t in $( TESTS) ; do echo STARTING $$ { t} ; $( 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
2007-11-06 16:42:11 +01:00
cp $( STATICLIB) $( SOLIB) $( 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