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=-I$(srcdir)/include -Iinclude -I$(srcdir) -I$(srcdir)/.. \
22 -I@poptdir@ -I@tallocdir@ -I@tdbdir@/include -I@libreplacedir@ \
23 -DLIBDIR=\"$(libdir)\" -DSHLIBEXT=\"@SHLIBEXT@\" -DUSE_MMAP=1 @CFLAGS@
25 LIB_FLAGS=-Llib -lldb @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)/schema.o $(MODDIR)/rdn_name.o \
41 $(MODDIR)/objectclass.o \
42 $(MODDIR)/paged_results.o $(MODDIR)/sort.o $(MODDIR)/asq.o
44 OBJS = $(MODULES_OBJ) $(COMMON_OBJ) $(LDB_TDB_OBJ) @TDBOBJ@ @TALLOCOBJ@ @POPTOBJ@ @LIBREPLACEOBJ@ $(EXTRA_OBJ)
46 LDB_LIB = lib/libldb.a
48 BINS = bin/ldbadd bin/ldbsearch bin/ldbdel bin/ldbmodify bin/ldbedit bin/ldbrename bin/ldbtest bin/oLschema2ldif
52 EXAMPLES = examples/ldbreader examples/ldifreader
54 DIRS = lib bin common ldb_tdb ldb_ldap ldb_sqlite3 modules tools examples tdb talloc
56 all: showflags dirs $(OBJS) $(LDB_LIB) $(BINS) $(EXAMPLES) manpages
59 @echo 'ldb will be compiled with flags:'
60 @echo ' CFLAGS = $(CFLAGS)'
61 @echo ' LIBS = $(LIBS)'
65 @mkdir -p `dirname $@`
66 @$(CC) $(CFLAGS) -c $< -o $@
75 bin/ldbadd: tools/ldbadd.o tools/cmdline.o $(LIBS)
76 $(CC) -o bin/ldbadd tools/ldbadd.o tools/cmdline.o $(LIB_FLAGS)
78 bin/ldbsearch: tools/ldbsearch.o tools/cmdline.o $(LIBS)
79 $(CC) -o bin/ldbsearch tools/ldbsearch.o tools/cmdline.o $(LIB_FLAGS)
81 bin/ldbdel: tools/ldbdel.o tools/cmdline.o $(LIBS)
82 $(CC) -o bin/ldbdel tools/ldbdel.o tools/cmdline.o $(LIB_FLAGS)
84 bin/ldbmodify: tools/ldbmodify.o tools/cmdline.o $(LIBS)
85 $(CC) -o bin/ldbmodify tools/ldbmodify.o tools/cmdline.o $(LIB_FLAGS)
87 bin/ldbedit: tools/ldbedit.o tools/cmdline.o $(LIBS)
88 $(CC) -o bin/ldbedit tools/ldbedit.o tools/cmdline.o $(LIB_FLAGS)
90 bin/ldbrename: tools/ldbrename.o tools/cmdline.o $(LIBS)
91 $(CC) -o bin/ldbrename tools/ldbrename.o tools/cmdline.o $(LIB_FLAGS)
93 bin/ldbtest: tools/ldbtest.o tools/cmdline.o $(LIBS)
94 $(CC) -o bin/ldbtest tools/ldbtest.o tools/cmdline.o $(LIB_FLAGS)
96 bin/oLschema2ldif: tools/oLschema2ldif.o tools/cmdline.o tools/convert.o $(LIBS)
97 $(CC) -o bin/oLschema2ldif tools/oLschema2ldif.o tools/cmdline.o tools/convert.o $(LIB_FLAGS)
99 examples/ldbreader: examples/ldbreader.o $(LIBS)
100 $(CC) -o examples/ldbreader examples/ldbreader.o $(LIB_FLAGS)
102 examples/ldifreader: examples/ldifreader.o $(LIBS)
103 $(CC) -o examples/ldifreader examples/ldifreader.o $(LIB_FLAGS)
105 .SUFFIXES: .1 .1.xml .3 .3.xml .xml .html
108 @$(srcdir)/docs/builddocs.sh "$(XSLTPROC)" "$(srcdir)"
111 test -z "$(DOXYGEN)" || (cd $(srcdir) && "$(DOXYGEN)")
114 rm -f */*.o *.gcov */*.gc?? tdbtest.ldb* \
115 rm -f $(BINS) $(TDB_OBJ) $(TALLOC_OBJ) $(LDB_LIB)
116 rm -f man/*.1 man/*.3 man/*.html
122 rm -rf autom4te.cache bin lib
124 config.log config.status \
125 include/config.h include/config.h.in \
130 for t in $(TESTS); do echo STARTING $${t}; $(srcdir)/tests/$${t} || exit 1; done
132 installcheck: install test
135 mkdir -p $(includedir) $(libdir)/pkgconfig $(libdir) $(bindir)
136 cp $(srcdir)/include/ldb.h $(srcdir)/include/ldb_errors.h $(includedir)
137 cp $(LDB_LIB) $(libdir)
139 cp ldb.pc $(libdir)/pkgconfig
140 $(srcdir)/docs/installdocs.sh $(mandir)
143 $(GCOV) -po ldb_sqlite3 $(srcdir)/ldb_sqlite3/*.c 2| tee ldb_sqlite3.report.gcov
144 $(GCOV) -po ldb_ldap $(srcdir)/ldb_ldap/*.c 2| tee ldb_ldap.report.gcov
145 $(GCOV) -po ldb_tdb $(srcdir)/ldb_tdb/*.c 2| tee ldb_tdb.report.gcov
146 $(GCOV) -po common $(srcdir)/common/*.c 2| tee common.report.gcov
147 $(GCOV) -po modules $(srcdir)/modules/*.c 2| tee modules.report.gcov
148 $(GCOV) -po tools $(srcdir)/tools/*.c 2| tee tools.report.gcov
151 etags `find $(srcdir) -name "*.[ch]"`
154 ctags `find $(srcdir) -name "*.[ch]"`
157 cd @REPLACE_DIR@ && ./autogen.sh && ./configure
158 $(MAKE) -C @REPLACE_DIR@