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@
includedir = @includedir@
libdir = @libdir@
bindir = @bindir@
2006-02-23 09:55:50 +00:00
mandir = @mandir@
2006-08-22 05:27:33 +00:00
VPATH = @srcdir@:@srcdir@/..:@POPTDIR@
2006-08-22 01:32:29 +00:00
srcdir = @srcdir@
builddir = @builddir@
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@
2004-04-11 01:26:22 +00:00
2006-08-22 10:46:23 +00:00
CFLAGS = -I$( srcdir) /include -Iinclude -I$( srcdir) -I$( srcdir) /.. \
2006-08-22 22:27:57 +00:00
-I$( srcdir) /../tdb/include -I$( srcdir) /../tdb -I$( srcdir) /../talloc \
-DLIBDIR= \" $( libdir) \" -DSHLIBEXT= \" @SHLIBEXT@\" -DUSE_MMAP= 1 @CFLAGS@
2004-04-11 01:26:22 +00:00
2006-08-22 10:46:23 +00:00
LIB_FLAGS = -Llib -lldb @LIBS@
2004-03-31 06:45:39 +00:00
2006-08-23 04:53:47 +00:00
REPDIR = replace
REPLACE_OBJ = $( REPDIR) /replace.o $( REPDIR) /timegm.o
2006-08-22 01:32:29 +00:00
TDBDIR = tdb
2005-09-18 10:45:03 +00:00
TDB_OBJ = $( TDBDIR) /common/tdb.o $( TDBDIR) /common/dump.o \
$( TDBDIR) /common/io.o $( TDBDIR) /common/lock.o \
$( TDBDIR) /common/open.o $( TDBDIR) /common/traverse.o \
2005-09-22 03:56:41 +00:00
$( TDBDIR) /common/freelist.o $( TDBDIR) /common/error.o \
$( TDBDIR) /common/transaction.o
2006-08-22 01:32:29 +00:00
TALLOCDIR = talloc
2005-01-02 07:49:29 +00:00
TALLOC_OBJ = $( TALLOCDIR) /talloc.o
2004-03-31 06:45:39 +00:00
2006-08-22 01:32:29 +00:00
LDB_TDB_DIR = ldb_tdb
LDB_TDB_OBJ = $( LDB_TDB_DIR) /ldb_tdb.o \
$( LDB_TDB_DIR) /ldb_pack.o $( LDB_TDB_DIR) /ldb_search.o $( LDB_TDB_DIR) /ldb_index.o \
$( LDB_TDB_DIR) /ldb_cache.o $( LDB_TDB_DIR) /ldb_tdb_wrap.o
2004-03-31 06:45:39 +00:00
2006-08-22 01:32:29 +00:00
COMDIR = common
COMMON_OBJ = $( COMDIR) /ldb.o $( COMDIR) /ldb_ldif.o \
$( COMDIR) /ldb_parse.o $( COMDIR) /ldb_msg.o $( COMDIR) /ldb_utf8.o \
$( COMDIR) /ldb_debug.o $( COMDIR) /ldb_modules.o \
$( COMDIR) /ldb_dn.o $( COMDIR) /ldb_match.o $( COMDIR) /ldb_attributes.o \
$( COMDIR) /attrib_handlers.o $( COMDIR) /ldb_controls.o $( COMDIR) /qsort.o
2004-03-31 06:45:39 +00:00
2006-08-22 01:32:29 +00:00
MODDIR = modules
MODULES_OBJ = $( MODDIR) /operational.o $( MODDIR) /schema.o $( MODDIR) /rdn_name.o \
$( MODDIR) /objectclass.o \
$( MODDIR) /paged_results.o $( MODDIR) /sort.o $( MODDIR) /asq.o
2004-11-15 11:40:27 +00:00
2006-08-23 04:53:47 +00:00
OBJS = $( MODULES_OBJ) $( COMMON_OBJ) $( LDB_TDB_OBJ) $( TDB_OBJ) $( TALLOC_OBJ) $( EXTRA_OBJ) $( REPLACE_OBJ)
2004-03-31 06:45:39 +00:00
LDB_LIB = lib/libldb.a
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-08-23 11:21:44 +00:00
LIBS = $( LDB_LIB)
2004-03-31 06:45:39 +00:00
2006-01-11 16:20:16 +00:00
EXAMPLES = examples/ldbreader examples/ldifreader
2006-08-23 04:53:47 +00:00
DIRS = lib bin common replace ldb_tdb ldb_ldap ldb_sqlite3 modules tools examples tdb talloc
2006-08-22 01:32:29 +00:00
2006-08-23 11:21:44 +00:00
all : dirs $( OBJS ) $( LDB_LIB ) $( BINS ) $( EXAMPLES ) manpages
2004-03-31 06:51:44 +00:00
2005-06-13 12:37:37 +00:00
.c.o :
@echo Compiling $* .c
2006-08-22 01:32:29 +00:00
@mkdir -p ` dirname $@ `
2005-06-13 12:37:37 +00:00
@$( CC) $( CFLAGS) -c $< -o $@
2006-08-22 03:47:32 +00:00
dirs :
@mkdir -p $( DIRS)
2004-03-31 06:45:39 +00:00
lib/libldb.a : $( OBJS )
2006-08-23 11:21:44 +00:00
ar -rv $@ $( OBJS)
@-ranlib $@
2004-03-31 06:45:39 +00:00
2005-06-18 07:42:21 +00:00
bin/ldbadd : tools /ldbadd .o tools /cmdline .o $( LIBS )
$( CC) -o bin/ldbadd tools/ldbadd.o tools/cmdline.o $( LIB_FLAGS)
2004-03-31 06:45:39 +00:00
2005-06-18 07:42:21 +00:00
bin/ldbsearch : tools /ldbsearch .o tools /cmdline .o $( LIBS )
$( CC) -o bin/ldbsearch tools/ldbsearch.o tools/cmdline.o $( LIB_FLAGS)
2004-03-31 06:45:39 +00:00
2005-06-18 07:42:21 +00:00
bin/ldbdel : tools /ldbdel .o tools /cmdline .o $( LIBS )
$( CC) -o bin/ldbdel tools/ldbdel.o tools/cmdline.o $( LIB_FLAGS)
2004-03-31 06:45:39 +00:00
2005-06-18 07:42:21 +00:00
bin/ldbmodify : tools /ldbmodify .o tools /cmdline .o $( LIBS )
$( CC) -o bin/ldbmodify tools/ldbmodify.o tools/cmdline.o $( LIB_FLAGS)
2004-04-03 12:29:21 +00:00
2005-06-18 07:42:21 +00:00
bin/ldbedit : tools /ldbedit .o tools /cmdline .o $( LIBS )
$( CC) -o bin/ldbedit tools/ldbedit.o tools/cmdline.o $( LIB_FLAGS)
2004-04-10 20:18:22 +00:00
2005-06-18 07:42:21 +00:00
bin/ldbrename : tools /ldbrename .o tools /cmdline .o $( LIBS )
$( CC) -o bin/ldbrename tools/ldbrename.o tools/cmdline.o $( LIB_FLAGS)
2004-10-20 19:28:02 +00:00
2005-06-18 07:42:21 +00:00
bin/ldbtest : tools /ldbtest .o tools /cmdline .o $( LIBS )
$( CC) -o bin/ldbtest tools/ldbtest.o tools/cmdline.o $( LIB_FLAGS)
2004-05-02 10:06:45 +00:00
2006-08-17 08:55:09 +00:00
bin/oLschema2ldif : tools /oLschema 2ldif .o tools /cmdline .o tools /convert .o $( LIBS )
2006-08-17 08:31:19 +00:00
$( CC) -o bin/oLschema2ldif tools/oLschema2ldif.o tools/cmdline.o tools/convert.o $( LIB_FLAGS)
2005-08-21 14:26:03 +00:00
2006-01-11 16:20:16 +00:00
examples/ldbreader : examples /ldbreader .o $( LIBS )
$( CC) -o examples/ldbreader examples/ldbreader.o $( LIB_FLAGS)
2006-08-22 04:19:40 +00:00
2006-01-11 16:20:16 +00:00
examples/ldifreader : examples /ldifreader .o $( LIBS )
$( CC) -o examples/ldifreader examples/ldifreader.o $( LIB_FLAGS)
2006-01-11 16:04:28 +00:00
.SUFFIXES : .1 .1.xml .3 .3.xml .xml .html
2005-04-23 04:30:58 +00:00
2006-08-23 00:42:33 +00:00
manpages :
2006-08-23 04:53:47 +00:00
@$( srcdir) /docs/builddocs.sh " $( XSLTPROC) " " $( srcdir) "
2005-05-30 15:59:08 +00:00
2006-01-11 16:31:57 +00:00
doxygen :
2006-08-22 06:49:16 +00:00
test -z " $( DOXYGEN) " || ( cd $( srcdir) && " $( DOXYGEN) " )
2006-01-11 16:31:57 +00:00
2004-03-31 06:45:39 +00:00
clean :
2006-01-11 16:04:28 +00:00
rm -f */*.o *.gcov */*.gc?? tdbtest.ldb* \
rm -f $( BINS) $( TDB_OBJ) $( TALLOC_OBJ) $( LDB_LIB)
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/
2004-03-31 06:45:39 +00:00
2006-01-11 16:04:28 +00:00
distclean : clean
rm -f *~ */*~
2005-06-09 17:33:30 +00:00
rm -rf autom4te.cache bin lib
2006-01-11 16:04:28 +00:00
rm -f configure \
config.log config.status \
include/config.h include/config.h.in \
rm -f ldb.pc
2005-06-09 17:33:30 +00:00
rm -f Makefile
2006-08-23 11:27:40 +00:00
test : all
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
2006-08-23 11:27:40 +00:00
installcheck : install test
2005-01-02 07:49:29 +00:00
2005-04-26 10:58:54 +00:00
install : all
2006-08-22 03:57:31 +00:00
mkdir -p $( includedir) $( libdir) /pkgconfig $( libdir) $( bindir)
2006-08-22 04:19:40 +00:00
cp $( srcdir) /include/ldb.h $( srcdir) /include/ldb_errors.h $( includedir)
2005-04-26 10:58:54 +00:00
cp $( LDB_LIB) $( libdir)
cp $( BINS) $( bindir)
cp ldb.pc $( libdir) /pkgconfig
2006-08-23 00:42:33 +00:00
$( srcdir) /docs/installdocs.sh $( mandir)
2005-04-26 10:58:54 +00:00
2005-01-02 07:49:29 +00: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
2006-08-23 00:42:33 +00:00
etags :
etags ` find $( srcdir) -name "*.[ch]" `
2006-01-22 08:33:32 +00:00
ctags :
ctags ` find $( srcdir) -name "*.[ch]" `