2 # Bacula Director Makefile
17 # this dir relative to top dir
22 GETTEXT_LIBS = @LIBINTL@
31 SVRSRCS = dird.c admin.c authenticate.c \
32 autoprune.c backup.c bsr.c \
33 catreq.c dir_plugins.c dird_conf.c expand.c \
34 fd_cmds.c getmsg.c inc_conf.c job.c \
35 jobq.c mac.c mac_sql.c \
36 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) -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) \
64 ../lib/libbacpy$(DEFAULT_ARCHIVE_TYPE) ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) \
65 ../cats/libbaccats$(DEFAULT_ARCHIVE_TYPE) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE)
66 @echo "Linking $@ ..."
67 $(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -L../cats -L../findlib -o $@ $(SVROBJS) \
68 -lbacfind -lbacsql -lbaccats -lbacpy -lbaccfg -lbac -lm $(DLIB) $(DB_LIBS) $(LIBS) \
69 $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(CAP_LIBS)
71 static-bacula-dir: Makefile $(SVROBJS) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) \
72 ../lib/libbacpy$(DEFAULT_ARCHIVE_TYPE) ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) \
73 ../cats/libbaccats$(DEFAULT_ARCHIVE_TYPE) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE)
74 $(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -L../cats -L../findlib -o $@ $(SVROBJS) \
75 -lbacfind -lbacsql -lbaccats -lbacpy -lbaccfg -lbac -lm $(DLIB) $(DB_LIBS) $(LIBS) \
76 $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(CAP_LIBS)
79 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
81 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
84 @$(RMF) -r .libs _libs
87 @$(RMF) dird bacula-dir core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
88 @$(RMF) static-bacula-dir
91 @$(RMF) tags bacula-dir.conf
94 if test $(srcdir) = .; then $(MAKE) realclean; fi
95 (cd $(srcdir); $(RMF) Makefile)
98 if test $(srcdir) = .; then $(MAKE) realclean; fi
99 (cd $(srcdir); $(RMF) Makefile)
102 $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) bacula-dir $(DESTDIR)$(sbindir)/bacula-dir
103 @srcconf=bacula-dir.conf; \
104 if test -f ${DESTDIR}${sysconfdir}/$$srcconf; then \
105 destconf=$$srcconf.new; \
106 echo " ==> Found existing $$srcconf, installing new conf file as $$destconf"; \
108 destconf=$$srcconf; \
110 echo "${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf"; \
111 ${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf
112 @if test "x${dir_group}" != "x"; then \
113 chgrp -f ${dir_group} ${DESTDIR}${sysconfdir}/$$destconf ; \
115 @if test -f ${DESTDIR}${scriptdir}/query.sql; then \
116 echo " ==> Saving existing query.sql to query.sql.old"; \
117 $(MV) -f ${DESTDIR}${scriptdir}/query.sql ${DESTDIR}${scriptdir}/query.sql.old; \
119 ${INSTALL_DATA} query.sql ${DESTDIR}${scriptdir}/query.sql
120 @if test -f static-bacula-dir; then \
121 $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) static-bacula-dir $(DESTDIR)$(sbindir)/static-bacula-dir; \
126 (cd $(DESTDIR)$(sbindir); $(RMF) bacula-dir
127 (cd $(DESTDIR)$(sysconfdir); $(RMF) bacula-dir.conf bacula-dir.conf.new)
128 (cd $(DESTDIR)$(scriptdir); $(RMF) query.sql)
132 # Semi-automatic generation of dependencies:
133 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
134 # and it also includes system headers.
135 # `semi'-automatic since dependencies are generated at distribution time.
138 @$(MV) Makefile Makefile.bak
139 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
140 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
141 @$(CXX) -S -M $(CPPFLAGS) $(XINC) -I$(srcdir) -I$(basedir) *.c >> Makefile
142 @if test -f Makefile ; then \
143 $(RMF) Makefile.bak; \
145 $(MV) Makefile.bak Makefile; \
146 echo " ===== Something went wrong in make depend ====="; \
149 # -----------------------------------------------------------------------
150 # DO NOT DELETE: nice dependency list follows