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 = filed.o authenticate.o acl.o backup.o estimate.o \
36 fd_plugins.o accurate.o \
37 filed_conf.o heartbeat.o job.o pythonfd.o \
38 restore.o status.o verify.o verify_vol.o
40 # these are the objects that are changed by the .configure process
43 FDLIBS = @FDLIBS@ # extra libs for File daemon
45 # extra items for linking on Win32
46 WIN32OBJS = win32/winmain.o win32/winlib.a win32/winres.res
47 win32 = $(WIN32OBJS) -luser32 -lgdi32
49 WIN32LIBS = $(@WIN32@)
58 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
59 #-------------------------------------------------------------------------
60 all: Makefile @WIN32@ bacula-fd @STATIC_FD@
61 @echo "==== Make of filed is good ===="
65 (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
69 (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
73 (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
76 # win32 libraries if needed
78 (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
81 bacula-fd: $(SVROBJS) ../findlib/libfind.a ../lib/libbac.a @WIN32@
82 @echo "Linking $@ ..."
83 $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(SVROBJS) \
84 $(WIN32LIBS) $(FDLIBS) -lfind -lbac -lm $(PYTHON_LIBS) $(LIBS) \
85 $(DLIB) $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
87 static-bacula-fd: $(SVROBJS) ../findlib/libfind.a ../lib/libbac.a @WIN32@
88 $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -L../findlib -o $@ $(SVROBJS) \
89 $(WIN32LIBS) $(FDLIBS) -lfind -lbac -lm $(PYTHON_LIBS) $(LIBS) \
90 $(DLIB) $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
94 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
96 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
99 @$(RMF) bacula-fd filed core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
100 @$(RMF) static-bacula-fd
101 if test -f win32/Makefile; then \
102 (cd win32; $(MAKE) clean); \
106 @$(RMF) tags bacula-fd.conf
109 if test $(srcdir) = .; then $(MAKE) realclean; fi
110 (cd $(srcdir); $(RMF) Makefile)
111 if test -f win32/Makefile; then \
112 (cd win32; $(MAKE) distclean); \
116 if test $(srcdir) = .; then $(MAKE) realclean; fi
117 (cd $(srcdir); $(RMF) Makefile)
118 if test -f win32/Makefile; then \
119 (cd win32; $(MAKE) devclean); \
123 $(INSTALL_PROGRAM) bacula-fd $(DESTDIR)$(sbindir)/bacula-fd
124 @srcconf=bacula-fd.conf; \
125 if test -f ${DESTDIR}${sysconfdir}/$$srcconf; then \
126 destconf=$$srcconf.new; \
127 echo " ==> Found existing $$srcconf, installing new conf file as $$destconf"; \
129 destconf=$$srcconf; \
131 echo "${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf"; \
132 ${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf
133 @if test -f static-bacula-fd; then \
134 $(INSTALL_PROGRAM) static-bacula-fd $(DESTDIR)$(sbindir)/static-bacula-fd; \
140 (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd)
141 (cd $(DESTDIR)$(sysconfdir); $(RMF) bacula-fd.conf)
142 (cd $(DESTDIR)$(sysconfdir); $(RMF) bacula-fd.conf.new)
146 # Semi-automatic generation of dependencies:
147 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
148 # and it also includes system headers.
149 # `semi'-automatic since dependencies are generated at distribution time.
152 @$(MV) Makefile Makefile.bak
153 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
154 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
155 @$(CXX) -S -M $(CPPFLAGS) $(XINC) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
156 @if test -f Makefile ; then \
157 $(RMF) Makefile.bak; \
159 $(MV) Makefile.bak Makefile; \
160 echo " ===== Something went wrong in make depend ====="; \
163 # -----------------------------------------------------------------------
164 # DO NOT DELETE: nice dependency list follows