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
39 DIRTOOLS = bsmtp dbcheck fstype testfind testls
40 TOOLS = $(@DIR_TOOLS@)
43 INSDIRTOOLS = bsmtp dbcheck
44 INSTOOLS = $(INS@DIR_TOOLS@)
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 ===="
59 bsmtp: bsmtp.o ../lib/libbac.a
60 $(CXX) $(LDFLAGS) -L../lib -o $@ bsmtp.o -lbac -lm $(DLIB) $(LIBS) $(OPENSSL_LIBS)
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)
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)
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)
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)
76 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
78 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
81 @$(RMF) bsmtp core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
82 @$(RMF) testfind dbcheck testls fstype
88 if test $(srcdir) = .; then $(MAKE) realclean; fi
89 (cd $(srcdir); $(RMF) Makefile; $(RMF) -r CVS)
92 if test $(srcdir) = .; then $(MAKE) realclean; fi
93 (cd $(srcdir); $(RMF) Makefile)
95 # Allow non-root execution of bsmtp for non-root Directors
97 @for tool in ${INSTOOLS} ; do \
98 $(INSTALL_PROGRAM) $$tool $(DESTDIR)$(sbindir)/$$tool ; \
100 chmod 755 $(DESTDIR)$(sbindir)/bsmtp
103 (cd $(DESTDIR)$(sbindir); $(RMF) bsmtp)
104 (cd $(DESTDIR)$(sbindir); $(RMF) dbcheck)
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.
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; \
121 $(MV) Makefile.bak Makefile; \
122 echo " ===== Something went wrong in make depend ====="; \
125 # -----------------------------------------------------------------------
126 # DO NOT DELETE: nice dependency list follows