Fix denial of service - memory corruption.
[Samba.git] / source3 / lib / ldb / Makefile.in
bloba091b4832ebe87f83f652076a7dfe390e73df7a5
1 #!gmake
3 CC = @CC@
4 GCOV = @GCOV@
5 XSLTPROC = @XSLTPROC@
6 DOXYGEN = @DOXYGEN@
7 prefix = @prefix@
8 exec_prefix = @exec_prefix@
9 datarootdir = @datarootdir@
10 includedir = @includedir@
11 libdir = @libdir@
12 bindir = @bindir@
13 mandir = @mandir@
14 VPATH = @srcdir@:@tdbdir@:@tallocdir@:@libreplacedir@:@poptdir@
15 srcdir = @srcdir@
16 builddir = @builddir@
17 SLAPD = @SLAPD@
18 EXTRA_OBJ=@EXTRA_OBJ@
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@
27 LDB_TDB_DIR=ldb_tdb
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
32 COMDIR=common
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
39 MODDIR=modules
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
44 NSSDIR=nssldb
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
54 LIBS = $(LDB_LIB)
56 EXAMPLES = examples/ldbreader examples/ldifreader
58 DIRS = lib bin common ldb_tdb ldb_ldap ldb_sqlite3 modules tools examples
60 default: all
62 nss: nssdir all $(NSS_LIB)
64 nssdir:
65 @mkdir -p $(NSSDIR)
67 all: showflags dirs $(OBJS) $(LDB_LIB) $(BINS) $(EXAMPLES) manpages
69 showflags:
70 @echo 'ldb will be compiled with flags:'
71 @echo ' CFLAGS = $(CFLAGS)'
72 @echo ' LIBS = $(LIBS)'
74 .c.o:
75 @echo Compiling $*.c
76 @mkdir -p `dirname $@`
77 @$(CC) $(CFLAGS) -c $< -o $@
79 dirs:
80 @mkdir -p $(DIRS)
82 lib/libldb.a: $(OBJS)
83 ar -rv $@ $(OBJS)
84 @-ranlib $@
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
121 manpages:
122 @$(srcdir)/docs/builddocs.sh "$(XSLTPROC)" "$(srcdir)"
124 doxygen:
125 test -z "$(DOXYGEN)" || (cd $(srcdir) && "$(DOXYGEN)")
127 clean:
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
131 rm -f $(EXAMPLES)
132 rm -rf apidocs/
133 rm -rf tests/schema/
135 distclean: clean
136 rm -f *~ */*~
137 rm -rf bin lib
138 rm -f config.log config.status config.cache include/config.h
139 rm -f ldb.pc
140 rm -f Makefile
142 realdistclean: distclean
143 rm -f configure.in include/config.h.in
145 test: all
146 for t in $(TESTS); do echo STARTING $${t}; $(srcdir)/tests/$${t} || exit 1; done
148 valgrindtest: all
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
153 install: all
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)
157 cp $(BINS) $(bindir)
158 cp ldb.pc $(libdir)/pkgconfig
159 $(srcdir)/docs/installdocs.sh $(mandir)
161 gcov:
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
169 etags:
170 etags `find $(srcdir) -name "*.[ch]"`
172 ctags:
173 ctags `find $(srcdir) -name "*.[ch]"`