s3:rpc_parse: remove unused init_unistr().
[Samba/gbeck.git] / lib / tdb / tdb.mk
blobb786bdbf54006a899b4cc28a35f4320584e548a1
1 dirs::
2 @mkdir -p bin common tools
4 PROGS = bin/tdbtool$(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
17 bin/tdbtool$(EXEEXT): tools/tdbtool.o $(TDB_LIB)
18 $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbtool tools/tdbtool.o -L. -ltdb
20 bin/tdbtorture$(EXEEXT): tools/tdbtorture.o $(TDB_LIB)
21 $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbtorture tools/tdbtorture.o -L. -ltdb
23 bin/tdbdump$(EXEEXT): tools/tdbdump.o $(TDB_LIB)
24 $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbdump tools/tdbdump.o -L. -ltdb
26 bin/tdbbackup$(EXEEXT): tools/tdbbackup.o $(TDB_LIB)
27 $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbbackup tools/tdbbackup.o -L. -ltdb
29 test:: bin/tdbtorture$(EXEEXT) $(TDB_SONAME)
30 $(LIB_PATH_VAR)=. bin/tdbtorture$(EXEEXT)
32 clean::
33 rm -f test.db test.tdb torture.tdb test.gdbm
34 rm -f $(TDB_SONAME) $(TDB_SOLIB) $(TDB_STLIB) libtdb.$(SHLIBEXT)
35 rm -f $(ALL_PROGS) tdb.pc
37 build-python:: tdb.$(SHLIBEXT)
39 pytdb.o: $(tdbdir)/pytdb.c
40 $(CC) $(PICFLAG) -c $(tdbdir)/pytdb.c $(CFLAGS) `$(PYTHON_CONFIG) --cflags`
42 tdb.$(SHLIBEXT): libtdb.$(SHLIBEXT) pytdb.o
43 $(SHLD) $(SHLD_FLAGS) -o $@ pytdb.o -L. -ltdb `$(PYTHON_CONFIG) --ldflags`
45 install:: installdirs installbin installheaders installlibs \
46 $(PYTHON_INSTALL_TARGET)
48 install-python:: build-python
49 mkdir -p $(DESTDIR)`$(PYTHON) -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(1, prefix='$(prefix)')"`
50 cp tdb.$(SHLIBEXT) $(DESTDIR)`$(PYTHON) -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(1, prefix='$(prefix)')"`
52 check-python:: build-python $(TDB_SONAME)
53 $(LIB_PATH_VAR)=. PYTHONPATH=".:$(tdbdir)" $(PYTHON) $(tdbdir)/python/tests/simple.py
55 clean::
56 rm -f tdb.$(SHLIBEXT)
58 installdirs::
59 mkdir -p $(DESTDIR)$(bindir)
60 mkdir -p $(DESTDIR)$(includedir)
61 mkdir -p $(DESTDIR)$(libdir)
62 mkdir -p $(DESTDIR)$(libdir)/pkgconfig
64 installbin:: all installdirs
65 cp $(PROGS) $(DESTDIR)$(bindir)
67 installheaders:: installdirs
68 cp $(srcdir)/include/tdb.h $(DESTDIR)$(includedir)
70 installlibs:: all installdirs
71 cp tdb.pc $(DESTDIR)$(libdir)/pkgconfig
72 cp $(TDB_STLIB) $(TDB_SOLIB) $(DESTDIR)$(libdir)
74 $(TDB_STLIB): $(TDB_OBJ)
75 ar -rv $(TDB_STLIB) $(TDB_OBJ)
77 libtdb.$(SHLIBEXT): $(TDB_SOLIB)
78 ln -fs $< $@
80 $(TDB_SONAME): $(TDB_SOLIB)
81 ln -fs $< $@