2 # Bacula Director Makefile
17 # this dir relative to top dir
22 GETTEXT_LIBS = @LIBINTL@
25 PYTHON_LIBS = @PYTHON_LIBS@
26 PYTHON_INC = @PYTHON_INCDIR@
34 SVRSRCS = dird.c admin.c authenticate.c \
35 autoprune.c backup.c bsr.c \
36 catreq.c dir_plugins.c dird_conf.c expand.c \
37 fd_cmds.c getmsg.c inc_conf.c job.c \
39 mountreq.c msgchan.c next_vol.c newvol.c \
41 recycle.c restore.c run_conf.c \
43 ua_acl.c ua_cmds.c ua_dotcmds.c \
45 ua_input.c ua_label.c ua_output.c ua_prune.c \
46 ua_purge.c ua_restore.c ua_run.c \
47 ua_select.c ua_server.c \
48 ua_status.c ua_tree.c ua_update.c vbackup.c verify.c
49 SVROBJS = $(SVRSRCS:.c=.o)
51 # these are the objects that are changed by the .configure process
61 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
62 #-------------------------------------------------------------------------
63 all: Makefile bacula-dir @STATIC_DIR@
64 @echo "==== Make of dird is good ===="
67 bacula-dir: Makefile $(SVROBJS) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) \
68 ../lib/libbacpy$(DEFAULT_ARCHIVE_TYPE) ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) \
69 ../cats/libbaccats$(DEFAULT_ARCHIVE_TYPE) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE)
70 @echo "Linking $@ ..."
71 $(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -L../cats -L../findlib -o $@ $(SVROBJS) \
72 -lbacfind -lbacsql -lbaccats -lbacpy -lbaccfg -lbac -lm $(PYTHON_LIBS) $(DLIB) $(DB_LIBS) $(LIBS) \
73 $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(CAP_LIBS)
75 static-bacula-dir: Makefile $(SVROBJS) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) \
76 ../lib/libbacpy$(DEFAULT_ARCHIVE_TYPE) ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) \
77 ../cats/libbaccats$(DEFAULT_ARCHIVE_TYPE) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE)
78 $(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -L../cats -L../findlib -o $@ $(SVROBJS) \
79 -lbacfind -lbacsql -lbaccats -lbacpy -lbaccfg -lbac -lm $(PYTHON_LIBS) $(DLIB) $(DB_LIBS) $(LIBS) \
80 $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(CAP_LIBS)
83 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
85 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
88 @$(RMF) -r .libs _libs
91 @$(RMF) dird bacula-dir core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
92 @$(RMF) static-bacula-dir
95 @$(RMF) tags bacula-dir.conf
98 if test $(srcdir) = .; then $(MAKE) realclean; fi
99 (cd $(srcdir); $(RMF) Makefile)
102 if test $(srcdir) = .; then $(MAKE) realclean; fi
103 (cd $(srcdir); $(RMF) Makefile)
106 $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) bacula-dir $(DESTDIR)$(sbindir)/bacula-dir
107 @srcconf=bacula-dir.conf; \
108 if test -f ${DESTDIR}${sysconfdir}/$$srcconf; then \
109 destconf=$$srcconf.new; \
110 echo " ==> Found existing $$srcconf, installing new conf file as $$destconf"; \
112 destconf=$$srcconf; \
114 echo "${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf"; \
115 ${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf
116 @if test "x${dir_group}" != "x"; then \
117 chgrp -f ${dir_group} ${DESTDIR}${sysconfdir}/$$destconf ; \
119 @if test -f ${DESTDIR}${scriptdir}/query.sql; then \
120 echo " ==> Saving existing query.sql to query.sql.old"; \
121 $(MV) -f ${DESTDIR}${scriptdir}/query.sql ${DESTDIR}${scriptdir}/query.sql.old; \
123 ${INSTALL_DATA} query.sql ${DESTDIR}${scriptdir}/query.sql
124 @if test -f static-bacula-dir; then \
125 $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) static-bacula-dir $(DESTDIR)$(sbindir)/static-bacula-dir; \
130 (cd $(DESTDIR)$(sbindir); $(RMF) bacula-dir)
131 (cd $(DESTDIR)$(sysconfdir); $(RMF) bacula-dir.conf bacula-dir.conf.new)
132 (cd $(DESTDIR)$(scriptdir); $(RMF) query.sql)
136 # Semi-automatic generation of dependencies:
137 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
138 # and it also includes system headers.
139 # `semi'-automatic since dependencies are generated at distribution time.
142 @$(MV) Makefile Makefile.bak
143 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
144 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
145 @$(CXX) -S -M $(CPPFLAGS) $(XINC) $(PYTHON_INC) -I$(srcdir) -I$(basedir) *.c >> Makefile
146 @if test -f Makefile ; then \
147 $(RMF) Makefile.bak; \
149 $(MV) Makefile.bak Makefile; \
150 echo " ===== Something went wrong in make depend ====="; \
153 # -----------------------------------------------------------------------
154 # DO NOT DELETE: nice dependency list follows