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@
33 FINDOBJS = testfind.o ../dird/dird_conf.o ../dird/inc_conf.o ../dird/run_conf.o
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 drivetype fstype testfind testls bregex bwild bbatch bregtest
42 TOOLS = $(@DIR_TOOLS@)
45 INSDIRTOOLS = bsmtp dbcheck bwild bregex
46 INSTOOLS = $(INS@DIR_TOOLS@)
56 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
57 #-------------------------------------------------------------------------
58 all: Makefile $(TOOLS) gigaslam
59 @echo "==== Make of tools is good ===="
62 bsmtp: bsmtp.o ../lib/libbac.a
63 $(CXX) $(LDFLAGS) -L../lib -o $@ bsmtp.o -lbac -lm $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
65 bregtest: bregtest.o ../lib/libbac.a
66 $(CXX) $(LDFLAGS) -L../lib -o $@ bregtest.o -lbac -lm $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
68 dbcheck: dbcheck.o ../lib/libbac.a ../cats/libsql.a $(DIRCONFOBJS)
69 $(CXX) $(LDFLAGS) -L../lib -L../cats -o $@ dbcheck.o $(DIRCONFOBJS) -lsql -lbac -lm $(DB_LIBS) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
71 fstype: fstype.o ../lib/libbac.a ../findlib/libfind.a
72 $(CXX) $(LDFLAGS) -L../lib -L../findlib -o $@ fstype.o -lfind -lbac -lm $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
74 drivetype: drivetype.o ../lib/libbac.a ../findlib/libfind.a
75 $(CXX) $(LDFLAGS) -L../lib -L../findlib -o $@ drivetype.o -lfind -lbac -lm $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
77 dird_conf.o: ../dird/dird_conf.c
78 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
80 run_conf.o: ../dird/run_conf.c
81 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
83 inc_conf.o: ../dird/inc_conf.c
84 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
86 testfind: ../findlib/libfind.a ../lib/libbac.a $(FINDOBJS)
87 $(CXX) -g $(LDFLAGS) -L. -L../lib -L../findlib -o $@ $(FINDOBJS) \
88 $(DLIB) -lfind -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
90 testls: ../findlib/libfind.a ../lib/libbac.a testls.o
91 $(CXX) -g $(LDFLAGS) -L. -L../lib -L../findlib -o $@ testls.o \
92 $(DLIB) -lfind -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
94 bregex: ../findlib/libfind.a ../lib/libbac.a bregex.o
95 $(CXX) -g $(LDFLAGS) -L. -L../lib -o $@ bregex.o \
96 $(DLIB) -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
98 bwild: ../findlib/libfind.a ../lib/libbac.a bwild.o
99 $(CXX) -g $(LDFLAGS) -L. -L../lib -o $@ bwild.o \
100 $(DLIB) -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
102 bbatch: ../lib/libbac.a bbatch.o
103 $(CXX) -g $(LDFLAGS) -L../cats -L. -L../lib -o $@ bbatch.o \
104 -lsql -lbac -lm $(DB_LIBS) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
106 gigaslam.o: gigaslam.c
110 $(CC) -o $@ gigaslam.o
113 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
115 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
118 @$(RMF) bsmtp core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
125 if test $(srcdir) = .; then $(MAKE) realclean; fi
126 (cd $(srcdir); $(RMF) Makefile)
129 if test $(srcdir) = .; then $(MAKE) realclean; fi
130 (cd $(srcdir); $(RMF) Makefile)
132 # Allow non-root execution of bsmtp for non-root Directors
134 @for tool in ${INSTOOLS} ; do \
135 $(INSTALL_PROGRAM) $$tool $(DESTDIR)$(sbindir)/$$tool ; \
137 chmod 755 $(DESTDIR)$(sbindir)/bsmtp
140 @for tool in ${INSTOOLS} ; do \
141 $(RMF) $(DESTDIR)$(sbindir)/$$tool ; \
146 # Semi-automatic generation of dependencies:
147 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
148 # and it also includes system headers.
149 # `semi'-automatic since dependencies are generated at distribution time.
152 @$(MV) Makefile Makefile.bak
153 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
154 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
155 @$(CXX) -S -M $(CPPFLAGS) $(PYTHON_INC) $(OPENSSL_INC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
156 @if test -f Makefile ; then \
157 $(RMF) Makefile.bak; \
159 $(MV) Makefile.bak Makefile; \
160 echo " ===== Something went wrong in make depend ====="; \
163 # -----------------------------------------------------------------------
164 # DO NOT DELETE: nice dependency list follows