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