2 # Bacula Makefile for the File daemon
18 # this dir relative to top dir
23 GETTEXT_LIBS = @LIBINTL@
25 PYTHON_LIBS = @PYTHON_LIBS@
26 PYTHON_INC = @PYTHON_INCDIR@
27 AFS_CFLAGS = @AFS_CFLAGS@
34 SVRSRCS = filed.c authenticate.c acl.c backup.c estimate.c \
35 fd_plugins.c accurate.c \
36 filed_conf.c heartbeat.c job.c pythonfd.c \
37 restore.c status.c verify.c verify_vol.c xattr.c
38 SVROBJS = $(SVRSRCS:.c=.o)
40 # these are the objects that are changed by the .configure process
44 FDLIBS = @FDLIBS@ # extra libs for File daemon
48 # extra items for linking on Win32
49 WIN32OBJS = win32/winmain.o win32/winlib.a win32/winres.res
50 win32 = $(WIN32OBJS) -luser32 -lgdi32
52 WIN32LIBS = $(@WIN32@)
61 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
62 #-------------------------------------------------------------------------
63 all: Makefile @WIN32@ bacula-fd @STATIC_FD@
64 @echo "==== Make of filed is good ===="
69 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $(AFS_CFLAGS) $<
72 @if test -f win32/Makefile -a "${GMAKE}" != "none"; then \
73 (cd win32; $(GMAKE) DESTDIR=$(DESTDIR)); \
78 @if test -f win32/Makefile -a "${GMAKE}" != "none"; then \
79 (cd win32; $(GMAKE) DESTDIR=$(DESTDIR)); \
84 @if test -f win32/Makefile -a "${GMAKE}" != "none"; then \
85 (cd win32; $(GMAKE) DESTDIR=$(DESTDIR)); \
89 # win32 libraries if needed
91 @if test -f win32/Makefile -a "${GMAKE}" != "none"; then \
92 (cd win32; $(GMAKE) DESTDIR=$(DESTDIR)); \
96 bacula-fd: Makefile $(SVROBJS) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbacpy$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) @WIN32@
97 @echo "Linking $@ ..."
98 $(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(SVROBJS) \
99 $(WIN32LIBS) $(FDLIBS) $(ZLIBS) -lbacfind -lbacpy -lbaccfg -lbac -lm $(PYTHON_LIBS) $(LIBS) \
100 $(DLIB) $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(CAP_LIBS) $(AFS_LIBS) $(LZOLIBS)
102 static-bacula-fd: Makefile $(SVROBJS) ../findlib/libbacfind.a ../lib/libbacpy$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) @WIN32@
103 $(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -L../findlib -o $@ $(SVROBJS) \
104 $(WIN32LIBS) $(FDLIBS) $(ZLIBS) -lbacfind -lbacpy -lbaccfg -lbac -lm $(PYTHON_LIBS) $(LIBS) \
105 $(DLIB) $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(CAP_LIBS) $(AFS_LIBS) $(LZOLIBS)
108 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
110 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
113 @$(RMF) -r .libs _libs
116 @$(RMF) bacula-fd filed core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
117 @$(RMF) static-bacula-fd
118 @if test -f win32/Makefile -a "${GMAKE}" != "none"; then \
119 (cd win32; $(GMAKE) clean); \
123 @$(RMF) tags bacula-fd.conf
126 if test $(srcdir) = .; then $(MAKE) realclean; fi
127 (cd $(srcdir); $(RMF) Makefile)
128 @if test -f win32/Makefile -a "${GMAKE}" != "none"; then \
129 (cd win32; $(GMAKE) distclean); \
133 if test $(srcdir) = .; then $(MAKE) realclean; fi
134 (cd $(srcdir); $(RMF) Makefile)
135 @if test -f win32/Makefile -a "${GMAKE}" != "none"; then \
136 (cd win32; $(GMAKE) devclean); \
140 $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) bacula-fd $(DESTDIR)$(sbindir)/bacula-fd
141 @srcconf=bacula-fd.conf; \
142 if test -f ${DESTDIR}${sysconfdir}/$$srcconf; then \
143 destconf=$$srcconf.new; \
144 echo " ==> Found existing $$srcconf, installing new conf file as $$destconf"; \
146 destconf=$$srcconf; \
148 echo "${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf"; \
149 ${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf
150 @if test "x${fd_group}" != "x"; then \
151 chgrp -f ${fd_group} ${DESTDIR}${sysconfdir}/$$destconf ; \
153 @if test -f static-bacula-fd; then \
154 $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) static-bacula-fd $(DESTDIR)$(sbindir)/static-bacula-fd; \
160 (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd)
161 (cd $(DESTDIR)$(sysconfdir); $(RMF) bacula-fd.conf)
162 (cd $(DESTDIR)$(sysconfdir); $(RMF) bacula-fd.conf.new)
166 # Semi-automatic generation of dependencies:
167 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
168 # and it also includes system headers.
169 # `semi'-automatic since dependencies are generated at distribution time.
172 @$(MV) Makefile Makefile.bak
173 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
174 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
175 @$(CXX) -S -M $(CPPFLAGS) $(AFS_CFLAGS) $(XINC) $(PYTHON_INC) -I$(srcdir) -I$(basedir) *.c >> Makefile
176 @if test -f Makefile ; then \
177 $(RMF) Makefile.bak; \
179 $(MV) Makefile.bak Makefile; \
180 echo " ===== Something went wrong in make depend ====="; \
183 # -----------------------------------------------------------------------
184 # DO NOT DELETE: nice dependency list follows