WHATSNEW: Update changes since 3.4.9.
[Samba.git] / source4 / lib / ldb / Makefile.in
blob663dea9f807d5481692d229c0b15628fa180619c
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@:@libreplacedir@
15 srcdir = @srcdir@
16 builddir = @builddir@
17 sharedbuilddir = @sharedbuilddir@
18 INSTALLCMD = @INSTALL@
19 SLAPD = @SLAPD@
20 EXTRA_OBJ=@EXTRA_OBJ@
21 TESTS=test-tdb.sh @TESTS@
22 PACKAGE_VERSION = @PACKAGE_VERSION@
23 PYTHON = @PYTHON@
24 PYTHON_CONFIG = @PYTHON_CONFIG@
25 ldbdir = $(srcdir)
27 LDB_MODULESDIR = @LDB_MODULESDIR@
29 TALLOC_LIBS = @TALLOC_LIBS@
30 TALLOC_CFLAGS = @TALLOC_CFLAGS@
31 TALLOC_OBJ = @TALLOC_OBJ@
33 TDB_LIBS = @TDB_LIBS@
34 TDB_CFLAGS = @TDB_CFLAGS@
35 TDB_OBJ = @TDB_OBJ@
37 TEVENT_LIBS = @TEVENT_LIBS@
38 TEVENT_CFLAGS = @TEVENT_CFLAGS@
39 TEVENT_OBJ = @TEVENT_OBJ@
41 POPT_LIBS = @POPT_LIBS@
42 POPT_CFLAGS = @POPT_CFLAGS@
43 POPT_OBJ = @POPT_OBJ@
45 LDAP_LIBS = @LDAP_LIBS@
47 LIBDL = @LIBDL@
49 SHLIBEXT = @SHLIBEXT@
51 LD_EXPORT_DYNAMIC = @LD_EXPORT_DYNAMIC@
52 SHLD = @SHLD@
53 SHLD_FLAGS = @SHLD_FLAGS@
55 LDFLAGS = @LDFLAGS@
56 LIBS = @LIBS@
58 PICFLAG = @PICFLAG@
59 CFLAGS=-g -I$(srcdir)/include -Iinclude -I$(srcdir) -I$(srcdir)/.. \
60 $(POPT_CFLAGS) $(TALLOC_CFLAGS) $(TDB_CFLAGS) $(TEVENT_CFLAGS) \
61 -DLIBDIR=\"$(libdir)\" -DSHLIBEXT=\"$(SHLIBEXT)\" -DUSE_MMAP=1 \
62 -DLDB_MODULESDIR=\"$(LDB_MODULESDIR)\" \
63 @CFLAGS@
65 MDLD = @MDLD@
66 MDLD_FLAGS = @MDLD_FLAGS@
68 OBJS = $(MODULES_OBJ) $(COMMON_OBJ) $(LDB_TDB_OBJ) $(TDB_OBJ) $(TEVENT_OBJ) $(TALLOC_OBJ) $(POPT_OBJ) $(LDB_MAP_OBJ) @LIBREPLACEOBJ@ $(EXTRA_OBJ)
70 headers = $(srcdir)/include/ldb.h $(srcdir)/include/ldb_errors.h $(srcdir)/include/ldb_handlers.h $(srcdir)/include/ldb_module.h
72 BINS = bin/ldbadd bin/ldbsearch bin/ldbdel bin/ldbmodify bin/ldbedit bin/ldbrename bin/ldbtest
74 EXAMPLES = examples/ldbreader examples/ldifreader
76 DIRS = lib bin common ldb_tdb ldb_ldap ldb_sqlite3 modules tools examples
78 default: all
80 include $(ldbdir)/rules.mk
82 nss: nssdir all $(NSS_LIB)
84 nssdir:
85 @mkdir -p $(NSSDIR)
87 SONAME = libldb.$(SHLIBEXT).0
88 SOLIB = libldb.$(SHLIBEXT).$(PACKAGE_VERSION)
89 LIBSOLIB = lib/$(SOLIB)
90 STATICLIB = lib/libldb.a
92 lib/$(SONAME): $(LIBSOLIB)
93 ln -fs libldb.$(SHLIBEXT).$(PACKAGE_VERSION) $@
95 lib/libldb.$(SHLIBEXT): $(LIBSOLIB) lib/$(SONAME)
96 ln -fs libldb.$(SHLIBEXT).$(PACKAGE_VERSION) $@
98 lib/libnss_ldb.$(SHLIBEXT).2: $(NSS_OBJ) $(LIBSOLIB)
99 $(SHLD) $(SHLD_FLAGS) -o $@ $(NSS_OBJ) $(LDFLAGS) $(LIBSOLIB) @SONAMEFLAG@libnss_ldb.$(SHLIBEXT).2
101 $(LIBSOLIB): $(OBJS)
102 $(SHLD) $(SHLD_FLAGS) -o $@ $(OBJS) $(LDFLAGS) $(LIBS) $(TALLOC_LIBS) $(TDB_LIBS) $(TEVENT_LIBS) $(LIBDL) $(LDAP_LIBS) @SONAMEFLAG@$(SONAME)
103 ln -sf libldb.$(SHLIBEXT).$(PACKAGE_VERSION) lib/libldb.$(SHLIBEXT)
105 all: showflags dirs $(OBJS) $(STATICLIB) $(LIBSOLIB) $(BINS) $(EXAMPLES) manpages \
106 @PYTHON_BUILD_TARGET@
108 shared-build: all
109 ${INSTALLCMD} -d $(sharedbuilddir)/lib
110 ${INSTALLCMD} -m 644 $(STATICLIB) $(sharedbuilddir)/lib
111 ${INSTALLCMD} -m 755 $(LIBSOLIB) $(sharedbuilddir)/lib
112 ln -sf $(SOLIB) $(sharedbuilddir)/lib/$(SONAME)
113 ln -sf $(SOLIB) $(sharedbuilddir)/lib/libldb.so
114 ${INSTALLCMD} -d $(sharedbuilddir)/include
115 ${INSTALLCMD} -m 644 $(srcdir)/include/ldb.h $(sharedbuilddir)/include
116 ${INSTALLCMD} -m 644 $(srcdir)/include/ldb_errors.h $(sharedbuilddir)/include
117 ${INSTALLCMD} -m 644 $(srcdir)/include/ldb_handlers.h $(sharedbuilddir)/include
119 dirs:
120 @mkdir -p $(DIRS)
122 manpages::
123 @$(srcdir)/docs/builddocs.sh "$(XSLTPROC)" "$(srcdir)"
125 doxygen::
126 test -z "$(DOXYGEN)" || (cd $(srcdir) && "$(DOXYGEN)")
128 clean::
129 rm -f *.o */*.o *.gcov */*.gc?? tdbtest.ldb*
130 rm -f $(BINS) $(TDB_OBJ) $(TALLOC_OBJ) $(STATICLIB) $(NSS_LIB) $(LIBSOLIB)
131 rm -f $(POPT_OBJ)
132 rm -f man/*.1 man/*.3 man/*.html
133 rm -f $(EXAMPLES)
134 rm -rf apidocs/
135 rm -rf tests/schema/
137 distclean:: clean
138 rm -rf bin lib
139 rm -f config.log config.status config.cache include/config.h
140 rm -f ldb.pc
141 rm -f Makefile
143 realdistclean:: distclean
144 rm -f configure include/config.h.in
146 check:: test @PYTHON_CHECK_TARGET@
148 check-soloading: sample.$(SHLIBEXT)
149 LDB_MODULES_PATH=$(builddir) $(srcdir)/tests/test-soloading.sh
151 test:: all check-soloading
152 for t in $(TESTS); do echo STARTING $${t}; $(srcdir)/tests/$${t} || exit 1; done
154 valgrindtest:: all
155 for t in $(TESTS); do echo STARTING $${t}; VALGRIND="valgrind -q --db-attach=yes --num-callers=30" $(srcdir)/tests/$${t} || exit 1; done
157 installcheck:: install test
159 install:: all installdirs installheaders installlibs installbin installdocs \
160 @PYTHON_INSTALL_TARGET@
162 installdirs::
163 mkdir -p $(DESTDIR)$(includedir) $(DESTDIR)$(libdir) $(DESTDIR)$(bindir) $(DESTDIR)$(libdir)/pkgconfig
165 installheaders:: installdirs
166 cp $(headers) $(DESTDIR)$(includedir)
168 installlibs:: installdirs
169 cp $(STATICLIB) $(LIBSOLIB) $(DESTDIR)$(libdir)
170 cp ldb.pc $(DESTDIR)$(libdir)/pkgconfig
172 installbin:: installdirs
173 cp $(BINS) $(DESTDIR)$(bindir)
175 installdocs:: installdirs
176 $(srcdir)/docs/installdocs.sh $(DESTDIR)$(mandir)
178 gcov::
179 $(GCOV) -po ldb_sqlite3 $(srcdir)/ldb_sqlite3/*.c 2| tee ldb_sqlite3.report.gcov
180 $(GCOV) -po ldb_ldap $(srcdir)/ldb_ldap/*.c 2| tee ldb_ldap.report.gcov
181 $(GCOV) -po ldb_tdb $(srcdir)/ldb_tdb/*.c 2| tee ldb_tdb.report.gcov
182 $(GCOV) -po common $(srcdir)/common/*.c 2| tee common.report.gcov
183 $(GCOV) -po modules $(srcdir)/modules/*.c 2| tee modules.report.gcov
184 $(GCOV) -po tools $(srcdir)/tools/*.c 2| tee tools.report.gcov
186 include $(ldbdir)/ldb.mk