2 # Bacula Makefile for the File daemon
17 # this dir relative to top dir
22 GETTEXT_LIBS = @LIBINTL@
24 OPENSSL_LIBS = @OPENSSL_LIBS@
25 OPENSSL_INC = @OPENSSL_INC@
27 PYTHON_LIBS = @PYTHON_LIBS@
28 PYTHON_INC = @PYTHON_INCDIR@
34 SVRSRCS = filed.c authenticate.c acl.c backup.c estimate.c \
35 filed_conf.c heartbeat.c job.c pythonfd.c \
36 restore.c status.c verify.c verify_vol.c
37 SVROBJS = filed.o authenticate.o acl.o backup.o estimate.o \
38 filed_conf.o heartbeat.o job.o pythonfd.o \
39 restore.o status.o verify.o verify_vol.o
41 # these are the objects that are changed by the .configure process
44 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) $(OPENSSL_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
60 #-------------------------------------------------------------------------
61 all: Makefile @WIN32@ bacula-fd @STATIC_FD@
62 @echo "==== Make of filed is good ===="
66 (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
70 (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
74 (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
77 # win32 libraries if needed
79 (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
82 bacula-fd: $(SVROBJS) ../findlib/libfind.a ../lib/libbac.a @WIN32@
83 @echo "Linking $@ ..."
84 $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(SVROBJS) \
85 $(WIN32LIBS) $(FDLIBS) -lfind -lbac -lm $(PYTHON_LIBS) $(LIBS) \
86 $(DLIB) $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
88 static-bacula-fd: $(SVROBJS) ../findlib/libfind.a ../lib/libbac.a @WIN32@
89 $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -L../findlib -o $@ $(SVROBJS) \
90 $(WIN32LIBS) $(FDLIBS) -lfind -lbac -lm $(PYTHON_LIBS) $(LIBS) \
91 $(DLIB) $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
95 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
97 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
100 @$(RMF) bacula-fd filed core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
101 @$(RMF) static-bacula-fd
102 if test -f win32/Makefile; then \
103 (cd win32; $(MAKE) clean); \
107 @$(RMF) tags bacula-fd.conf
110 if test $(srcdir) = .; then $(MAKE) realclean; fi
111 (cd $(srcdir); $(RMF) Makefile)
112 if test -f win32/Makefile; then \
113 (cd win32; $(MAKE) distclean); \
117 if test $(srcdir) = .; then $(MAKE) realclean; fi
118 (cd $(srcdir); $(RMF) Makefile)
119 if test -f win32/Makefile; then \
120 (cd win32; $(MAKE) devclean); \
124 $(INSTALL_PROGRAM) bacula-fd $(DESTDIR)$(sbindir)/bacula-fd
125 @srcconf=bacula-fd.conf; \
126 if test -f ${DESTDIR}${sysconfdir}/$$srcconf; then \
127 destconf=$$srcconf.new; \
128 echo " ==> Found existing $$srcconf, installing new conf file as $$destconf"; \
130 destconf=$$srcconf; \
132 echo "${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf"; \
133 ${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf
134 @if test -f static-bacula-fd; then \
135 $(INSTALL_PROGRAM) static-bacula-fd $(DESTDIR)$(sbindir)/static-bacula-fd; \
141 (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd)
142 (cd $(DESTDIR)$(sysconfdir); $(RMF) bacula-fd.conf)
143 (cd $(DESTDIR)$(sysconfdir); $(RMF) bacula-fd.conf.new)
147 # Semi-automatic generation of dependencies:
148 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
149 # and it also includes system headers.
150 # `semi'-automatic since dependencies are generated at distribution time.
153 @$(MV) Makefile Makefile.bak
154 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
155 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
156 @$(CXX) -S -M $(CPPFLAGS) $(XINC) $(PYTHON_INC) $(OPENSSL_INC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
157 @if test -f Makefile ; then \
158 $(RMF) Makefile.bak; \
160 $(MV) Makefile.bak Makefile; \
161 echo " ===== Something went wrong in make depend ====="; \
164 # -----------------------------------------------------------------------
165 # DO NOT DELETE: nice dependency list follows