2 # Bacula Director Makefile
16 # this dir relative to top dir
25 SVRSRCS = dird.c admin.c authenticate.c \
26 autoprune.c backup.c bsr.c \
27 catreq.c dird_conf.c expand.c \
28 fd_cmds.c getmsg.c inc_conf.c job.c \
29 jobq.c mountreq.c msgchan.c next_vol.c newvol.c \
30 recycle.c restore.c run_conf.c \
31 scheduler.c sql_cmds.c \
32 ua_acl.c ua_cmds.c ua_dotcmds.c \
34 ua_input.c ua_label.c ua_output.c ua_prune.c \
35 ua_purge.c ua_restore.c ua_run.c \
36 ua_select.c ua_server.c \
37 ua_status.c ua_tree.c verify.c
38 SVROBJS = dird.o admin.o authenticate.o \
39 autoprune.o backup.o bsr.o \
40 catreq.o dird_conf.o expand.o \
41 fd_cmds.o getmsg.o inc_conf.o job.o \
42 jobq.o mountreq.o msgchan.o next_vol.o newvol.o \
43 recycle.o restore.o run_conf.o \
44 scheduler.o sql_cmds.o \
45 ua_acl.o ua_cmds.o ua_dotcmds.o \
47 ua_input.o ua_label.o ua_output.o ua_prune.o \
48 ua_purge.o ua_restore.o ua_run.o \
49 ua_select.o ua_server.o \
50 ua_status.o ua_tree.o verify.o
52 # these are the objects that are changed by the .configure process
61 $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
62 #-------------------------------------------------------------------------
63 all: Makefile bacula-dir @STATIC_DIR@
64 @echo "==== Make of dird is good ===="
67 bacula-dir: $(SVROBJS) ../lib/libbac.a ../cats/libsql.a ../findlib/libfind.a
68 $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -L../cats -L../findlib -o $@ $(SVROBJS) \
69 -lsql -lbac -lfind -lm $(DLIB) $(DB_LIBS) $(LIBS)
71 static-bacula-dir: $(SVROBJS) ../lib/libbac.a ../cats/libsql.a ../findlib/libfind.a
72 $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -L../cats -L../findlib -o $@ $(SVROBJS) \
73 -lsql -lbac -lfind -lm $(DLIB) $(DB_LIBS) $(LIBS)
77 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
79 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
82 @$(RMF) dird bacula-dir core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
83 @$(RMF) static-bacula-dir
86 @$(RMF) tags bacula-dir.conf
89 if test $(srcdir) = .; then $(MAKE) realclean; fi
90 (cd $(srcdir); $(RMF) Makefile; $(RMF) -r CVS)
93 if test $(srcdir) = .; then $(MAKE) realclean; fi
94 (cd $(srcdir); $(RMF) Makefile)
97 $(INSTALL_PROGRAM) bacula-dir $(DESTDIR)$(sbindir)/bacula-dir
98 @srcconf=bacula-dir.conf; \
99 if test -f ${DESTDIR}${sysconfdir}/$$srcconf; then \
100 destconf=$$srcconf.new; \
101 echo " ==> Found existing $$srcconf, installing new conf file as $$destconf"; \
103 destconf=$$srcconf; \
105 echo "${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf"; \
106 ${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf
107 if test -f ${DESTDIR}${scriptdir}/query.sql; then \
108 $(MV) -f ${DESTDIR}${scriptdir}/query.sql ${DESTDIR}${scriptdir}/query.sql.save; \
110 ${INSTALL_DATA} query.sql ${DESTDIR}${scriptdir}/query.sql
111 @if test -f static-bacula-dir; then \
112 $(INSTALL_PROGRAM) static-bacula-dir $(DESTDIR)$(sbindir)/static-bacula-dir; \
117 (cd $(DESTDIR)$(sbindir); $(RMF) bacula-dir)
118 (cd $(DESTDIR)$(sysconfdir); $(RMF) bacula-dir.conf bacula-dir.conf.new)
119 (cd $(DESTDIR)$(scriptdir); $(RMF) query.sql)
123 # Semi-automatic generation of dependencies:
124 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
125 # and it also includes system headers.
126 # `semi'-automatic since dependencies are generated at distribution time.
129 @$(MV) Makefile Makefile.bak
130 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
131 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
132 @$(CC) -S -M $(CPPFLAGS) $(XINC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
133 @if test -f Makefile ; then \
134 $(RMF) Makefile.bak; \
136 $(MV) Makefile.bak Makefile; \
137 echo -e "Something went wrong\n\a"; \
140 # -----------------------------------------------------------------------
141 # DO NOT DELETE: nice dependency list follows