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 = dird.o admin.o authenticate.o \
46 autoprune.o backup.o bsr.o \
47 catreq.o dir_plugins.o dird_conf.o expand.o \
48 fd_cmds.o getmsg.o inc_conf.o job.o \
50 mountreq.o msgchan.o next_vol.o newvol.o \
52 recycle.o restore.o run_conf.o \
54 ua_acl.o ua_cmds.o ua_dotcmds.o \
56 ua_input.o ua_label.o ua_output.o ua_prune.o \
57 ua_purge.o ua_restore.o ua_run.o \
58 ua_select.o ua_server.o \
59 ua_status.o ua_tree.o ua_update.o vbackup.o verify.o
61 # these are the objects that are changed by the .configure process
71 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
72 #-------------------------------------------------------------------------
73 all: Makefile bacula-dir @STATIC_DIR@
74 @echo "==== Make of dird is good ===="
77 bacula-dir: $(SVROBJS) ../lib/libbac.a ../cats/libsql.a ../findlib/libfind.a
78 @echo "Linking $@ ..."
79 $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -L../cats -L../findlib -o $@ $(SVROBJS) \
80 -lsql -lfind -lbac -lm $(PYTHON_LIBS) $(DLIB) $(DB_LIBS) $(LIBS) \
81 $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
84 static-bacula-dir: $(SVROBJS) ../lib/libbac.a ../cats/libsql.a ../findlib/libfind.a
85 $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -L../cats -L../findlib -o $@ $(SVROBJS) \
86 -lsql -lbac -lfind -lm $(PYTHON_LIBS) $(DLIB) $(DB_LIBS) $(LIBS) \
87 $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
91 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
93 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
96 @$(RMF) dird bacula-dir core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
97 @$(RMF) static-bacula-dir
100 @$(RMF) tags bacula-dir.conf
103 if test $(srcdir) = .; then $(MAKE) realclean; fi
104 (cd $(srcdir); $(RMF) Makefile)
107 if test $(srcdir) = .; then $(MAKE) realclean; fi
108 (cd $(srcdir); $(RMF) Makefile)
111 $(INSTALL_PROGRAM) bacula-dir $(DESTDIR)$(sbindir)/bacula-dir
112 @srcconf=bacula-dir.conf; \
113 if test -f ${DESTDIR}${sysconfdir}/$$srcconf; then \
114 destconf=$$srcconf.new; \
115 echo " ==> Found existing $$srcconf, installing new conf file as $$destconf"; \
117 destconf=$$srcconf; \
119 echo "${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf"; \
120 ${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf
121 @if test -f ${DESTDIR}${scriptdir}/query.sql; then \
122 echo " ==> Saving existing query.sql to query.sql.old"; \
123 $(MV) -f ${DESTDIR}${scriptdir}/query.sql ${DESTDIR}${scriptdir}/query.sql.old; \
125 ${INSTALL_DATA} query.sql ${DESTDIR}${scriptdir}/query.sql
126 @if test -f static-bacula-dir; then \
127 $(INSTALL_PROGRAM) static-bacula-dir $(DESTDIR)$(sbindir)/static-bacula-dir; \
132 (cd $(DESTDIR)$(sbindir); $(RMF) bacula-dir)
133 (cd $(DESTDIR)$(sysconfdir); $(RMF) bacula-dir.conf bacula-dir.conf.new)
134 (cd $(DESTDIR)$(scriptdir); $(RMF) query.sql)
138 # Semi-automatic generation of dependencies:
139 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
140 # and it also includes system headers.
141 # `semi'-automatic since dependencies are generated at distribution time.
144 @$(MV) Makefile Makefile.bak
145 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
146 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
147 @$(CXX) -S -M $(CPPFLAGS) $(XINC) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
148 @if test -f Makefile ; then \
149 $(RMF) Makefile.bak; \
151 $(MV) Makefile.bak Makefile; \
152 echo " ===== Something went wrong in make depend ====="; \
155 # -----------------------------------------------------------------------
156 # DO NOT DELETE: nice dependency list follows