2 # Bacula Makefile for the File daemon
17 # this dir relative to top dir
26 SVRSRCS = filed.c authenticate.c backup.c estimate.c \
27 filed_conf.c heartbeat.c job.c \
28 restore.c status.c verify.c verify_vol.c
29 SVROBJS = filed.o authenticate.o backup.o estimate.o \
30 filed_conf.o heartbeat.o job.o \
31 restore.o status.o verify.o verify_vol.o
33 # these are the objects that are changed by the .configure process
36 FDLIBS = @FDLIBS@ # extra libs for File daemon
38 # extra items for linking on Win32
39 WIN32OBJS = win32/winmain.o win32/winlib.a win32/winres.res
40 win32 = $(WIN32OBJS) -luser32 -lgdi32
42 WIN32LIBS = $(@WIN32@)
50 $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
51 #-------------------------------------------------------------------------
52 all: Makefile @WIN32@ bacula-fd @STATIC_FD@
53 @echo "==== Make of filed is good ===="
57 (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
61 (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
65 (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
68 # win32 libraries if needed
70 (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
73 bacula-fd: $(SVROBJS) ../findlib/libfind.a ../lib/libbac.a @WIN32@
74 $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(SVROBJS) \
75 $(WIN32LIBS) $(FDLIBS) -lfind -lbac -lm $(LIBS) $(DLIB)
77 static-bacula-fd: $(SVROBJS) ../findlib/libfind.a ../lib/libbac.a @WIN32@
78 $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -L../findlib -o $@ $(SVROBJS) \
79 $(WIN32LIBS) $(FDLIBS) -lfind -lbac -lm $(LIBS) $(DLIB)
83 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
85 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
88 @$(RMF) bacula-fd filed core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
89 @$(RMF) static-bacula-fd
90 if test -f win32/Makefile; then \
91 (cd win32; $(MAKE) clean); \
95 @$(RMF) tags bacula-fd.conf
98 if test $(srcdir) = .; then $(MAKE) realclean; fi
99 (cd $(srcdir); $(RMF) Makefile; $(RMF) -r CVS)
100 if test -f win32/Makefile; then \
101 (cd win32; $(MAKE) distclean); \
105 if test $(srcdir) = .; then $(MAKE) realclean; fi
106 (cd $(srcdir); $(RMF) Makefile)
107 if test -f win32/Makefile; then \
108 (cd win32; $(MAKE) devclean); \
112 $(INSTALL_PROGRAM) bacula-fd $(DESTDIR)$(sbindir)/bacula-fd
113 @srcconf=bacula-fd.conf; \
114 if test -f ${DESTDIR}${sysconfdir}/$$srcconf; then \
115 destconf=$$srcconf.new; \
116 echo " ==> Found existing $$srcconf, installing new conf file as $$destconf"; \
118 destconf=$$srcconf; \
120 echo "${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf"; \
121 ${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf
122 @if test -f static-bacula-fd; then \
123 $(INSTALL_PROGRAM) static-bacula-fd $(DESTDIR)$(sbindir)/static-bacula-fd; \
129 (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd)
130 (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd.conf)
131 (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd.conf.new)
135 # Semi-automatic generation of dependencies:
136 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
137 # and it also includes system headers.
138 # `semi'-automatic since dependencies are generated at distribution time.
141 @$(MV) Makefile Makefile.bak
142 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
143 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
144 @$(CC) -S -M $(CPPFLAGS) $(XINC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
145 @if test -f Makefile ; then \
146 $(RMF) Makefile.bak; \
148 $(MV) Makefile.bak Makefile; \
149 echo -e "Something went wrong\n\a"; \
152 # -----------------------------------------------------------------------
153 # DO NOT DELETE: nice dependency list follows