2 # Bacula Director Makefile
16 # this dir relative to top dir
21 GETTEXT_LIBS = @LIBINTL@
23 PYTHON_LIBS = @PYTHON_LIBS@
24 PYTHON_INC = @PYTHON_INCDIR@
30 SVRSRCS = dird.c admin.c authenticate.c \
31 autoprune.c backup.c bsr.c \
32 catreq.c dir_plugins.c dird_conf.c expand.c \
33 fd_cmds.c getmsg.c inc_conf.c job.c \
35 mountreq.c msgchan.c next_vol.c newvol.c \
37 recycle.c restore.c run_conf.c \
39 ua_acl.c ua_cmds.c ua_dotcmds.c \
41 ua_input.c ua_label.c ua_output.c ua_prune.c \
42 ua_purge.c ua_restore.c ua_run.c \
43 ua_select.c ua_server.c \
44 ua_status.c ua_tree.c ua_update.c vbackup.c verify.c
45 SVROBJS = $(SVRSRCS:.c=.o)
47 # these are the objects that are changed by the .configure process
57 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
58 #-------------------------------------------------------------------------
59 all: Makefile bacula-dir @STATIC_DIR@
60 @echo "==== Make of dird is good ===="
63 bacula-dir: Makefile $(SVROBJS) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbacpy$(DEFAULT_ARCHIVE_TYPE) ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE)
64 @echo "Linking $@ ..."
65 $(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -L../cats -L../findlib -o $@ $(SVROBJS) \
66 -lbacfind -lbacsql -lbacpy -lbaccfg -lbac -lm $(PYTHON_LIBS) $(DLIB) $(DB_LIBS) $(LIBS) \
67 $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
69 static-bacula-dir: Makefile $(SVROBJS) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbacpy$(DEFAULT_ARCHIVE_TYPE) ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE)
70 $(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -L../cats -L../findlib -o $@ $(SVROBJS) \
71 -lbacfind -lbacsql -lbacpy -lbaccfg -lbac -lm $(PYTHON_LIBS) $(DLIB) $(DB_LIBS) $(LIBS) \
72 $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
75 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
77 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
82 clean: @LIBTOOL_CLEAN_TARGET@
83 @$(RMF) dird bacula-dir core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
84 @$(RMF) static-bacula-dir
87 @$(RMF) tags bacula-dir.conf
90 if test $(srcdir) = .; then $(MAKE) realclean; fi
91 (cd $(srcdir); $(RMF) Makefile)
94 if test $(srcdir) = .; then $(MAKE) realclean; fi
95 (cd $(srcdir); $(RMF) Makefile)
98 $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) bacula-dir $(DESTDIR)$(sbindir)/bacula-dir
99 @srcconf=bacula-dir.conf; \
100 if test -f ${DESTDIR}${sysconfdir}/$$srcconf; then \
101 destconf=$$srcconf.new; \
102 echo " ==> Found existing $$srcconf, installing new conf file as $$destconf"; \
104 destconf=$$srcconf; \
106 echo "${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf"; \
107 ${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf
108 @if test -f ${DESTDIR}${scriptdir}/query.sql; then \
109 echo " ==> Saving existing query.sql to query.sql.old"; \
110 $(MV) -f ${DESTDIR}${scriptdir}/query.sql ${DESTDIR}${scriptdir}/query.sql.old; \
112 ${INSTALL_DATA} query.sql ${DESTDIR}${scriptdir}/query.sql
113 @if test -f static-bacula-dir; then \
114 $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) static-bacula-dir $(DESTDIR)$(sbindir)/static-bacula-dir; \
119 (cd $(DESTDIR)$(sbindir); $(RMF) bacula-dir)
120 (cd $(DESTDIR)$(sysconfdir); $(RMF) bacula-dir.conf bacula-dir.conf.new)
121 (cd $(DESTDIR)$(scriptdir); $(RMF) query.sql)
125 # Semi-automatic generation of dependencies:
126 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
127 # and it also includes system headers.
128 # `semi'-automatic since dependencies are generated at distribution time.
131 @$(MV) Makefile Makefile.bak
132 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
133 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
134 @$(CXX) -S -M $(CPPFLAGS) $(XINC) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
135 @if test -f Makefile ; then \
136 $(RMF) Makefile.bak; \
138 $(MV) Makefile.bak Makefile; \
139 echo " ===== Something went wrong in make depend ====="; \
142 # -----------------------------------------------------------------------
143 # DO NOT DELETE: nice dependency list follows