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@
32 SVRSRCS = filed.c authenticate.c acl.c backup.c estimate.c \
33 fd_plugins.c accurate.c \
34 filed_conf.c heartbeat.c job.c pythonfd.c \
35 restore.c status.c verify.c verify_vol.c xattr.c
36 SVROBJS = $(SVRSRCS:.c=.o)
38 # these are the objects that are changed by the .configure process
42 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) $<
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) $(LZOLIBS) -lbacfind -lbacpy -lbaccfg -lbac -lm $(PYTHON_LIBS) $(LIBS) \
98 $(DLIB) $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(CAP_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) $(LZOLIBS) -lbacfind -lbacpy -lbaccfg -lbac -lm $(PYTHON_LIBS) $(LIBS) \
103 $(DLIB) $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) $(CAP_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 "x${fd_group}" != "x"; then \
149 chgrp -f ${fd_group} ${DESTDIR}${sysconfdir}/$$destconf ; \
151 @if test -f static-bacula-fd; then \
152 $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) static-bacula-fd $(DESTDIR)$(sbindir)/static-bacula-fd; \
158 (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd)
159 (cd $(DESTDIR)$(sysconfdir); $(RMF) bacula-fd.conf)
160 (cd $(DESTDIR)$(sysconfdir); $(RMF) bacula-fd.conf.new)
164 # Semi-automatic generation of dependencies:
165 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
166 # and it also includes system headers.
167 # `semi'-automatic since dependencies are generated at distribution time.
170 @$(MV) Makefile Makefile.bak
171 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
172 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
173 @$(CXX) -S -M $(CPPFLAGS) $(XINC) $(PYTHON_INC) -I$(srcdir) -I$(basedir) *.c >> Makefile
174 @if test -f Makefile ; then \
175 $(RMF) Makefile.bak; \
177 $(MV) Makefile.bak Makefile; \
178 echo " ===== Something went wrong in make depend ====="; \
181 # -----------------------------------------------------------------------
182 # DO NOT DELETE: nice dependency list follows