2 # Bacula Makefile for the File daemon
17 # this dir relative to top dir
22 OPENSSL_LIBS = @OPENSSL_LIBS@
23 OPENSSL_INC = @OPENSSL_INC@
25 PYTHON_LIBS = @PYTHON_LIBS@
26 PYTHON_INC = @PYTHON_INCDIR@
32 SVRSRCS = filed.c authenticate.c acl.c backup.c chksum.c estimate.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 chksum.o estimate.o \
36 filed_conf.o heartbeat.o job.o pythonfd.o \
37 restore.o status.o verify.o verify_vol.o
39 # these are the objects that are changed by the .configure process
42 FDLIBS = @FDLIBS@ # extra libs for File daemon
44 # extra items for linking on Win32
45 WIN32OBJS = win32/winmain.o win32/winlib.a win32/winres.res
46 win32 = $(WIN32OBJS) -luser32 -lgdi32
48 WIN32LIBS = $(@WIN32@)
56 $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) $(OPENSSL_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
57 #-------------------------------------------------------------------------
58 all: Makefile @WIN32@ bacula-fd @STATIC_FD@
59 @echo "==== Make of filed is good ===="
63 (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
67 (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
71 (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
74 # win32 libraries if needed
76 (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
79 bacula-fd: $(SVROBJS) ../findlib/libfind.a ../lib/libbac.a @WIN32@
80 $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(SVROBJS) \
81 $(WIN32LIBS) $(FDLIBS) -lfind -lbac -lm $(PYTHON_LIBS) $(LIBS) $(DLIB) $(OPENSSL_LIBS)
83 static-bacula-fd: $(SVROBJS) ../findlib/libfind.a ../lib/libbac.a @WIN32@
84 $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -L../findlib -o $@ $(SVROBJS) \
85 $(WIN32LIBS) $(FDLIBS) -lfind -lbac -lm $(PYTHON_LIBS) $(LIBS) $(DLIB) $(OPENSSL_LIBS)
89 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
91 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
94 @$(RMF) bacula-fd filed core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
95 @$(RMF) static-bacula-fd
96 if test -f win32/Makefile; then \
97 (cd win32; $(MAKE) clean); \
101 @$(RMF) tags bacula-fd.conf
104 if test $(srcdir) = .; then $(MAKE) realclean; fi
105 (cd $(srcdir); $(RMF) Makefile; $(RMF) -r CVS)
106 if test -f win32/Makefile; then \
107 (cd win32; $(MAKE) distclean); \
111 if test $(srcdir) = .; then $(MAKE) realclean; fi
112 (cd $(srcdir); $(RMF) Makefile)
113 if test -f win32/Makefile; then \
114 (cd win32; $(MAKE) devclean); \
118 $(INSTALL_PROGRAM) bacula-fd $(DESTDIR)$(sbindir)/bacula-fd
119 @srcconf=bacula-fd.conf; \
120 if test -f ${DESTDIR}${sysconfdir}/$$srcconf; then \
121 destconf=$$srcconf.new; \
122 echo " ==> Found existing $$srcconf, installing new conf file as $$destconf"; \
124 destconf=$$srcconf; \
126 echo "${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf"; \
127 ${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf
128 @if test -f static-bacula-fd; then \
129 $(INSTALL_PROGRAM) static-bacula-fd $(DESTDIR)$(sbindir)/static-bacula-fd; \
135 (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd)
136 (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd.conf)
137 (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd.conf.new)
141 # Semi-automatic generation of dependencies:
142 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
143 # and it also includes system headers.
144 # `semi'-automatic since dependencies are generated at distribution time.
147 @$(MV) Makefile Makefile.bak
148 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
149 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
150 @$(CXX) -S -M $(CPPFLAGS) $(XINC) $(PYTHON_INC) $(OPENSSL_INC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
151 @if test -f Makefile ; then \
152 $(RMF) Makefile.bak; \
154 $(MV) Makefile.bak Makefile; \
155 echo " ===== Something went wrong in make depend ====="; \
158 # -----------------------------------------------------------------------
159 # DO NOT DELETE: nice dependency list follows