2 # Bacula Tools Makefile
8 PYTHON_INC = @PYTHON_INCDIR@
18 # this dir relative to top dir
30 # these are the objects that are changed by the .configure process
33 DIRCONFOBJS = ../dird/dird_conf.o ../dird/run_conf.o ../dird/inc_conf.o
41 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
42 #-------------------------------------------------------------------------
43 all: Makefile bsmtp dbcheck fstype testfind testls
44 @echo "==== Make of tools is good ===="
47 bsmtp: bsmtp.o ../lib/libbac.a
48 $(CXX) $(LDFLAGS) -L../lib -o $@ bsmtp.o -lbac -lm $(DLIB) $(LIBS)
50 dbcheck: dbcheck.o ../lib/libbac.a ../cats/libsql.a $(DIRCONFOBJS)
51 $(CXX) $(LDFLAGS) -L../lib -L../cats -o $@ dbcheck.o $(DIRCONFOBJS) -lsql -lbac -lm $(DB_LIBS) $(LIBS)
53 fstype: fstype.o ../lib/libbac.a ../findlib/libfind.a
54 $(CXX) $(LDFLAGS) -L../lib -L../findlib -o $@ fstype.o -lfind -lbac -lm $(DLIB) $(LIBS)
56 testfind: ../findlib/libfind.a ../lib/libbac.a $(FINDOBJS)
57 $(CXX) -g $(LDFLAGS) -L. -L../lib -L../findlib -o $@ $(FINDOBJS) \
58 $(DLIB) -lfind -lbac -lm $(LIBS)
60 testls: ../findlib/libfind.a ../lib/libbac.a testls.o
61 $(CXX) -g $(LDFLAGS) -L. -L../lib -L../findlib -o $@ testls.o \
62 $(DLIB) -lfind -lbac -lm $(LIBS)
64 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
66 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
69 @$(RMF) bsmtp core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
70 @$(RMF) testfind dbcheck testls fstype
76 if test $(srcdir) = .; then $(MAKE) realclean; fi
77 (cd $(srcdir); $(RMF) Makefile; $(RMF) -r CVS)
80 if test $(srcdir) = .; then $(MAKE) realclean; fi
81 (cd $(srcdir); $(RMF) Makefile)
83 # Allow non-root execution of bsmtp for non-root Directors
85 $(INSTALL_PROGRAM) bsmtp $(DESTDIR)$(sbindir)/bsmtp
86 chmod 755 $(DESTDIR)$(sbindir)/bsmtp
87 $(INSTALL_PROGRAM) dbcheck $(DESTDIR)$(sbindir)/dbcheck
90 (cd $(DESTDIR)$(sbindir); $(RMF) bsmtp)
91 (cd $(DESTDIR)$(sbindir); $(RMF) dbcheck)
95 # Semi-automatic generation of dependencies:
96 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
97 # and it also includes system headers.
98 # `semi'-automatic since dependencies are generated at distribution time.
101 @$(MV) Makefile Makefile.bak
102 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
103 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
104 @$(CXX) -S -M $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
105 @if test -f Makefile ; then \
106 $(RMF) Makefile.bak; \
108 $(MV) Makefile.bak Makefile; \
109 echo " ===== Something went wrong in make depend ====="; \
112 # -----------------------------------------------------------------------
113 # DO NOT DELETE: nice dependency list follows