2 # Bacula Makefile for the File daemon
8 # autoconf/Make.common.in -*- Makefile -*-
9 # release date (man), LSM date, version number/name, current maintainer
13 VERNAME=bacula-$(VERSION)#
15 MAINTEMAIL=<kern@sibbald.com>#
21 #-------------------------------------------------------------------------
25 # Installation target directories & other installation stuff
31 sysconfdir = /etc/bacula
32 scriptdir = /etc/bacula
33 mandir = ${prefix}/man/man1
36 # Tools & program stuff
50 RANLIB = /usr/bin/ranlib
51 INSTALL = /usr/bin/install -c
52 # add the -s to the following in PRODUCTION mode
53 INSTALL_PROGRAM = /usr/bin/install -c -m 754
54 INSTALL_DATA = /usr/bin/install -c -m 644
55 INSTALL_SCRIPT = /usr/bin/install -c -m 754
56 INSTALL_CONFIG = /usr/bin/install -c -m 640
63 DEFS = -DHAVE_WIN32 -DHAVE_MINGW
64 LIBS = -lpthreadGC -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool \
65 -lwinmm -lshell32 -lcomctl32 -lctl3d32 -ladvapi32 -lwsock32 \
71 # Windows (cygwin) flags
73 WLDFLAGS = -mwindows -Wl,--subsystem,windows -mthreads
78 # extra libraries needed by X on some systems, X library location
79 #XLIB = @XPM_LIBS@ -lX11
81 # End of common section of the Makefile
82 #-------------------------------------------------------------------------
92 # this dir relative to top dir
101 SVRSRCS = filed.c authenticate.c backup.c chksum.c estimate.c \
102 filed_conf.c heartbeat.c job.c \
103 restore.c status.c verify.c verify_vol.c
104 SVROBJS = filed.o authenticate.o backup.o chksum.o estimate.o \
105 filed_conf.o heartbeat.o job.o \
106 restore.o status.o verify.o verify_vol.o
108 # these are the objects that are changed by the .configure process
111 FDLIBS = -lz # extra libs for File daemon
113 # extra items for linking on Win32
114 WIN32OBJS = win32/winmain.o win32/winlib.a win32/winres.res
125 $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) -I$(srcdir) -I$(basedir) -I../win32/compat $(DINCLUDE) $(CFLAGS) $<
126 #-------------------------------------------------------------------------
128 @echo "==== Make of filed is good ===="
132 (cd win32; $(MAKE) -f Makefile.mingw DESTDIR=$(DESTDIR))
136 (cd win32; $(MAKE) -f Makefile.mingw DESTDIR=$(DESTDIR))
140 (cd win32; $(MAKE) -f Makefile.mingw DESTDIR=$(DESTDIR))
143 # win32 libraries if needed
145 (cd win32; $(MAKE) -f Makefile.mingw DESTDIR=$(DESTDIR))
148 bacula-fd: $(SVROBJS) ../findlib/libfind.a ../lib/libbac.a win32
149 $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(SVROBJS) \
150 $(WIN32LIBS) $(FDLIBS) -lfind -lbac -lm $(LIBS) $(DLIB)
152 static-bacula-fd: $(SVROBJS) ../findlib/libfind.a ../lib/libbac.a win32
153 $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -L../findlib -o $@ $(SVROBJS) \
154 $(WIN32LIBS) $(FDLIBS) -lfind -lbac -lm $(LIBS) $(DLIB)
157 ../findlib/libfind.a: ../findlib/*.c
158 (cd ../findlib/; $(MAKE) -f Makefile.mingw DESTDIR=$(DESTDIR))
161 ../lib/libbac.a: ../lib/*.c*
162 (cd ../lib/; $(MAKE) -f Makefile.mingw DESTDIR=$(DESTDIR))
166 @$(RMF) bacula-fd filed core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
167 @$(RMF) static-bacula-fd
168 if test -f win32/Makefile; then \
169 (cd win32; $(MAKE) clean); \
173 @$(RMF) tags bacula-fd.conf
176 if test $(srcdir) = .; then $(MAKE) realclean; fi
177 (cd $(srcdir); $(RMF) Makefile; $(RMF) -r CVS)
178 if test -f win32/Makefile; then \
179 (cd win32; $(MAKE) distclean); \
183 if test $(srcdir) = .; then $(MAKE) realclean; fi
184 (cd $(srcdir); $(RMF) Makefile)
185 if test -f win32/Makefile; then \
186 (cd win32; $(MAKE) devclean); \
190 $(INSTALL_PROGRAM) bacula-fd $(DESTDIR)$(sbindir)/bacula-fd
191 @srcconf=bacula-fd.conf; \
192 if test -f ${DESTDIR}${sysconfdir}/$$srcconf; then \
193 destconf=$$srcconf.new; \
194 echo " ==> Found existing $$srcconf, installing new conf file as $$destconf"; \
196 destconf=$$srcconf; \
198 echo "${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf"; \
199 ${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf
200 @if test -f static-bacula-fd; then \
201 $(INSTALL_PROGRAM) static-bacula-fd $(DESTDIR)$(sbindir)/static-bacula-fd; \
207 (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd)
208 (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd.conf)
209 (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd.conf.new)
213 # Semi-automatic generation of dependencies:
214 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
215 # and it also includes system headers.
216 # `semi'-automatic since dependencies are generated at distribution time.
219 @$(MV) Makefile Makefile.bak
220 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
221 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
222 @$(CC) -S -M $(CPPFLAGS) $(XINC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
223 @if test -f Makefile ; then \
224 $(RMF) Makefile.bak; \
226 $(MV) Makefile.bak Makefile; \
227 echo -e "Something went wrong\n\a"; \
230 # -----------------------------------------------------------------------
231 # DO NOT DELETE: nice dependency list follows