2 # Bacula Tools Makefile
8 PYTHON_INC = @PYTHON_INCDIR@
18 # this dir relative to top dir
28 GETTEXT_LIBS = @LIBINTL@
30 OPENSSL_INC = @OPENSSL_INC@
31 OPENSSL_LIBS = @OPENSSL_LIBS@
35 # these are the objects that are changed by the .configure process
38 DIRCONFOBJS = ../dird/dird_conf.o ../dird/run_conf.o ../dird/inc_conf.o
41 DIRTOOLS = bsmtp dbcheck fstype testfind testls regex wild
42 TOOLS = $(@DIR_TOOLS@)
45 INSDIRTOOLS = bsmtp dbcheck
46 INSTOOLS = $(INS@DIR_TOOLS@)
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 ===="
61 bsmtp: bsmtp.o ../lib/libbac.a
62 $(CXX) $(LDFLAGS) -L../lib -o $@ bsmtp.o -lbac -lm $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
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)
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)
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)
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)
78 regex: ../findlib/libfind.a ../lib/libbac.a regex.o
79 $(CXX) -g $(LDFLAGS) -L. -L../lib -o $@ regex.o \
80 $(DLIB) -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
82 wild: ../findlib/libfind.a ../lib/libbac.a wild.o
83 $(CXX) -g $(LDFLAGS) -L. -L../lib -o $@ wild.o \
84 $(DLIB) -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
88 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
90 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
93 @$(RMF) bsmtp core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
94 @$(RMF) testfind dbcheck testls fstype
100 if test $(srcdir) = .; then $(MAKE) realclean; fi
101 (cd $(srcdir); $(RMF) Makefile)
104 if test $(srcdir) = .; then $(MAKE) realclean; fi
105 (cd $(srcdir); $(RMF) Makefile)
107 # Allow non-root execution of bsmtp for non-root Directors
109 @for tool in ${INSTOOLS} ; do \
110 $(INSTALL_PROGRAM) $$tool $(DESTDIR)$(sbindir)/$$tool ; \
112 chmod 755 $(DESTDIR)$(sbindir)/bsmtp
115 (cd $(DESTDIR)$(sbindir); $(RMF) bsmtp)
116 (cd $(DESTDIR)$(sbindir); $(RMF) dbcheck)
120 # Semi-automatic generation of dependencies:
121 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
122 # and it also includes system headers.
123 # `semi'-automatic since dependencies are generated at distribution time.
126 @$(MV) Makefile Makefile.bak
127 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
128 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
129 @$(CXX) -S -M $(CPPFLAGS) $(PYTHON_INC) $(OPENSSL_INC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
130 @if test -f Makefile ; then \
131 $(RMF) Makefile.bak; \
133 $(MV) Makefile.bak Makefile; \
134 echo " ===== Something went wrong in make depend ====="; \
137 # -----------------------------------------------------------------------
138 # DO NOT DELETE: nice dependency list follows