3 # Makefile for tdb directory
8 exec_prefix = @exec_prefix@
10 includedir = @includedir@
12 VPATH = @srcdir@:@libreplacedir@
15 CPPFLAGS = @CPPFLAGS@ -I$(srcdir)/include -Iinclude
16 CFLAGS = $(CPPFLAGS) @CFLAGS@
20 SHLD_FLAGS = @SHLD_FLAGS@
21 PACKAGE_VERSION = @PACKAGE_VERSION@
28 PROGS = bin/tdbtool$(EXEEXT) bin/tdbdump$(EXEEXT) bin/tdbbackup$(EXEEXT)
29 PROGS_NOINSTALL = bin/tdbtest$(EXEEXT) bin/tdbtorture$(EXEEXT)
30 ALL_PROGS = $(PROGS) $(PROGS_NOINSTALL)
32 TDB_OBJ = @TDB_OBJ@ @LIBREPLACEOBJ@
34 DIRS = bin common tools
36 SONAME = libtdb.$(SHLIBEXT).1
37 SOLIB = libtdb.$(SHLIBEXT).$(PACKAGE_VERSION)
39 all: showflags dirs $(PROGS) $(SOLIB) libtdb.a
42 @echo 'tdb will be compiled with flags:'
43 @echo ' CFLAGS = $(CFLAGS)'
44 @echo ' CPPFLAGS = $(CPPFLAGS)'
45 @echo ' LDFLAGS = $(LDFLAGS)'
46 @echo ' LIBS = $(LIBS)'
52 @mkdir -p `dirname $@`
53 @$(CC) $(PICFLAG) $(CFLAGS) -c $< -o $@
59 mkdir -p $(DESTDIR)$(bindir)
60 mkdir -p $(DESTDIR)$(includedir)
61 mkdir -p $(DESTDIR)$(libdir)
62 mkdir -p $(DESTDIR)$(libdir)/pkgconfig
63 cp $(PROGS) $(DESTDIR)$(bindir)
64 cp $(srcdir)/include/tdb.h $(DESTDIR)$(includedir)
65 cp tdb.pc $(DESTDIR)$(libdir)/pkgconfig
66 cp libtdb.a $(SOLIB) $(DESTDIR)$(libdir)
69 ar -rv libtdb.a $(TDB_OBJ)
71 libtdb.$(SHLIBEXT): $(SOLIB)
78 $(SHLD) $(SHLD_FLAGS) -o $@ $(TDB_OBJ) @SONAMEFLAG@$(SONAME)
82 bin/tdbtest$(EXEEXT): tools/tdbtest.o $(TDB_LIB)
83 $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbtest tools/tdbtest.o -L. -ltdb -lgdbm
85 bin/tdbtool$(EXEEXT): tools/tdbtool.o $(TDB_LIB)
86 $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbtool tools/tdbtool.o -L. -ltdb
88 bin/tdbtorture$(EXEEXT): tools/tdbtorture.o $(TDB_LIB)
89 $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbtorture tools/tdbtorture.o -L. -ltdb
91 bin/tdbdump$(EXEEXT): tools/tdbdump.o $(TDB_LIB)
92 $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbdump tools/tdbdump.o -L. -ltdb
94 bin/tdbbackup$(EXEEXT): tools/tdbbackup.o $(TDB_LIB)
95 $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbbackup tools/tdbbackup.o -L. -ltdb
97 test: bin/tdbtorture$(EXEEXT)
98 bin/tdbtorture$(EXEEXT)
100 installcheck: test install
103 rm -f $(ALL_PROGS) *.o *.a common/*.o tools/*.o tdb.pc
104 rm -f test.db test.tdb torture.tdb test.gdbm
105 rm -f $(SONAME) $(SOLIB) libtdb.a libtdb.$(SHLIBEXT)
109 rm -f config.log config.status include/config.h config.cache
112 realdistclean: distclean
113 rm -f configure include/config.h.in
115 tdb_wrap.c tdb.py: tdb.i
116 $(SWIG) -python -keyword tdb.i
118 build-python: libtdb.$(SHLIBEXT) tdb_wrap.c tdb.py
122 ./setup.py install --prefix=$(prefix)
124 check-python: build-python
125 # FIXME: Should be more portable:
126 LD_LIBRARY_PATH=. PYTHONPATH=.:build/lib.linux-i686-2.4 trial python/tests/simple.py
129 mkdir -p $(DESTDIR)`$(SWIG) -swiglib`
130 cp tdb.i $(DESTDIR)`$(SWIG) -swiglib`