s4-test/delete_object: Remove unused imports
[Samba.git] / lib / tdb / tdb.mk
blob64d7996583e7a840c6262025280734097c1ffa20
1 dirs::
2 @mkdir -p bin common tools
4 PROGS = bin/tdbtool$(EXEEXT) bin/tdbrestore$(EXEEXT) bin/tdbdump$(EXEEXT) bin/tdbbackup$(EXEEXT)
5 PROGS_NOINSTALL = bin/tdbtest$(EXEEXT) bin/tdbtorture$(EXEEXT)
6 ALL_PROGS = $(PROGS) $(PROGS_NOINSTALL)
8 TDB_SONAME = libtdb.$(SHLIBEXT).1
9 TDB_SOLIB = libtdb.$(SHLIBEXT).$(PACKAGE_VERSION)
10 TDB_STLIB = libtdb.a
12 TDB_LIB = $(TDB_STLIB)
14 bin/tdbtest$(EXEEXT): tools/tdbtest.o $(TDB_LIB)
15 $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbtest tools/tdbtest.o -L. -ltdb -lgdbm $(TDB_DEPS)
17 bin/tdbtool$(EXEEXT): tools/tdbtool.o $(TDB_LIB)
18 $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbtool tools/tdbtool.o -L. -ltdb $(TDB_DEPS)
20 bin/tdbtorture$(EXEEXT): tools/tdbtorture.o $(TDB_LIB)
21 $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbtorture tools/tdbtorture.o -L. -ltdb $(TDB_DEPS)
23 bin/tdbdump$(EXEEXT): tools/tdbdump.o $(TDB_LIB)
24 $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbdump tools/tdbdump.o -L. -ltdb $(TDB_DEPS)
26 bin/tdbrestore$(EXEEXT): tools/tdbrestore.o $(TDB_LIB)
27 $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbrestore tools/tdbrestore.o -L. -ltdb $(TDB_DEPS)
29 bin/tdbbackup$(EXEEXT): tools/tdbbackup.o $(TDB_LIB)
30 $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbbackup tools/tdbbackup.o -L. -ltdb $(TDB_DEPS)
32 test:: abi_checks
34 test:: bin/tdbtorture$(EXEEXT) $(TDB_SONAME)
35 $(LIB_PATH_VAR)=. bin/tdbtorture$(EXEEXT)
37 abi_checks::
38 @echo ABI checks:
39 @./script/abi_checks.sh tdb include/tdb.h
41 clean::
42 rm -f test.db test.tdb torture.tdb test.gdbm
43 rm -f $(TDB_SONAME) $(TDB_SOLIB) $(TDB_STLIB) libtdb.$(SHLIBEXT)
44 rm -f $(ALL_PROGS) tdb.pc
45 rm -f tdb.exports.sort tdb.exports.check tdb.exports.check.sort
46 rm -f tdb.signatures.sort tdb.signatures.check tdb.signatures.check.sort
48 build-python:: tdb.$(SHLIBEXT)
50 pytdb.o: $(tdbdir)/pytdb.c
51 $(CC) $(PICFLAG) -c $(tdbdir)/pytdb.c $(CFLAGS) `$(PYTHON_CONFIG) --cflags`
53 tdb.$(SHLIBEXT): libtdb.$(SHLIBEXT) pytdb.o
54 $(SHLD) $(SHLD_FLAGS) -o $@ pytdb.o -L. -ltdb `$(PYTHON_CONFIG) --ldflags` $(TDB_DEPS)
56 install:: installdirs installbin installheaders installlibs \
57 $(PYTHON_INSTALL_TARGET) installdocs
59 doc:: manpages/tdbbackup.8 manpages/tdbrestore.8 manpages/tdbdump.8 manpages/tdbtool.8
61 .SUFFIXES: .8.xml .8
63 .8.xml.8:
64 -test -z "$(XSLTPROC)" || $(XSLTPROC) -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
66 installdocs::
67 ${INSTALLCMD} -d $(DESTDIR)$(mandir)/man8
68 for I in manpages/*.8; do \
69 ${INSTALLCMD} -m 644 $$I $(DESTDIR)$(mandir)/man8; \
70 done
72 install-python:: build-python
73 mkdir -p $(DESTDIR)`$(PYTHON) -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(1, prefix='$(prefix)')"`
74 cp tdb.$(SHLIBEXT) $(DESTDIR)`$(PYTHON) -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(1, prefix='$(prefix)')"`
76 check-python:: build-python $(TDB_SONAME)
77 $(LIB_PATH_VAR)=. PYTHONPATH=".:$(tdbdir)" $(PYTHON) $(tdbdir)/python/tests/simple.py
79 clean::
80 rm -f tdb.$(SHLIBEXT)
82 installdirs::
83 mkdir -p $(DESTDIR)$(bindir)
84 mkdir -p $(DESTDIR)$(includedir)
85 mkdir -p $(DESTDIR)$(libdir)
86 mkdir -p $(DESTDIR)$(libdir)/pkgconfig
88 installbin:: all installdirs
89 cp $(PROGS) $(DESTDIR)$(bindir)
91 installheaders:: installdirs
92 cp $(srcdir)/include/tdb.h $(DESTDIR)$(includedir)
94 installlibs:: all installdirs
95 cp tdb.pc $(DESTDIR)$(libdir)/pkgconfig
96 cp $(TDB_STLIB) $(TDB_SOLIB) $(DESTDIR)$(libdir)
97 rm -f $(DESTDIR)$(libdir)/libtdb.$(SHLIBEXT)
98 ln -s $(TDB_SOLIB) $(DESTDIR)$(libdir)/libtdb.$(SHLIBEXT)
99 rm -f $(DESTDIR)$(libdir)/$(TDB_SONAME)
100 ln -s $(TDB_SOLIB) $(DESTDIR)$(libdir)/$(TDB_SONAME)
102 $(TDB_STLIB): $(TDB_OBJ)
103 ar -rv $(TDB_STLIB) $(TDB_OBJ)
105 libtdb.$(SHLIBEXT): $(TDB_SOLIB)
106 ln -fs $< $@
108 $(TDB_SONAME): $(TDB_SOLIB)
109 ln -fs $< $@