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