]> git.sur5r.net Git - bacula/bacula/blob - bacula/Makefile.in
64db60f03de5fb992e46e3926abd2083e1136d64
[bacula/bacula] / bacula / Makefile.in
1 #
2 # Master Makefile
3 #
4 # Copyright (C) 2000-2015 Kern Sibbald
5 # License: BSD 2-Clause; see file LICENSE-FOSS
6 #
7 @MCOMMON@
8
9 working_dir=@working_dir@
10 dir_group=@dir_group@
11 dir_user=@dir_user@
12
13 srcdir =        @srcdir@
14 VPATH =         @srcdir@
15 .PATH:          @srcdir@
16 topdir = @BUILD_DIR@
17 thisdir = @BUILD_DIR@
18
19
20 first_rule: all
21 dummy:
22
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@
26
27 # Non-client-only directores
28 subdirs =    src/cats @DIRD_DIR@ @STORED_DIR@ src/tools
29
30 all_subdirs = ${fd_subdirs} ${@ALL_DIRS@} manpages
31
32 DIST =  INSTALL README.configure configure Makefile Makefile.in ChangeLog
33
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
37
38 doc_files = VERIFYING ChangeLog README ReleaseNotes LICENSE \
39             LICENSE-FAQ LICENSE-FOSS INSTALL
40
41 MKDIR = $(srcdir)/autoconf/mkinstalldirs
42 LIBTOOL_DEPS = @LIBTOOL_DEPS@
43
44 #-------------------------------------------------------------------------
45
46 all: Makefile
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; \
51         done
52
53 depend:
54         @for I in ${all_subdirs}; \
55           do (cd $$I; echo "==>Entering directory `pwd`"; $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done
56         
57 bacula-fd: Makefile     
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; \
63         done
64
65 #-------------------------------------------------------------------------
66
67 autoconf/aclocal.m4: autoconf/configure.in autoconf/bacula-macros/* autoconf/gettext-macros/* autoconf/libtool/*
68
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
73
74 configure: autoconf/configure.in autoconf/aclocal.m4 autoconf/acconfig.h autoconf/config.h.in
75         cd $(srcdir);
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
80         chmod 755 configure
81         ${RMF} -r autoconf/autom4te.cache autom4te.cache
82
83 config.status:
84         if test -x config.status; then config.status --recheck; \
85         else $(SHELL) configure; fi
86
87 autoconf/config.h.in: autoconf/configure.in autoconf/acconfig.h
88         cd $(srcdir);
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
93
94 libtool: Makefile $(LIBTOOL_DEPS)
95         $(SHELL) ./config.status --recheck
96
97 installdirs:
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); \
103         fi
104         -if test "x$(dir_group)" != "x" ; then \
105            chgrp $(dir_group) $(DESTDIR)$(sysconfdir); \
106         fi
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); \
115         fi
116         -if test "x$(dir_user)" != "x" ; then \
117            chown $(dir_user) $(DESTDIR)$(working_dir); \
118            chown $(dir_user) $(DESTDIR)$(logdir); \
119         fi
120         -if test "x$(dir_group)" != "x" ; then \
121            chgrp $(dir_group) $(DESTDIR)$(working_dir); \
122            chgrp $(dir_group) $(DESTDIR)$(logdir); \
123         fi
124
125 install: installdirs
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
128
129 uninstall:
130         @for I in $(all_subdirs); do (cd $$I && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done
131
132 install-autostart:
133         (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
134
135 install-autostart-dir:
136         (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
137
138 install-autostart-fd:
139         (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
140
141 install-autostart-sd:
142         (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
143
144 uninstall-autostart:
145         (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
146
147 uninstall-autostart-dir:
148         (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
149
150 uninstall-autostart-fd:
151         (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
152
153 uninstall-autostart-sd:
154         (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1)
155
156 Makefile: Makefile.in
157         cd $(topdir) \
158             && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
159
160 Makefiles:
161         $(SHELL) config.status
162         (cd scripts; \
163          chmod 755 startmysql stopmysql bacula startit stopit btraceback \
164             mtx-changer bconsole gconsole devel_bacula dvd-handler)
165         (cd src/cats; \
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 \
170           (cd src/cats; \
171            chmod 755 create_$${I}_database update_$${I}_tables \
172               make_$${I}_tables grant_$${I}_privileges drop_$${I}_tables \
173               drop_$${I}_database); \
174           done
175         (cd src/qt-console; \
176          chmod 755 install_conf_file build-depkgs-qt-console)
177
178 clean:
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) {} \;
186
187
188 # clean for distribution
189 distclean:
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
200         @$(RMF) libtool
201
202 devclean:
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
211         @$(RMF) working/*
212
213 distdirs:
214         mkdir ../$(VERNAME);
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
217
218 distcopy:
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
222
223 distrib: configure autoconf/config.h.in distdirs distcopy
224
225 # ------------------------------------------------------------------------