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