8 exec_prefix = @
exec_prefix@
9 datarootdir
= @datarootdir@
10 includedir = @
includedir@
14 VPATH
= @
srcdir@
:@tdbdir@
:@tallocdir@
:@libreplacedir@
:@poptdir@
19 TESTS
=test-tdb.sh @TESTS@
21 CFLAGS
=-g
-I
$(srcdir)/include -Iinclude
-I
$(srcdir) -I
$(srcdir)/.. \
22 @POPT_CFLAGS@
-I@tallocdir@
-I@tdbdir@
/include -I@libreplacedir@ \
23 -DLIBDIR
=\"$(libdir)\" -DSHLIBEXT
=\"@SHLIBEXT@
\" -DUSE_MMAP
=1 @CFLAGS@
25 LIB_FLAGS
=@LDFLAGS@
-Llib
-lldb @LIBS@ @POPT_LIBS@
28 LDB_TDB_OBJ
=$(LDB_TDB_DIR
)/ldb_tdb.o \
29 $(LDB_TDB_DIR
)/ldb_pack.o
$(LDB_TDB_DIR
)/ldb_search.o
$(LDB_TDB_DIR
)/ldb_index.o \
30 $(LDB_TDB_DIR
)/ldb_cache.o
$(LDB_TDB_DIR
)/ldb_tdb_wrap.o
33 COMMON_OBJ
=$(COMDIR
)/ldb.o
$(COMDIR
)/ldb_ldif.o \
34 $(COMDIR
)/ldb_parse.o
$(COMDIR
)/ldb_msg.o
$(COMDIR
)/ldb_utf8.o \
35 $(COMDIR
)/ldb_debug.o
$(COMDIR
)/ldb_modules.o \
36 $(COMDIR
)/ldb_dn.o
$(COMDIR
)/ldb_match.o
$(COMDIR
)/ldb_attributes.o \
37 $(COMDIR
)/attrib_handlers.o
$(COMDIR
)/ldb_controls.o
$(COMDIR
)/qsort.o
40 MODULES_OBJ
=$(MODDIR
)/operational.o
$(MODDIR
)/rdn_name.o \
41 $(MODDIR
)/objectclass.o \
42 $(MODDIR
)/paged_results.o
$(MODDIR
)/sort.o
$(MODDIR
)/asq.o
45 NSS_OBJ
= $(NSSDIR
)/ldb-nss.o
$(NSSDIR
)/ldb-pwd.o
$(NSSDIR
)/ldb-grp.o
46 NSS_LIB
= lib
/libnss_ldb.so
.2
48 OBJS
= $(MODULES_OBJ
) $(COMMON_OBJ
) $(LDB_TDB_OBJ
) @TDBOBJ@ @TALLOCOBJ@ @POPTOBJ@ @LIBREPLACEOBJ@
$(EXTRA_OBJ
)
50 LDB_LIB
= lib
/libldb.a
52 BINS
= bin
/ldbadd bin
/ldbsearch bin
/ldbdel bin
/ldbmodify bin
/ldbedit bin
/ldbrename bin
/ldbtest bin
/oLschema2ldif
56 EXAMPLES
= examples
/ldbreader examples
/ldifreader
58 DIRS
= lib bin common ldb_tdb ldb_ldap ldb_sqlite3 modules tools examples
62 nss
: nssdir
all $(NSS_LIB
)
67 all: showflags dirs
$(OBJS
) $(LDB_LIB
) $(BINS
) $(EXAMPLES
) manpages
70 @echo
'ldb will be compiled with flags:'
71 @echo
' CFLAGS = $(CFLAGS)'
72 @echo
' LIBS = $(LIBS)'
76 @mkdir
-p
`dirname $@`
77 @
$(CC
) $(CFLAGS
) -c
$< -o
$@
86 lib
/libnss_ldb.so
.2: $(NSS_OBJ
) $(LIBS
)
87 $(CC
) -shared
-Wl
,-soname
,libnss_ldb.so
.2 -o lib
/libnss_ldb.so
.2 $(NSS_OBJ
) $(OBJS
) $(LIB_FLAGS
)
89 bin
/ldbadd
: tools
/ldbadd.o tools
/cmdline.o
$(LIBS
)
90 $(CC
) -o bin
/ldbadd tools
/ldbadd.o tools
/cmdline.o
$(LIB_FLAGS
)
92 bin
/ldbsearch
: tools
/ldbsearch.o tools
/cmdline.o
$(LIBS
)
93 $(CC
) -o bin
/ldbsearch tools
/ldbsearch.o tools
/cmdline.o
$(LIB_FLAGS
)
95 bin
/ldbdel
: tools
/ldbdel.o tools
/cmdline.o
$(LIBS
)
96 $(CC
) -o bin
/ldbdel tools
/ldbdel.o tools
/cmdline.o
$(LIB_FLAGS
)
98 bin
/ldbmodify
: tools
/ldbmodify.o tools
/cmdline.o
$(LIBS
)
99 $(CC
) -o bin
/ldbmodify tools
/ldbmodify.o tools
/cmdline.o
$(LIB_FLAGS
)
101 bin
/ldbedit
: tools
/ldbedit.o tools
/cmdline.o
$(LIBS
)
102 $(CC
) -o bin
/ldbedit tools
/ldbedit.o tools
/cmdline.o
$(LIB_FLAGS
)
104 bin
/ldbrename
: tools
/ldbrename.o tools
/cmdline.o
$(LIBS
)
105 $(CC
) -o bin
/ldbrename tools
/ldbrename.o tools
/cmdline.o
$(LIB_FLAGS
)
107 bin
/ldbtest
: tools
/ldbtest.o tools
/cmdline.o
$(LIBS
)
108 $(CC
) -o bin
/ldbtest tools
/ldbtest.o tools
/cmdline.o
$(LIB_FLAGS
)
110 bin
/oLschema2ldif
: tools
/oLschema2ldif.o tools
/cmdline.o tools
/convert.o
$(LIBS
)
111 $(CC
) -o bin
/oLschema2ldif tools
/oLschema2ldif.o tools
/cmdline.o tools
/convert.o
$(LIB_FLAGS
)
113 examples
/ldbreader
: examples
/ldbreader.o
$(LIBS
)
114 $(CC
) -o examples
/ldbreader examples
/ldbreader.o
$(LIB_FLAGS
)
116 examples
/ldifreader
: examples
/ldifreader.o
$(LIBS
)
117 $(CC
) -o examples
/ldifreader examples
/ldifreader.o
$(LIB_FLAGS
)
119 .SUFFIXES
: .1 .1.xml
.3 .3.xml .xml .html
122 @
$(srcdir)/docs
/builddocs.sh
"$(XSLTPROC)" "$(srcdir)"
125 test -z
"$(DOXYGEN)" ||
(cd
$(srcdir) && "$(DOXYGEN)")
128 rm -f
*.o
*/*.o
*.gcov
*/*.gc?? tdbtest.ldb
*
129 rm -f
$(BINS
) $(TDB_OBJ
) $(TALLOC_OBJ
) $(LDB_LIB
) $(NSS_LIB
)
130 rm -f man
/*.1 man
/*.3 man
/*.html
138 rm -f config.log config.status config.cache
include/config.h
142 realdistclean
: distclean
143 rm -f configure.in
include/config.h.in
146 for t in
$(TESTS
); do echo STARTING
$${t}; $(srcdir)/tests
/$${t} || exit
1; done
149 for t in
$(TESTS
); do echo STARTING
$${t}; VALGRIND
="valgrind -q --db-attach=yes --num-callers=30" $(srcdir)/tests
/$${t} || exit
1; done
151 installcheck: install test
154 mkdir
-p
$(includedir) $(libdir)/pkgconfig
$(libdir) $(bindir)
155 cp
$(srcdir)/include/ldb.h
$(srcdir)/include/ldb_errors.h
$(includedir)
156 cp
$(LDB_LIB
) $(libdir)
158 cp ldb.
pc $(libdir)/pkgconfig
159 $(srcdir)/docs
/installdocs.sh
$(mandir)
162 $(GCOV
) -po ldb_sqlite3
$(srcdir)/ldb_sqlite3
/*.c
2| tee ldb_sqlite3.report.gcov
163 $(GCOV
) -po ldb_ldap
$(srcdir)/ldb_ldap
/*.c
2| tee ldb_ldap.report.gcov
164 $(GCOV
) -po ldb_tdb
$(srcdir)/ldb_tdb
/*.c
2| tee ldb_tdb.report.gcov
165 $(GCOV
) -po common
$(srcdir)/common
/*.c
2| tee common.report.gcov
166 $(GCOV
) -po modules
$(srcdir)/modules
/*.c
2| tee modules.report.gcov
167 $(GCOV
) -po tools
$(srcdir)/tools
/*.c
2| tee tools.report.gcov
170 etags
`find $(srcdir) -name "*.[ch]"`
173 ctags
`find $(srcdir) -name "*.[ch]"`