2 # Bacula Makefile for the File daemon
17 # this dir relative to top dir
22 PYTHON_LIBS = @PYTHON_LIBS@
23 PYTHON_INC = @PYTHON_INCDIR@
29 SVRSRCS = filed.c authenticate.c acl.c backup.c chksum.c estimate.c \
30 filed_conf.c heartbeat.c job.c python.c \
31 restore.c status.c verify.c verify_vol.c
32 SVROBJS = filed.o authenticate.o acl.o backup.o chksum.o estimate.o \
33 filed_conf.o heartbeat.o job.o python.o \
34 restore.o status.o verify.o verify_vol.o
36 # these are the objects that are changed by the .configure process
39 FDLIBS = @FDLIBS@ # extra libs for File daemon
41 # extra items for linking on Win32
42 WIN32OBJS = win32/winmain.o win32/winlib.a win32/winres.res
43 win32 = $(WIN32OBJS) -luser32 -lgdi32
45 WIN32LIBS = $(@WIN32@)
53 $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
54 #-------------------------------------------------------------------------
55 all: Makefile @WIN32@ bacula-fd @STATIC_FD@
56 @echo "==== Make of filed is good ===="
60 (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
64 (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
68 (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
71 # win32 libraries if needed
73 (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
76 bacula-fd: $(SVROBJS) ../findlib/libfind.a ../lib/libbac.a @WIN32@
77 $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(SVROBJS) \
78 $(WIN32LIBS) $(FDLIBS) -lfind -lbac -lm $(PYTHON_LIBS) $(LIBS) $(DLIB)
80 static-bacula-fd: $(SVROBJS) ../findlib/libfind.a ../lib/libbac.a @WIN32@
81 $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -L../findlib -o $@ $(SVROBJS) \
82 $(WIN32LIBS) $(FDLIBS) -lfind -lbac -lm $(PYTHON_LIBS) $(LIBS) $(DLIB)
86 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
88 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
91 @$(RMF) bacula-fd filed core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
92 @$(RMF) static-bacula-fd
93 if test -f win32/Makefile; then \
94 (cd win32; $(MAKE) clean); \
98 @$(RMF) tags bacula-fd.conf
101 if test $(srcdir) = .; then $(MAKE) realclean; fi
102 (cd $(srcdir); $(RMF) Makefile; $(RMF) -r CVS)
103 if test -f win32/Makefile; then \
104 (cd win32; $(MAKE) distclean); \
108 if test $(srcdir) = .; then $(MAKE) realclean; fi
109 (cd $(srcdir); $(RMF) Makefile)
110 if test -f win32/Makefile; then \
111 (cd win32; $(MAKE) devclean); \
115 $(INSTALL_PROGRAM) bacula-fd $(DESTDIR)$(sbindir)/bacula-fd
116 @srcconf=bacula-fd.conf; \
117 if test -f ${DESTDIR}${sysconfdir}/$$srcconf; then \
118 destconf=$$srcconf.new; \
119 echo " ==> Found existing $$srcconf, installing new conf file as $$destconf"; \
121 destconf=$$srcconf; \
123 echo "${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf"; \
124 ${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf
125 @if test -f static-bacula-fd; then \
126 $(INSTALL_PROGRAM) static-bacula-fd $(DESTDIR)$(sbindir)/static-bacula-fd; \
132 (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd)
133 (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd.conf)
134 (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd.conf.new)
138 # Semi-automatic generation of dependencies:
139 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
140 # and it also includes system headers.
141 # `semi'-automatic since dependencies are generated at distribution time.
144 @$(MV) Makefile Makefile.bak
145 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
146 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
147 @$(CXX) -S -M $(CPPFLAGS) $(XINC) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
148 @if test -f Makefile ; then \
149 $(RMF) Makefile.bak; \
151 $(MV) Makefile.bak Makefile; \
152 echo " ===== Something went wrong in make depend ====="; \
155 # -----------------------------------------------------------------------
156 # DO NOT DELETE: nice dependency list follows