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 filed_conf.c heartbeat.c job.c pythonfd.c \
33 restore.c status.c verify.c verify_vol.c
34 SVROBJS = filed.o authenticate.o acl.o backup.o estimate.o \
35 filed_conf.o heartbeat.o job.o pythonfd.o \
36 restore.o status.o verify.o verify_vol.o
38 # these are the objects that are changed by the .configure process
41 FDLIBS = @FDLIBS@ # extra libs for File daemon
43 # extra items for linking on Win32
44 WIN32OBJS = win32/winmain.o win32/winlib.a win32/winres.res
45 win32 = $(WIN32OBJS) -luser32 -lgdi32
47 WIN32LIBS = $(@WIN32@)
56 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_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 @echo "Linking $@ ..."
81 $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(SVROBJS) \
82 $(WIN32LIBS) $(FDLIBS) -lfind -lbac -lm $(PYTHON_LIBS) $(LIBS) \
83 $(DLIB) $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
85 static-bacula-fd: $(SVROBJS) ../findlib/libfind.a ../lib/libbac.a @WIN32@
86 $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -L../findlib -o $@ $(SVROBJS) \
87 $(WIN32LIBS) $(FDLIBS) -lfind -lbac -lm $(PYTHON_LIBS) $(LIBS) \
88 $(DLIB) $(WRAPLIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
92 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
94 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
97 @$(RMF) bacula-fd filed core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
98 @$(RMF) static-bacula-fd
99 if test -f win32/Makefile; then \
100 (cd win32; $(MAKE) clean); \
104 @$(RMF) tags bacula-fd.conf
107 if test $(srcdir) = .; then $(MAKE) realclean; fi
108 (cd $(srcdir); $(RMF) Makefile)
109 if test -f win32/Makefile; then \
110 (cd win32; $(MAKE) distclean); \
114 if test $(srcdir) = .; then $(MAKE) realclean; fi
115 (cd $(srcdir); $(RMF) Makefile)
116 if test -f win32/Makefile; then \
117 (cd win32; $(MAKE) devclean); \
121 $(INSTALL_PROGRAM) bacula-fd $(DESTDIR)$(sbindir)/bacula-fd
122 @srcconf=bacula-fd.conf; \
123 if test -f ${DESTDIR}${sysconfdir}/$$srcconf; then \
124 destconf=$$srcconf.new; \
125 echo " ==> Found existing $$srcconf, installing new conf file as $$destconf"; \
127 destconf=$$srcconf; \
129 echo "${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf"; \
130 ${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf
131 @if test -f static-bacula-fd; then \
132 $(INSTALL_PROGRAM) static-bacula-fd $(DESTDIR)$(sbindir)/static-bacula-fd; \
138 (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd)
139 (cd $(DESTDIR)$(sysconfdir); $(RMF) bacula-fd.conf)
140 (cd $(DESTDIR)$(sysconfdir); $(RMF) bacula-fd.conf.new)
144 # Semi-automatic generation of dependencies:
145 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
146 # and it also includes system headers.
147 # `semi'-automatic since dependencies are generated at distribution time.
150 @$(MV) Makefile Makefile.bak
151 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
152 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
153 @$(CXX) -S -M $(CPPFLAGS) $(XINC) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
154 @if test -f Makefile ; then \
155 $(RMF) Makefile.bak; \
157 $(MV) Makefile.bak Makefile; \
158 echo " ===== Something went wrong in make depend ====="; \
161 # -----------------------------------------------------------------------
162 # DO NOT DELETE: nice dependency list follows