3 # Author: Kern Sibbald, Copyright 2000-2015
4 # License: BSD 2-Clause
8 working_dir=@working_dir@
22 # --client-only directories
23 fd_subdirs = src scripts src/lib src/findlib src/filed \
24 @READLINE_SRC@ @BAT_DIR@ src/console @FD_PLUGIN_DIR@
26 # Non-client-only directores
27 subdirs = src/cats @DIRD_DIR@ @STORED_DIR@ src/tools
29 all_subdirs = ${fd_subdirs} ${@ALL_DIRS@} manpages
31 DIST = INSTALL README.configure configure Makefile Makefile.in ChangeLog
33 DIST_CFG = autoconf/aclocal.m4 autoconf/configure.in \
34 autoconf/config.h.in autoconf/acconfig.h autoconf/Make.common.in \
35 autoconf/install-sh autoconf/mkinstalldirs
37 doc_files = VERIFYING ChangeLog README ReleaseNotes LICENSE \
40 MKDIR = $(srcdir)/autoconf/mkinstalldirs
41 LIBTOOL_DEPS = @LIBTOOL_DEPS@
43 #-------------------------------------------------------------------------
46 @for I in ${all_subdirs}; \
47 do (cd $$I; echo "==>Entering directory `pwd`"; \
48 $(MAKE) DESTDIR=$(DESTDIR) $@ || (echo ""; echo ""; echo " ====== Error in `pwd` ======"; \
49 echo ""; echo ""; false ) || false) || exit 1; \
53 @for I in ${all_subdirs}; \
54 do (cd $$I; echo "==>Entering directory `pwd`"; $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done
57 @for I in ${fd_subdirs}; \
58 do (cd $$I; echo "==>Entering directory `pwd`"; \
59 $(MAKE) DESTDIR=$(DESTDIR) all || \
60 (echo ""; echo ""; echo " ====== Error in `pwd` ======"; \
61 echo ""; echo ""; false ) || false) || exit 1; \
64 #-------------------------------------------------------------------------
66 autoconf/aclocal.m4: autoconf/configure.in autoconf/bacula-macros/* autoconf/gettext-macros/* autoconf/libtool/*
68 # Note, the following is needed in the above if ever any new macro is added.
69 # However, at the current time, the -I libtool causes the autoconf/aclocal.m4
70 # get messed up, so this is commented out
71 # cd autoconf && aclocal -I bacula-macros -I gettext-macros -I libtool
73 configure: autoconf/configure.in autoconf/aclocal.m4 autoconf/acconfig.h autoconf/config.h.in
75 ${RMF} config.cache config.log config.out config.status src/config.h
76 ${RMF} -r autoconf/autom4te.cache autom4te.cache
77 autoconf --prepend-include=$(srcdir)/autoconf \
78 autoconf/configure.in > configure
80 ${RMF} -r autoconf/autom4te.cache autom4te.cache
83 if test -x config.status; then config.status --recheck; \
84 else $(SHELL) configure; fi
86 autoconf/config.h.in: autoconf/configure.in autoconf/acconfig.h
88 ${RMF} config.cache config.log config.out config.status src/config.h
89 autoheader --prepend-include=$(srcdir)/autoconf \
90 autoconf/configure.in > autoconf/config.h.in
91 chmod 644 autoconf/config.h.in
93 libtool: Makefile $(LIBTOOL_DEPS)
94 $(SHELL) ./config.status --recheck
97 $(MKDIR) $(DESTDIR)$(sbindir)
98 $(MKDIR) $(DESTDIR)$(sysconfdir)
99 chmod 770 $(DESTDIR)$(sysconfdir)
100 -if test "x$(dir_user)" != "x" ; then \
101 chown $(dir_user) $(DESTDIR)$(sysconfdir); \
103 -if test "x$(dir_group)" != "x" ; then \
104 chgrp $(dir_group) $(DESTDIR)$(sysconfdir); \
106 $(MKDIR) $(DESTDIR)$(scriptdir)
107 $(MKDIR) $(DESTDIR)$(docdir)
108 $(MKDIR) $(DESTDIR)$(archivedir)
109 -if test ! -d $(DESTDIR)$(working_dir) ; then \
110 $(MKDIR) $(DESTDIR)$(working_dir); \
111 chmod 770 $(DESTDIR)$(working_dir); \
113 -if test "x$(dir_user)" != "x" ; then \
114 chown $(dir_user) $(DESTDIR)$(working_dir); \
116 -if test "x$(dir_group)" != "x" ; then \
117 chgrp $(dir_group) $(DESTDIR)$(working_dir); \
121 @for I in $(doc_files) ; do $(INSTALL_DATA) $$I $(DESTDIR)${docdir}; done
122 @for I in $(all_subdirs); do (cd $$I && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done
125 @for I in $(all_subdirs); do (cd $$I && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done
128 (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
130 install-autostart-dir:
131 (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
133 install-autostart-fd:
134 (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
136 install-autostart-sd:
137 (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
140 (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
142 uninstall-autostart-dir:
143 (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
145 uninstall-autostart-fd:
146 (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
148 uninstall-autostart-sd:
149 (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
151 Makefile: Makefile.in
153 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
156 $(SHELL) config.status
158 chmod 755 startmysql stopmysql bacula startit stopit btraceback \
159 mtx-changer bconsole gconsole devel_bacula dvd-handler)
161 chmod 755 create_bacula_database update_bacula_tables \
162 make_bacula_tables grant_bacula_privileges drop_bacula_tables \
163 drop_bacula_database make_catalog_backup delete_catalog_backup)
164 @for I in @DB_BACKENDS@ ; do \
166 chmod 755 create_$${I}_database update_$${I}_tables \
167 make_$${I}_tables grant_$${I}_privileges drop_$${I}_tables \
168 drop_$${I}_database); \
170 (cd src/qt-console; \
171 chmod 755 install_conf_file build-depkgs-qt-console)
174 @for I in ${all_subdirs} ; \
175 do (cd $$I; echo "==>Entering directory `pwd`"; ${MAKE} $@ || exit 1); done
176 @(cd platforms; echo "==>Entering directory `pwd`"; ${MAKE} $@ || exit 1)
177 @$(RMF) *~ 1 2 3 core core.* config.guess console.log console.sum
178 @$(RMF) examples/1 examples/2 examples/devices/1 examples/devices/2
179 @$(RMF) -r autom4te.cache
180 @find . -name ".#*" -exec $(RMF) {} \;
183 # clean for distribution
185 @for I in $(all_subdirs); do (cd $$I && $(MAKE) $@ || exit 1); done
186 @for I in $(all_subdirs); do (cd $$I && $(RMF) startit stopit btraceback); done
187 @(cd $(srcdir) && $(RMF) *~ config.cache config.h config.log config.status config.out)
188 @(cd $(srcdir) && $(RMF) Makefile autoconf/Make.common)
189 @(cd platforms; echo "==>Entering directory `pwd`"; ${MAKE} $@ || exit 1)
190 @$(RMF) bacula fd Makefile startmysql stopmysql startit stopit btraceback
191 @$(RMF) bconsole gconsole
192 @$(RMF) *~ 1 2 3 core core.* config.guess console.log console.sum
193 @$(RMF) working/* kerns-*
194 @$(RMF) -rf txt diff src/python src/testprogs
198 @for I in $(all_subdirs); do (cd $$I && $(MAKE) $@ || exit 1); done
199 @for I in $(all_subdirs); do (cd $$I && $(RMF) startit stopit btraceback); done
200 @(cd $(srcdir) && $(RMF) *~ config.cache config.h config.log config.status config.out)
201 @(cd $(srcdir) && $(RMF) Makefile autoconf/Make.common)
202 @(cd platforms; echo "==>Entering directory `pwd`"; ${MAKE} $@ || exit 1)
203 @$(RMF) bacula fd Makefile startmysql stopmysql startit stopit btraceback
204 @$(RMF) bconsole gconsole
205 @$(RMF) *~ 1 2 3 core core.* config.guess console.log console.sum
210 mkdir ../$(VERNAME)/autoconf;
211 @for I in $(all_subdirs); do (cd $$I && $(MAKE) DESTDIR=$(DESTDIR) $@ || (echo "Failed to make distclean in $$I"; exit 0) ); done
214 $(CP) -p $(DIST) ../$(VERNAME);
215 $(CP) -p $(DIST_CFG) ../$(VERNAME)/autoconf;
216 @for I in $(all_subdirs); do (cd $$I && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done
218 distrib: configure autoconf/config.h.in distdirs distcopy
223 tar.gz: ../$(VERNAME).tar.gz
224 ../$(VERNAME).tar.gz:
225 (cd ..; tar cvf - $(VERNAME) | gzip -f9 > $(VERNAME).tar.gz)
227 tar.Z: ../$(VERNAME).tar.Z
229 (cd ..; tar cvf - $(VERNAME) | compress > $(VERNAME).tar.Z)
231 tar.bz2: ../$(VERNAME).tar.bz2
232 ../$(VERNAME).tar.bz2:
233 (cd ..; tar cvf - $(VERNAME) | bzip2 -f9 > $(VERNAME).tar.bz2)
236 uuencode ../$(VERNAME).tar.gz $(VERNAME).tar.gz > ../$(VERNAME).tgz.uu
238 # ------------------------------------------------------------------------