]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/tools/Makefile.in
Restructure tree.c + misc
[bacula/bacula] / bacula / src / tools / Makefile.in
1 #
2 # Bacula Tools Makefile
3 #
4 # Version $Id$
5 #
6 @MCOMMON@
7
8 srcdir =        .
9 VPATH =         .
10 .PATH:          .
11
12 # one up
13 basedir = ..
14 # top dir
15 topdir = ../..
16 # this dir relative to top dir
17 thisdir = src/tools
18
19 DEBUG=@DEBUG@
20
21 first_rule: all
22 dummy:
23
24 #
25
26 FINDOBJS = testfind.o
27
28 # these are the objects that are changed by the .configure process
29 EXTRAOBJS = @OBJLIST@
30
31 DIRCONFOBJS = ../dird/dird_conf.o ../dird/run_conf.o ../dird/inc_conf.o
32
33 .SUFFIXES:      .c .o
34 .PHONY:
35 .DONTCARE:
36
37 # inference rules
38 .c.o:
39         $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
40 #-------------------------------------------------------------------------
41 all: Makefile bsmtp dbcheck testfind testls 
42         @echo "==== Make of tools is good ===="
43         @echo " "
44
45 bsmtp:  bsmtp.o ../lib/libbac.a        
46         $(CXX) $(LDFLAGS) -L../lib -o $@ bsmtp.o -lbac -lm $(DLIB) $(LIBS) 
47
48 dbcheck: dbcheck.o ../lib/libbac.a ../cats/libsql.a $(DIRCONFOBJS)
49         $(CXX) $(LDFLAGS) -L../lib -L../cats -o $@ dbcheck.o $(DIRCONFOBJS) -lsql -lbac -lm $(DB_LIBS) $(LIBS) 
50
51 testfind: ../findlib/libfind.a ../lib/libbac.a $(FINDOBJS)
52         $(CXX) -g $(LDFLAGS) -L. -L../lib -L../findlib -o $@ $(FINDOBJS) \
53           $(DLIB) -lfind -lbac -lm $(LIBS) 
54
55 testls: ../findlib/libfind.a ../lib/libbac.a testls.o
56         $(CXX) -g $(LDFLAGS) -L. -L../lib -L../findlib -o $@ testls.o \
57           $(DLIB) -lfind -lbac -lm $(LIBS) 
58
59 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
60         cd $(topdir) \
61           && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
62
63 clean:
64         @$(RMF) bsmtp core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
65         @$(RMF) testfind dbcheck testls
66
67 realclean: clean
68         @$(RMF) tags
69
70 distclean: realclean
71         if test $(srcdir) = .; then $(MAKE) realclean; fi
72         (cd $(srcdir); $(RMF) Makefile; $(RMF) -r CVS)
73
74 devclean: realclean
75         if test $(srcdir) = .; then $(MAKE) realclean; fi
76         (cd $(srcdir); $(RMF) Makefile)
77
78 # Allow non-root execution of bsmtp for non-root Directors
79 install: bsmtp
80         $(INSTALL_PROGRAM) bsmtp $(DESTDIR)$(sbindir)/bsmtp      
81         chmod 755 $(DESTDIR)$(sbindir)/bsmtp
82         $(INSTALL_PROGRAM) dbcheck $(DESTDIR)$(sbindir)/dbcheck      
83
84 uninstall:
85         (cd $(DESTDIR)$(sbindir); $(RMF) bsmtp)
86         (cd $(DESTDIR)$(sbindir); $(RMF) dbcheck)
87
88
89
90 # Semi-automatic generation of dependencies:
91 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
92 # and it also includes system headers.
93 # `semi'-automatic since dependencies are generated at distribution time.
94
95 depend:
96         @$(MV) Makefile Makefile.bak
97         @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
98         @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
99         @$(CC) -S -M $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
100         @if test -f Makefile ; then \
101             $(RMF) Makefile.bak; \
102         else \
103            $(MV) Makefile.bak Makefile; \
104            echo -e "Something went wrong\n\a"; \
105         fi
106
107 # -----------------------------------------------------------------------
108 # DO NOT DELETE: nice dependency list follows