2 # Bacula Tools Makefile
8 PYTHON_INC = @PYTHON_INCDIR@
18 # this dir relative to top dir
28 GETTEXT_LIBS = @LIBINTL@
30 FINDOBJS = testfind.o ../dird/dird_conf.o ../dird/inc_conf.o ../dird/run_conf.o
32 # these are the objects that are changed by the .configure process
35 DIRCONFOBJS = ../dird/dird_conf.o ../dird/run_conf.o ../dird/inc_conf.o
38 DIRTOOLS = bsmtp dbcheck drivetype fstype testfind testls bregex bwild bbatch bregtest
39 TOOLS = $(@DIR_TOOLS@)
42 INSDIRTOOLS = bsmtp dbcheck bwild bregex
43 INSTOOLS = $(INS@DIR_TOOLS@)
53 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
54 #-------------------------------------------------------------------------
55 all: Makefile $(TOOLS) gigaslam grow
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) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
62 bregtest: bregtest.o ../lib/libbac.a
63 $(CXX) $(LDFLAGS) -L../lib -o $@ bregtest.o -lbac -lm $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
65 dbcheck: dbcheck.o ../lib/libbac.a ../cats/libsql.a $(DIRCONFOBJS)
66 $(CXX) $(LDFLAGS) -L../lib -L../cats -o $@ dbcheck.o $(DIRCONFOBJS) -lsql -lbac -lm $(DB_LIBS) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
68 fstype: fstype.o ../lib/libbac.a ../findlib/libfind.a
69 $(CXX) $(LDFLAGS) -L../lib -L../findlib -o $@ fstype.o -lfind -lbac -lm $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
71 drivetype: drivetype.o ../lib/libbac.a ../findlib/libfind.a
72 $(CXX) $(LDFLAGS) -L../lib -L../findlib -o $@ drivetype.o -lfind -lbac -lm $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
74 dird_conf.o: ../dird/dird_conf.c
75 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
77 run_conf.o: ../dird/run_conf.c
78 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
80 inc_conf.o: ../dird/inc_conf.c
81 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
83 testfind: ../findlib/libfind.a ../lib/libbac.a $(FINDOBJS)
84 $(CXX) -g $(LDFLAGS) -o $@ $(FINDOBJS) -L. -L../lib -L../findlib \
85 $(DLIB) -lfind -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
87 testls: ../findlib/libfind.a ../lib/libbac.a testls.o
88 $(CXX) -g $(LDFLAGS) -L. -L../lib -L../findlib -o $@ testls.o \
89 $(DLIB) -lfind -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
91 bregex: ../findlib/libfind.a ../lib/libbac.a bregex.o
92 $(CXX) -g $(LDFLAGS) -L. -L../lib -o $@ bregex.o \
93 $(DLIB) -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
95 bwild: ../findlib/libfind.a ../lib/libbac.a bwild.o
96 $(CXX) -g $(LDFLAGS) -L. -L../lib -o $@ bwild.o \
97 $(DLIB) -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
99 bbatch: ../lib/libbac.a bbatch.o
100 $(CXX) -g $(LDFLAGS) -L../cats -L. -L../lib -o $@ bbatch.o \
101 -lsql -lbac -lm $(DB_LIBS) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
103 gigaslam.o: gigaslam.c
107 $(CC) -o $@ gigaslam.o
109 grow: grow.o ../lib/libbac.a
110 $(CXX) $(LDFLAGS) -L../lib -o $@ grow.o -lbac -lm $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
112 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
114 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
117 @$(RMF) bsmtp core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
124 if test $(srcdir) = .; then $(MAKE) realclean; fi
125 (cd $(srcdir); $(RMF) Makefile)
128 if test $(srcdir) = .; then $(MAKE) realclean; fi
129 (cd $(srcdir); $(RMF) Makefile)
131 # Allow non-root execution of bsmtp for non-root Directors
133 @for tool in ${INSTOOLS} ; do \
134 $(INSTALL_PROGRAM) $$tool $(DESTDIR)$(sbindir)/$$tool ; \
136 chmod 755 $(DESTDIR)$(sbindir)/bsmtp
139 @for tool in ${INSTOOLS} ; do \
140 $(RMF) $(DESTDIR)$(sbindir)/$$tool ; \
145 # Semi-automatic generation of dependencies:
146 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
147 # and it also includes system headers.
148 # `semi'-automatic since dependencies are generated at distribution time.
151 @$(MV) Makefile Makefile.bak
152 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
153 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
154 @$(CXX) -S -M $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
155 @if test -f Makefile ; then \
156 $(RMF) Makefile.bak; \
158 $(MV) Makefile.bak Makefile; \
159 echo " ===== Something went wrong in make depend ====="; \
162 # -----------------------------------------------------------------------
163 # DO NOT DELETE: nice dependency list follows