2 # Bacula Makefile for the File daemon
17 # this dir relative to top dir
22 GETTEXT_LIBS = @LIBINTL@
24 PYTHON_LIBS = @PYTHON_LIBS@
25 PYTHON_INC = @PYTHON_INCDIR@
31 SVRSRCS = filed.c authenticate.c acl.c backup.c estimate.c \
32 fd_plugins.c accurate.c \
33 filed_conf.c heartbeat.c job.c pythonfd.c \
34 restore.c status.c verify.c verify_vol.c
35 SVROBJS = $(SVRSRCS:.c=.o)
37 # these are the objects that are changed by the .configure process
40 FDLIBS = @FDLIBS@ # extra libs for File daemon
42 # extra items for linking on Win32
43 WIN32OBJS = win32/winmain.o win32/winlib.a win32/winres.res
44 win32 = $(WIN32OBJS) -luser32 -lgdi32
46 WIN32LIBS = $(@WIN32@)
55 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
56 #-------------------------------------------------------------------------
57 all: Makefile @WIN32@ bacula-fd @STATIC_FD@
58 @echo "==== Make of filed is good ===="
62 (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
66 (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
70 (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
73 # win32 libraries if needed
75 (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
78 bacula-fd: $(SVROBJS) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbacpy$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) @WIN32@
79 @echo "Linking $@ ..."
80 $(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(SVROBJS) \
81 $(WIN32LIBS) $(FDLIBS) -lbacfind -lbacpy -lbaccfg -lbac -lm $(PYTHON_LIBS) $(LIBS) \
82 $(DLIB) $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
84 static-bacula-fd: $(SVROBJS) ../findlib/libbacfind.a ../lib/libbacpy$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) @WIN32@
85 $(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -L../findlib -o $@ $(SVROBJS) \
86 $(WIN32LIBS) $(FDLIBS) -lbacfind -lbacpy -lbaccfg -lbac -lm $(PYTHON_LIBS) $(LIBS) \
87 $(DLIB) $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
90 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
92 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
97 clean: @LIBTOOL_CLEAN_TARGET@
98 @$(RMF) bacula-fd filed core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
99 @$(RMF) static-bacula-fd
100 if test -f win32/Makefile; then \
101 (cd win32; $(MAKE) clean); \
105 @$(RMF) tags bacula-fd.conf
108 if test $(srcdir) = .; then $(MAKE) realclean; fi
109 (cd $(srcdir); $(RMF) Makefile)
110 if test -f win32/Makefile; then \
111 (cd win32; $(MAKE) distclean); \
115 if test $(srcdir) = .; then $(MAKE) realclean; fi
116 (cd $(srcdir); $(RMF) Makefile)
117 if test -f win32/Makefile; then \
118 (cd win32; $(MAKE) devclean); \
122 $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) bacula-fd $(DESTDIR)$(sbindir)/bacula-fd
123 @srcconf=bacula-fd.conf; \
124 if test -f ${DESTDIR}${sysconfdir}/$$srcconf; then \
125 destconf=$$srcconf.new; \
126 echo " ==> Found existing $$srcconf, installing new conf file as $$destconf"; \
128 destconf=$$srcconf; \
130 echo "${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf"; \
131 ${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf
132 @if test -f static-bacula-fd; then \
133 $(LIBTOOL_INSTALL) install $(INSTALL_PROGRAM) static-bacula-fd $(DESTDIR)$(sbindir)/static-bacula-fd; \
139 (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd)
140 (cd $(DESTDIR)$(sysconfdir); $(RMF) bacula-fd.conf)
141 (cd $(DESTDIR)$(sysconfdir); $(RMF) bacula-fd.conf.new)
145 # Semi-automatic generation of dependencies:
146 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
147 # and it also includes system headers.
148 # `semi'-automatic since dependencies are generated at distribution time.
151 @$(MV) Makefile Makefile.bak
152 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
153 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
154 @$(CXX) -S -M $(CPPFLAGS) $(XINC) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
155 @if test -f Makefile ; then \
156 $(RMF) Makefile.bak; \
158 $(MV) Makefile.bak Makefile; \
159 echo " ===== Something went wrong in make depend ====="; \
162 # -----------------------------------------------------------------------
163 # DO NOT DELETE: nice dependency list follows