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 xattr.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 @if test -f win32/Makefile -a "${GMAKE}" != "none"; then \
63 (cd win32; $(GMAKE) DESTDIR=$(DESTDIR)); \
68 @if test -f win32/Makefile -a "${GMAKE}" != "none"; then \
69 (cd win32; $(GMAKE) DESTDIR=$(DESTDIR)); \
74 @if test -f win32/Makefile -a "${GMAKE}" != "none"; then \
75 (cd win32; $(GMAKE) DESTDIR=$(DESTDIR)); \
79 # win32 libraries if needed
81 @if test -f win32/Makefile -a "${GMAKE}" != "none"; then \
82 (cd win32; $(GMAKE) DESTDIR=$(DESTDIR)); \
86 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@
87 @echo "Linking $@ ..."
88 $(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(SVROBJS) \
89 $(WIN32LIBS) $(FDLIBS) -lbacfind -lbacpy -lbaccfg -lbac -lm $(PYTHON_LIBS) $(LIBS) \
90 $(DLIB) $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
92 static-bacula-fd: Makefile $(SVROBJS) ../findlib/libbacfind.a ../lib/libbacpy$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) @WIN32@
93 $(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -L../findlib -o $@ $(SVROBJS) \
94 $(WIN32LIBS) $(FDLIBS) -lbacfind -lbacpy -lbaccfg -lbac -lm $(PYTHON_LIBS) $(LIBS) \
95 $(DLIB) $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
98 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
100 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
103 @$(RMF) -r .libs _libs
106 @$(RMF) bacula-fd filed core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
107 @$(RMF) static-bacula-fd
108 @if test -f win32/Makefile -a "${GMAKE}" != "none"; then \
109 (cd win32; $(GMAKE) clean); \
113 @$(RMF) tags bacula-fd.conf
116 if test $(srcdir) = .; then $(MAKE) realclean; fi
117 (cd $(srcdir); $(RMF) Makefile)
118 @if test -f win32/Makefile -a "${GMAKE}" != "none"; then \
119 (cd win32; $(GMAKE) distclean); \
123 if test $(srcdir) = .; then $(MAKE) realclean; fi
124 (cd $(srcdir); $(RMF) Makefile)
125 @if test -f win32/Makefile -a "${GMAKE}" != "none"; then \
126 (cd win32; $(GMAKE) devclean); \
130 $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) bacula-fd $(DESTDIR)$(sbindir)/bacula-fd
131 @srcconf=bacula-fd.conf; \
132 if test -f ${DESTDIR}${sysconfdir}/$$srcconf; then \
133 destconf=$$srcconf.new; \
134 echo " ==> Found existing $$srcconf, installing new conf file as $$destconf"; \
136 destconf=$$srcconf; \
138 echo "${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf"; \
139 ${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf
140 @if test -f static-bacula-fd; then \
141 $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) static-bacula-fd $(DESTDIR)$(sbindir)/static-bacula-fd; \
147 (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd)
148 (cd $(DESTDIR)$(sysconfdir); $(RMF) bacula-fd.conf)
149 (cd $(DESTDIR)$(sysconfdir); $(RMF) bacula-fd.conf.new)
153 # Semi-automatic generation of dependencies:
154 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
155 # and it also includes system headers.
156 # `semi'-automatic since dependencies are generated at distribution time.
159 @$(MV) Makefile Makefile.bak
160 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
161 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
162 @$(CXX) -S -M $(CPPFLAGS) $(XINC) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
163 @if test -f Makefile ; then \
164 $(RMF) Makefile.bak; \
166 $(MV) Makefile.bak Makefile; \
167 echo " ===== Something went wrong in make depend ====="; \
170 # -----------------------------------------------------------------------
171 # DO NOT DELETE: nice dependency list follows