r19989: Add support to the tdb Makefile.in for executable extensions and for
[jra/samba/.git] / source4 / 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 CPPFLAGS = @CPPFLAGS@ -I$(srcdir)/include -Iinclude -I@libreplacedir@
16 CFLAGS = $(CPPFLAGS) @CFLAGS@
17 LDFLAGS = @LDFLAGS@
18 EXEEXT = @EXEEXT@
19
20 .PHONY: test
21
22 PROGS = bin/tdbtool$(EXEEXT) bin/tdbtorture$(EXEEXT)
23 PROGS_NOINSTALL = bin/tdbtest$(EXEEXT) bin/tdbdump$(EXEEXT) bin/tdbbackup$(EXEEXT)
24 ALL_PROGS = $(PROGS) $(PROGS_NOINSTALL)
25
26 TDB_OBJ = @TDBOBJ@ @LIBREPLACEOBJ@
27
28 DIRS = bin common tools
29
30 all: showflags dirs $(PROGS)
31
32 showflags:
33         @echo 'tdb will be compiled with flags:'
34         @echo '  CFLAGS = $(CFLAGS)'
35         @echo '  CPPFLAGS = $(CPPFLAGS)'
36         @echo '  LDFLAGS = $(LDFLAGS)'
37         @echo '  LIBS = $(LIBS)'
38
39 .c.o:
40         @echo Compiling $*.c
41         @mkdir -p `dirname $@`
42         @$(CC) $(CFLAGS) -c $< -o $@
43
44 dirs:
45         @mkdir -p $(DIRS)
46
47 install: all
48         mkdir -p $(bindir)
49         mkdir -p $(includedir)
50         mkdir -p $(libdir) 
51         mkdir -p $(libdir)/pkgconfig
52         cp $(PROGS) $(bindir)
53         cp $(srcdir)/include/tdb.h $(includedir)
54         cp tdb.pc $(libdir)/pkgconfig
55
56 libtdb.a: $(TDB_OBJ)
57         ar -rv libtdb.a $(TDB_OBJ)
58
59 bin/tdbtest$(EXEEXT): tools/tdbtest.o libtdb.a
60         $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbtest tools/tdbtest.o -L. -ltdb -lgdbm
61
62 bin/tdbtool$(EXEEXT): tools/tdbtool.o libtdb.a
63         $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbtool tools/tdbtool.o -L. -ltdb
64
65 bin/tdbtorture$(EXEEXT): tools/tdbtorture.o libtdb.a
66         $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbtorture tools/tdbtorture.o -L. -ltdb
67
68 bin/tdbdump$(EXEEXT): tools/tdbdump.o libtdb.a
69         $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbdump tools/tdbdump.o -L. -ltdb
70
71 bin/tdbbackup$(EXEEXT): tools/tdbbackup.o libtdb.a
72         $(CC) $(CFLAGS) $(LDFLAGS) -o bin/tdbbackup tools/tdbbackup.o -L. -ltdb
73
74 test: bin/tdbtorture$(EXEEXT)
75         bin/tdbtorture$(EXEEXT)
76
77 installcheck: test install
78
79 clean:
80         rm -f $(ALL_PROGS) *.o *.a common/*.o tools/*.o tdb.pc
81         rm -f test.db test.tdb torture.tdb test.gdbm
82
83 distclean: clean
84         rm -f *~ */*~
85         rm -f config.log config.status include/config.h config.cache
86         rm -f Makefile
87
88 realdistclean: distclean
89         rm -f configure include/config.h.in