2 # Bacula Tools Makefile
16 # this dir relative to top dir
28 # these are the objects that are changed by the .configure process
31 DIRCONFOBJS = ../dird/dird_conf.o ../dird/run_conf.o ../dird/inc_conf.o
39 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
40 #-------------------------------------------------------------------------
41 all: Makefile bsmtp dbcheck fstype testfind testls
42 @echo "==== Make of tools is good ===="
45 bsmtp: bsmtp.o ../lib/libbac.a
46 $(CXX) $(LDFLAGS) -L../lib -o $@ bsmtp.o -lbac -lm $(DLIB) $(LIBS)
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)
51 fstype: fstype.o ../lib/libbac.a ../findlib/libfind.a
52 $(CXX) $(LDFLAGS) -L../lib -L../findlib -o $@ fstype.o -lfind -lbac -lm $(DLIB) $(LIBS)
54 testfind: ../findlib/libfind.a ../lib/libbac.a $(FINDOBJS)
55 $(CXX) -g $(LDFLAGS) -L. -L../lib -L../findlib -o $@ $(FINDOBJS) \
56 $(DLIB) -lfind -lbac -lm $(LIBS)
58 testls: ../findlib/libfind.a ../lib/libbac.a testls.o
59 $(CXX) -g $(LDFLAGS) -L. -L../lib -L../findlib -o $@ testls.o \
60 $(DLIB) -lfind -lbac -lm $(LIBS)
62 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
64 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
67 @$(RMF) bsmtp core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
68 @$(RMF) testfind dbcheck testls fstype
74 if test $(srcdir) = .; then $(MAKE) realclean; fi
75 (cd $(srcdir); $(RMF) Makefile; $(RMF) -r CVS)
78 if test $(srcdir) = .; then $(MAKE) realclean; fi
79 (cd $(srcdir); $(RMF) Makefile)
81 # Allow non-root execution of bsmtp for non-root Directors
83 $(INSTALL_PROGRAM) bsmtp $(DESTDIR)$(sbindir)/bsmtp
84 chmod 755 $(DESTDIR)$(sbindir)/bsmtp
85 $(INSTALL_PROGRAM) dbcheck $(DESTDIR)$(sbindir)/dbcheck
88 (cd $(DESTDIR)$(sbindir); $(RMF) bsmtp)
89 (cd $(DESTDIR)$(sbindir); $(RMF) dbcheck)
93 # Semi-automatic generation of dependencies:
94 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
95 # and it also includes system headers.
96 # `semi'-automatic since dependencies are generated at distribution time.
99 @$(MV) Makefile Makefile.bak
100 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
101 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
102 @$(CXX) -S -M $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
103 @if test -f Makefile ; then \
104 $(RMF) Makefile.bak; \
106 $(MV) Makefile.bak Makefile; \
107 echo -e "Something went wrong\n\a"; \
110 # -----------------------------------------------------------------------
111 # DO NOT DELETE: nice dependency list follows