r18148: - use PHONY for test
[jelmer/samba4-debian.git] / source / lib / tdb / Makefile.in
1 #!gmake
2 #
3 # Makefile for tdb directory
4 #
5
6 CC = @CC@
7 prefix = @prefix@
8 exec_prefix = @exec_prefix@
9 bindir = @bindir@
10 includedir = @includedir@
11 libdir = @libdir@
12 VPATH = @srcdir@:@libreplacedir@
13 srcdir = @srcdir@
14 builddir = @builddir@
15 CFLAGS = -I$(srcdir)/include -Iinclude -I@libreplacedir@ @CFLAGS@
16
17 .PHONY: test
18
19 PROGS = bin/tdbtool bin/tdbtorture
20 TDB_OBJ = @TDBOBJ@ @LIBREPLACEOBJ@
21
22 DIRS = lib bin common tools examples
23
24 all: showflags dirs $(PROGS)
25
26 showflags:
27         @echo 'tdb will be compiled with flags:'
28         @echo '  CFLAGS = $(CFLAGS)'
29         @echo '  LIBS = $(LIBS)'
30
31 .c.o:
32         @echo Compiling $*.c
33         @mkdir -p `dirname $@`
34         @$(CC) $(CFLAGS) -c $< -o $@
35
36 dirs:
37         @mkdir -p $(DIRS)
38
39 install: all
40         mkdir -p $(bindir)
41         mkdir -p $(includedir)
42         mkdir -p $(libdir) 
43         mkdir -p $(libdir)/pkgconfig
44         cp $(PROGS) $(bindir)
45         cp $(srcdir)/include/tdb.h $(includedir)
46         cp tdb.pc $(libdir)/pkgconfig
47
48 libtdb.a: $(TDB_OBJ)
49         ar -rv libtdb.a $(TDB_OBJ)
50
51 bin/tdbtest: tools/tdbtest.o libtdb.a
52         $(CC) $(CFLAGS) -o bin/tdbtest tools/tdbtest.o -L. -ltdb -lgdbm
53
54 bin/tdbtool: tools/tdbtool.o libtdb.a
55         $(CC) $(CFLAGS) -o bin/tdbtool tools/tdbtool.o -L. -ltdb
56
57 bin/tdbtorture: tools/tdbtorture.o libtdb.a
58         $(CC) $(CFLAGS) -o bin/tdbtorture tools/tdbtorture.o -L. -ltdb
59
60 bin/tdbdump: tools/tdbdump.o libtdb.a
61         $(CC) $(CFLAGS) -o bin/tdbdump tools/tdbdump.o -L. -ltdb
62
63 bin/tdbbackup: tools/tdbbackup.o libtdb.a
64         $(CC) $(CFLAGS) -o bin/tdbbackup tools/tdbbackup.o -L. -ltdb
65
66 test: bin/tdbtorture
67         bin/tdbtorture
68
69 installcheck: test install
70
71 clean:
72         rm -f $(PROGS) common/*.o tools/*.o test.db test.tdb test.gdbm
73
74 distclean: clean
75         rm -f *~ */*~
76         rm -f config.log config.status config.h
77         rm -f Makefile
78
79 realdistclean: distclean
80         rm -f configure config.h.in