r17746: the automatic archive creation in make breaks on 3 platforms. Lets try
[jelmer/samba4-debian.git] / source / lib / ldb / Makefile.in
1 CC = @CC@
2 GCOV = @GCOV@
3 XSLTPROC = @XSLTPROC@
4 DOXYGEN = @DOXYGEN@
5 prefix = @prefix@
6 exec_prefix = @exec_prefix@
7 includedir = @includedir@
8 libdir = @libdir@
9 bindir = @bindir@
10 mandir = @mandir@
11 VPATH = @srcdir@:@srcdir@/..:@POPTDIR@
12 srcdir = @srcdir@
13 builddir = @builddir@
14 SLAPD = @SLAPD@
15 EXTRA_OBJ=@EXTRA_OBJ@
16 TESTS=test-tdb.sh @TESTS@
17
18 CFLAGS=-I$(srcdir)/include -Iinclude -I$(srcdir) -I$(srcdir)/.. \
19        -I$(srcdir)/../tdb/include -I$(srcdir)/../tdb -I$(srcdir)/../talloc \
20         -DLIBDIR=\"$(libdir)\" -DSHLIBEXT=\"@SHLIBEXT@\" -DUSE_MMAP=1 @CFLAGS@
21
22 LIB_FLAGS=-Llib -lldb @LIBS@
23
24 REPDIR=replace
25 REPLACE_OBJ=$(REPDIR)/replace.o $(REPDIR)/timegm.o
26
27 TDBDIR=tdb
28 TDB_OBJ=$(TDBDIR)/common/tdb.o $(TDBDIR)/common/dump.o \
29         $(TDBDIR)/common/io.o $(TDBDIR)/common/lock.o \
30         $(TDBDIR)/common/open.o $(TDBDIR)/common/traverse.o \
31         $(TDBDIR)/common/freelist.o $(TDBDIR)/common/error.o \
32         $(TDBDIR)/common/transaction.o 
33
34 TALLOCDIR=talloc
35 TALLOC_OBJ=$(TALLOCDIR)/talloc.o
36
37 LDB_TDB_DIR=ldb_tdb
38 LDB_TDB_OBJ=$(LDB_TDB_DIR)/ldb_tdb.o \
39         $(LDB_TDB_DIR)/ldb_pack.o $(LDB_TDB_DIR)/ldb_search.o $(LDB_TDB_DIR)/ldb_index.o \
40         $(LDB_TDB_DIR)/ldb_cache.o $(LDB_TDB_DIR)/ldb_tdb_wrap.o
41
42 COMDIR=common
43 COMMON_OBJ=$(COMDIR)/ldb.o $(COMDIR)/ldb_ldif.o \
44            $(COMDIR)/ldb_parse.o $(COMDIR)/ldb_msg.o $(COMDIR)/ldb_utf8.o \
45            $(COMDIR)/ldb_debug.o $(COMDIR)/ldb_modules.o \
46            $(COMDIR)/ldb_dn.o $(COMDIR)/ldb_match.o $(COMDIR)/ldb_attributes.o \
47            $(COMDIR)/attrib_handlers.o $(COMDIR)/ldb_controls.o $(COMDIR)/qsort.o
48
49 MODDIR=modules
50 MODULES_OBJ=$(MODDIR)/operational.o $(MODDIR)/schema.o $(MODDIR)/rdn_name.o \
51            $(MODDIR)/objectclass.o \
52            $(MODDIR)/paged_results.o $(MODDIR)/sort.o $(MODDIR)/asq.o
53
54 OBJS = $(MODULES_OBJ) $(COMMON_OBJ) $(LDB_TDB_OBJ) $(TDB_OBJ) $(TALLOC_OBJ) $(EXTRA_OBJ) $(REPLACE_OBJ)
55
56 LDB_LIB = lib/libldb.a
57
58 BINS = bin/ldbadd bin/ldbsearch bin/ldbdel bin/ldbmodify bin/ldbedit bin/ldbrename bin/ldbtest bin/oLschema2ldif
59
60 LIBS = $(LDB_LIB)
61
62 EXAMPLES = examples/ldbreader examples/ldifreader
63
64 DIRS = lib bin common replace ldb_tdb ldb_ldap ldb_sqlite3 modules tools examples tdb talloc
65
66 all: dirs $(OBJS) $(LDB_LIB) $(BINS) $(EXAMPLES) manpages
67
68 .c.o:
69         @echo Compiling $*.c
70         @mkdir -p `dirname $@`
71         @$(CC) $(CFLAGS) -c $< -o $@
72
73 dirs:
74         @mkdir -p $(DIRS)
75
76 lib/libldb.a: $(OBJS)
77         ar -rv $@ $(OBJS)
78         @-ranlib $@
79
80 bin/ldbadd: tools/ldbadd.o tools/cmdline.o $(LIBS)
81         $(CC) -o bin/ldbadd tools/ldbadd.o tools/cmdline.o $(LIB_FLAGS)
82
83 bin/ldbsearch: tools/ldbsearch.o tools/cmdline.o $(LIBS)
84         $(CC) -o bin/ldbsearch tools/ldbsearch.o tools/cmdline.o $(LIB_FLAGS)
85
86 bin/ldbdel: tools/ldbdel.o tools/cmdline.o $(LIBS)
87         $(CC) -o bin/ldbdel tools/ldbdel.o tools/cmdline.o $(LIB_FLAGS)
88
89 bin/ldbmodify: tools/ldbmodify.o tools/cmdline.o $(LIBS)
90         $(CC) -o bin/ldbmodify tools/ldbmodify.o tools/cmdline.o $(LIB_FLAGS)
91
92 bin/ldbedit: tools/ldbedit.o tools/cmdline.o $(LIBS)
93         $(CC) -o bin/ldbedit tools/ldbedit.o tools/cmdline.o $(LIB_FLAGS)
94
95 bin/ldbrename: tools/ldbrename.o tools/cmdline.o $(LIBS)
96         $(CC) -o bin/ldbrename tools/ldbrename.o tools/cmdline.o $(LIB_FLAGS)
97
98 bin/ldbtest: tools/ldbtest.o tools/cmdline.o $(LIBS)
99         $(CC) -o bin/ldbtest tools/ldbtest.o tools/cmdline.o $(LIB_FLAGS)
100
101 bin/oLschema2ldif: tools/oLschema2ldif.o tools/cmdline.o tools/convert.o $(LIBS)
102         $(CC) -o bin/oLschema2ldif tools/oLschema2ldif.o tools/cmdline.o tools/convert.o $(LIB_FLAGS)
103
104 examples/ldbreader: examples/ldbreader.o $(LIBS)
105         $(CC) -o examples/ldbreader examples/ldbreader.o $(LIB_FLAGS)
106
107 examples/ldifreader: examples/ldifreader.o $(LIBS)
108         $(CC) -o examples/ldifreader examples/ldifreader.o $(LIB_FLAGS)
109
110 .SUFFIXES: .1 .1.xml .3 .3.xml .xml .html
111
112 manpages:
113         @$(srcdir)/docs/builddocs.sh "$(XSLTPROC)" "$(srcdir)"
114
115 doxygen:
116         test -z "$(DOXYGEN)" || (cd $(srcdir) && "$(DOXYGEN)")
117
118 clean:
119         rm -f */*.o *.gcov */*.gc?? tdbtest.ldb* \
120         rm -f $(BINS) $(TDB_OBJ) $(TALLOC_OBJ) $(LDB_LIB)
121         rm -f man/*.1 man/*.3 man/*.html
122         rm -f $(EXAMPLES)
123         rm -rf apidocs/
124
125 distclean: clean
126         rm -f *~ */*~
127         rm -rf autom4te.cache bin lib
128         rm -f configure \
129                 config.log config.status \
130                 include/config.h include/config.h.in \
131         rm -f ldb.pc
132         rm -f Makefile
133
134 installcheck: install tests
135         for t in $(TESTS); do echo STARTING $${t}; $(srcdir)/tests/$${t} || exit 1; done
136
137 test: installcheck
138
139 install: all
140         mkdir -p $(includedir) $(libdir)/pkgconfig $(libdir) $(bindir)
141         cp $(srcdir)/include/ldb.h $(srcdir)/include/ldb_errors.h $(includedir)
142         cp $(LDB_LIB) $(libdir)
143         cp $(BINS) $(bindir)
144         cp ldb.pc $(libdir)/pkgconfig
145         $(srcdir)/docs/installdocs.sh $(mandir)
146
147 gcov:
148         $(GCOV) -po ldb_sqlite3 $(srcdir)/ldb_sqlite3/*.c 2| tee ldb_sqlite3.report.gcov
149         $(GCOV) -po ldb_ldap $(srcdir)/ldb_ldap/*.c 2| tee ldb_ldap.report.gcov
150         $(GCOV) -po ldb_tdb $(srcdir)/ldb_tdb/*.c 2| tee ldb_tdb.report.gcov
151         $(GCOV) -po common $(srcdir)/common/*.c 2| tee common.report.gcov
152         $(GCOV) -po modules $(srcdir)/modules/*.c 2| tee modules.report.gcov
153         $(GCOV) -po tools $(srcdir)/tools/*.c 2| tee tools.report.gcov
154
155 etags:
156         etags `find $(srcdir) -name "*.[ch]"`
157
158 ctags:
159         ctags `find $(srcdir) -name "*.[ch]"`