2 # Bacula Director Makefile
4 # Copyright (C) 2000-2015 Kern Sibbald
5 # License: BSD 2-Clause; see file LICENSE-FOSS
16 basedir = @BUILD_DIR@/src
19 # this dir relative to top dir
24 GETTEXT_LIBS = @LIBINTL@
33 SVRSRCS = dird.c admin.c authenticate.c \
34 autoprune.c backup.c bsr.c \
35 catreq.c dir_plugins.c dird_conf.c expand.c \
36 fd_cmds.c getmsg.c inc_conf.c job.c \
37 jobq.c mac.c mac_sql.c \
38 mountreq.c msgchan.c next_vol.c newvol.c \
39 recycle.c restore.c run_conf.c \
41 ua_acl.c ua_cmds.c ua_dotcmds.c \
43 ua_input.c ua_label.c ua_output.c ua_prune.c \
44 ua_purge.c ua_restore.c ua_run.c \
45 ua_select.c ua_server.c snapshot.c \
46 ua_status.c ua_tree.c ua_update.c vbackup.c verify.c
47 SVROBJS = $(SVRSRCS:.c=.o)
49 # these are the objects that are changed by the .configure process
59 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
60 #-------------------------------------------------------------------------
61 all: Makefile bacula-dir @STATIC_DIR@
62 @echo "==== Make of dird is good ===="
65 bacula-dir: Makefile $(SVROBJS) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) \
66 ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) \
67 ../cats/libbaccats$(DEFAULT_ARCHIVE_TYPE) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE)
68 @echo "Linking $@ ..."
69 $(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -L../cats -L../findlib -o $@ $(SVROBJS) $(ZLIBS) \
70 -lbacfind -lbacsql -lbaccats -lbaccfg -lbac -lm $(DLIB) $(DB_LIBS) $(LIBS) \
71 $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(CAP_LIBS)
73 static-bacula-dir: Makefile $(SVROBJS) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) \
74 ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) \
75 ../cats/libbaccats$(DEFAULT_ARCHIVE_TYPE) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE)
76 $(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -L../cats -L../findlib -o $@ $(SVROBJS) $(ZLIBS) \
77 -lbacfind -lbacsql -lbaccats -lbaccfg -lbac -lm $(DLIB) $(DB_LIBS) $(LIBS) \
78 $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(CAP_LIBS)
81 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
83 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
86 @$(RMF) -r .libs _libs
89 @$(RMF) dird bacula-dir core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
90 @$(RMF) static-bacula-dir
93 @$(RMF) tags bacula-dir.conf
96 if test $(srcdir) = .; then $(MAKE) realclean; fi
97 (cd $(srcdir); $(RMF) Makefile)
100 if test $(srcdir) = .; then $(MAKE) realclean; fi
101 (cd $(srcdir); $(RMF) Makefile)
104 $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) bacula-dir $(DESTDIR)$(sbindir)/bacula-dir
105 @srcconf=bacula-dir.conf; \
106 if test -f ${DESTDIR}${sysconfdir}/$$srcconf; then \
107 destconf=$$srcconf.new; \
108 echo " ==> Found existing $$srcconf, installing new conf file as $$destconf"; \
110 destconf=$$srcconf; \
112 echo "${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf"; \
113 ${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf
114 @if test "x${dir_group}" != "x"; then \
115 chgrp -f ${dir_group} ${DESTDIR}${sysconfdir}/$$destconf ; \
117 @if test -f ${DESTDIR}${scriptdir}/query.sql; then \
118 echo " ==> Saving existing query.sql to query.sql.old"; \
119 $(MV) -f ${DESTDIR}${scriptdir}/query.sql ${DESTDIR}${scriptdir}/query.sql.old; \
121 ${INSTALL_DATA} query.sql ${DESTDIR}${scriptdir}/query.sql
122 @if test -f static-bacula-dir; then \
123 $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) static-bacula-dir $(DESTDIR)$(sbindir)/static-bacula-dir; \
128 (cd $(DESTDIR)$(sysconfdir); $(RMF) bacula-dir.conf bacula-dir.conf.new)
129 (cd $(DESTDIR)$(scriptdir); $(RMF) query.sql)
133 # Semi-automatic generation of dependencies:
134 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
135 # and it also includes system headers.
136 # `semi'-automatic since dependencies are generated at distribution time.
139 @$(MV) Makefile Makefile.bak
140 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
141 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
142 @$(CXX) -S -M $(CPPFLAGS) $(XINC) -I$(srcdir) -I$(basedir) *.c >> Makefile
143 @if test -f Makefile ; then \
144 $(RMF) Makefile.bak; \
146 $(MV) Makefile.bak Makefile; \
147 echo " ===== Something went wrong in make depend ====="; \
150 # -----------------------------------------------------------------------
151 # DO NOT DELETE: nice dependency list follows