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