4 # Copyright (C) 2000-2015 Kern Sibbald
5 # License: BSD 2-Clause; see file LICENSE-FOSS
9 working_dir=@working_dir@
23 # --client-only directories
24 fd_subdirs = src scripts src/lib src/findlib src/filed \
25 @READLINE_SRC@ @BAT_DIR@ src/console @FD_PLUGIN_DIR@
27 # Non-client-only directores
28 subdirs = src/cats @DIRD_DIR@ @STORED_DIR@ src/tools
30 all_subdirs = ${fd_subdirs} ${@ALL_DIRS@} manpages
32 DIST = INSTALL README.configure configure Makefile Makefile.in ChangeLog
34 DIST_CFG = autoconf/aclocal.m4 autoconf/configure.in \
35 autoconf/config.h.in autoconf/acconfig.h autoconf/Make.common.in \
36 autoconf/install-sh autoconf/mkinstalldirs
38 doc_files = VERIFYING ChangeLog README ReleaseNotes LICENSE \
39 LICENSE-FAQ LICENSE-FOSS INSTALL
41 MKDIR = $(srcdir)/autoconf/mkinstalldirs
42 LIBTOOL_DEPS = @LIBTOOL_DEPS@
44 #-------------------------------------------------------------------------
47 @for I in ${all_subdirs}; \
48 do (cd $$I; echo "==>Entering directory `pwd`"; \
49 $(MAKE) DESTDIR=$(DESTDIR) $@ || (echo ""; echo ""; echo " ====== Error in `pwd` ======"; \
50 echo ""; echo ""; false ) || false) || exit 1; \
54 @for I in ${all_subdirs}; \
55 do (cd $$I; echo "==>Entering directory `pwd`"; $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done
58 @for I in ${fd_subdirs}; \
59 do (cd $$I; echo "==>Entering directory `pwd`"; \
60 $(MAKE) DESTDIR=$(DESTDIR) all || \
61 (echo ""; echo ""; echo " ====== Error in `pwd` ======"; \
62 echo ""; echo ""; false ) || false) || exit 1; \
65 #-------------------------------------------------------------------------
67 autoconf/aclocal.m4: autoconf/configure.in autoconf/bacula-macros/* autoconf/gettext-macros/* autoconf/libtool/*
69 # Note, the following is needed in the above if ever any new macro is added.
70 # However, at the current time, the -I libtool causes the autoconf/aclocal.m4
71 # get messed up, so this is commented out
72 # cd autoconf && aclocal -I bacula-macros -I gettext-macros -I libtool
74 configure: autoconf/configure.in autoconf/aclocal.m4 autoconf/acconfig.h autoconf/config.h.in
76 ${RMF} config.cache config.log config.out config.status src/config.h
77 ${RMF} -r autoconf/autom4te.cache autom4te.cache
78 autoconf --prepend-include=$(srcdir)/autoconf \
79 autoconf/configure.in > configure
81 ${RMF} -r autoconf/autom4te.cache autom4te.cache
84 if test -x config.status; then config.status --recheck; \
85 else $(SHELL) configure; fi
87 autoconf/config.h.in: autoconf/configure.in autoconf/acconfig.h
89 ${RMF} config.cache config.log config.out config.status src/config.h
90 autoheader --prepend-include=$(srcdir)/autoconf \
91 autoconf/configure.in > autoconf/config.h.in
92 chmod 644 autoconf/config.h.in
94 libtool: Makefile $(LIBTOOL_DEPS)
95 $(SHELL) ./config.status --recheck
98 $(MKDIR) $(DESTDIR)$(sbindir)
99 $(MKDIR) $(DESTDIR)$(sysconfdir)
100 chmod 770 $(DESTDIR)$(sysconfdir)
101 -if test "x$(dir_user)" != "x" ; then \
102 chown $(dir_user) $(DESTDIR)$(sysconfdir); \
104 -if test "x$(dir_group)" != "x" ; then \
105 chgrp $(dir_group) $(DESTDIR)$(sysconfdir); \
107 $(MKDIR) $(DESTDIR)$(scriptdir)
108 $(MKDIR) $(DESTDIR)$(docdir)
109 $(MKDIR) $(DESTDIR)$(archivedir)
110 $(MKDIR) $(DESTDIR)$(bsrdir)
111 $(MKDIR) $(DESTDIR)${logdir}
112 -if test ! -d $(DESTDIR)$(working_dir) ; then \
113 $(MKDIR) $(DESTDIR)$(working_dir); \
114 chmod 770 $(DESTDIR)$(working_dir); \
116 -if test "x$(dir_user)" != "x" ; then \
117 chown $(dir_user) $(DESTDIR)$(working_dir); \
118 chown $(dir_user) $(DESTDIR)$(logdir); \
120 -if test "x$(dir_group)" != "x" ; then \
121 chgrp $(dir_group) $(DESTDIR)$(working_dir); \
122 chgrp $(dir_group) $(DESTDIR)$(logdir); \
126 @for I in $(doc_files) ; do $(INSTALL_DATA) $$I $(DESTDIR)${docdir}; done
127 @for I in $(all_subdirs); do (cd $$I && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done
130 @for I in $(all_subdirs); do (cd $$I && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done
133 (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
135 install-autostart-dir:
136 (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
138 install-autostart-fd:
139 (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
141 install-autostart-sd:
142 (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
145 (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
147 uninstall-autostart-dir:
148 (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
150 uninstall-autostart-fd:
151 (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
153 uninstall-autostart-sd:
154 (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
156 Makefile: Makefile.in
158 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
161 $(SHELL) config.status
163 chmod 755 startmysql stopmysql bacula startit stopit btraceback \
164 mtx-changer bconsole gconsole devel_bacula dvd-handler)
166 chmod 755 create_bacula_database update_bacula_tables \
167 make_bacula_tables grant_bacula_privileges drop_bacula_tables \
168 drop_bacula_database make_catalog_backup delete_catalog_backup)
169 @for I in @DB_BACKENDS@ ; do \
171 chmod 755 create_$${I}_database update_$${I}_tables \
172 make_$${I}_tables grant_$${I}_privileges drop_$${I}_tables \
173 drop_$${I}_database); \
175 (cd src/qt-console; \
176 chmod 755 install_conf_file build-depkgs-qt-console)
179 @for I in ${all_subdirs} ; \
180 do (cd $$I; echo "==>Entering directory `pwd`"; ${MAKE} $@ || exit 1); done
181 @(cd platforms; echo "==>Entering directory `pwd`"; ${MAKE} $@ || exit 1)
182 @$(RMF) *~ 1 2 3 core core.* config.guess console.log console.sum
183 @$(RMF) examples/1 examples/2 examples/devices/1 examples/devices/2
184 @$(RMF) -r autom4te.cache
185 @find . -name ".#*" -exec $(RMF) {} \;
188 # clean for distribution
190 @for I in $(all_subdirs); do (cd $$I && $(MAKE) $@ || exit 1); done
191 @for I in $(all_subdirs); do (cd $$I && $(RMF) startit stopit btraceback); done
192 @(cd $(srcdir) && $(RMF) *~ config.cache config.h config.log config.status config.out)
193 @(cd $(srcdir) && $(RMF) Makefile autoconf/Make.common)
194 @(cd platforms; echo "==>Entering directory `pwd`"; ${MAKE} $@ || exit 1)
195 @$(RMF) bacula fd Makefile startmysql stopmysql startit stopit btraceback
196 @$(RMF) bconsole gconsole
197 @$(RMF) *~ 1 2 3 core core.* config.guess console.log console.sum
198 @$(RMF) working/* kerns-*
199 @$(RMF) -rf txt diff src/python src/testprogs
203 @for I in $(all_subdirs); do (cd $$I && $(MAKE) $@ || exit 1); done
204 @for I in $(all_subdirs); do (cd $$I && $(RMF) startit stopit btraceback); done
205 @(cd $(srcdir) && $(RMF) *~ config.cache config.h config.log config.status config.out)
206 @(cd $(srcdir) && $(RMF) Makefile autoconf/Make.common)
207 @(cd platforms; echo "==>Entering directory `pwd`"; ${MAKE} $@ || exit 1)
208 @$(RMF) bacula fd Makefile startmysql stopmysql startit stopit btraceback
209 @$(RMF) bconsole gconsole
210 @$(RMF) *~ 1 2 3 core core.* config.guess console.log console.sum
215 mkdir ../$(VERNAME)/autoconf;
216 @for I in $(all_subdirs); do (cd $$I && $(MAKE) DESTDIR=$(DESTDIR) $@ || (echo "Failed to make distclean in $$I"; exit 0) ); done
219 $(CP) -p $(DIST) ../$(VERNAME);
220 $(CP) -p $(DIST_CFG) ../$(VERNAME)/autoconf;
221 @for I in $(all_subdirs); do (cd $$I && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done
223 distrib: configure autoconf/config.h.in distdirs distcopy
225 # ------------------------------------------------------------------------