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@
26 AFS_CFLAGS = @AFS_CFLAGS@
33 SVRSRCS = filed.c authenticate.c acl.c backup.c estimate.c \
34 fd_plugins.c accurate.c \
35 filed_conf.c heartbeat.c job.c pythonfd.c \
36 restore.c status.c verify.c verify_vol.c xattr.c
37 SVROBJS = $(SVRSRCS:.c=.o)
39 # these are the objects that are changed by the .configure process
43 FDLIBS = @FDLIBS@ # extra libs for File daemon
46 # extra items for linking on Win32
47 WIN32OBJS = win32/winmain.o win32/winlib.a win32/winres.res
48 win32 = $(WIN32OBJS) -luser32 -lgdi32
50 WIN32LIBS = $(@WIN32@)
59 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
60 #-------------------------------------------------------------------------
61 all: Makefile @WIN32@ bacula-fd @STATIC_FD@
62 @echo "==== Make of filed is good ===="
67 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $(AFS_CFLAGS) $<
70 @if test -f win32/Makefile -a "${GMAKE}" != "none"; then \
71 (cd win32; $(GMAKE) DESTDIR=$(DESTDIR)); \
76 @if test -f win32/Makefile -a "${GMAKE}" != "none"; then \
77 (cd win32; $(GMAKE) DESTDIR=$(DESTDIR)); \
82 @if test -f win32/Makefile -a "${GMAKE}" != "none"; then \
83 (cd win32; $(GMAKE) DESTDIR=$(DESTDIR)); \
87 # win32 libraries if needed
89 @if test -f win32/Makefile -a "${GMAKE}" != "none"; then \
90 (cd win32; $(GMAKE) DESTDIR=$(DESTDIR)); \
94 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@
95 @echo "Linking $@ ..."
96 $(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(SVROBJS) \
97 $(WIN32LIBS) $(FDLIBS) $(ZLIBS) -lbacfind -lbacpy -lbaccfg -lbac -lm $(PYTHON_LIBS) $(LIBS) \
98 $(DLIB) $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(CAP_LIBS) $(AFS_LIBS)
100 static-bacula-fd: Makefile $(SVROBJS) ../findlib/libbacfind.a ../lib/libbacpy$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) @WIN32@
101 $(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -L../findlib -o $@ $(SVROBJS) \
102 $(WIN32LIBS) $(FDLIBS) $(ZLIBS) -lbacfind -lbacpy -lbaccfg -lbac -lm $(PYTHON_LIBS) $(LIBS) \
103 $(DLIB) $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(CAP_LIBS) $(AFS_LIBS)
106 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
108 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
111 @$(RMF) -r .libs _libs
114 @$(RMF) bacula-fd filed core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
115 @$(RMF) static-bacula-fd
116 @if test -f win32/Makefile -a "${GMAKE}" != "none"; then \
117 (cd win32; $(GMAKE) clean); \
121 @$(RMF) tags bacula-fd.conf
124 if test $(srcdir) = .; then $(MAKE) realclean; fi
125 (cd $(srcdir); $(RMF) Makefile)
126 @if test -f win32/Makefile -a "${GMAKE}" != "none"; then \
127 (cd win32; $(GMAKE) distclean); \
131 if test $(srcdir) = .; then $(MAKE) realclean; fi
132 (cd $(srcdir); $(RMF) Makefile)
133 @if test -f win32/Makefile -a "${GMAKE}" != "none"; then \
134 (cd win32; $(GMAKE) devclean); \
138 $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) bacula-fd $(DESTDIR)$(sbindir)/bacula-fd
139 @srcconf=bacula-fd.conf; \
140 if test -f ${DESTDIR}${sysconfdir}/$$srcconf; then \
141 destconf=$$srcconf.new; \
142 echo " ==> Found existing $$srcconf, installing new conf file as $$destconf"; \
144 destconf=$$srcconf; \
146 echo "${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf"; \
147 ${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf
148 @if test -f static-bacula-fd; then \
149 $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) static-bacula-fd $(DESTDIR)$(sbindir)/static-bacula-fd; \
155 (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd)
156 (cd $(DESTDIR)$(sysconfdir); $(RMF) bacula-fd.conf)
157 (cd $(DESTDIR)$(sysconfdir); $(RMF) bacula-fd.conf.new)
161 # Semi-automatic generation of dependencies:
162 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
163 # and it also includes system headers.
164 # `semi'-automatic since dependencies are generated at distribution time.
167 @$(MV) Makefile Makefile.bak
168 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
169 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
170 @$(CXX) -S -M $(CPPFLAGS) $(XINC) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
171 @if test -f Makefile ; then \
172 $(RMF) Makefile.bak; \
174 $(MV) Makefile.bak Makefile; \
175 echo " ===== Something went wrong in make depend ====="; \
178 # -----------------------------------------------------------------------
179 # DO NOT DELETE: nice dependency list follows