]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/filed/Makefile.in
Integrate Phil's Makefile patch
[bacula/bacula] / bacula / src / filed / Makefile.in
1 #
2 # Bacula Makefile for the File daemon
3 #
4 #  Version $Id$
5 #
6
7 @MCOMMON@
8
9 srcdir =        .
10 VPATH =         .
11 .PATH:          .
12
13 # one up
14 basedir = ..
15 # top dir
16 topdir = ../..
17 # this dir relative to top dir
18 thisdir = src/filed
19
20 DEBUG=@DEBUG@
21
22 first_rule: all
23 dummy:
24
25 #
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
32
33 # these are the objects that are changed by the .configure process
34 EXTRAOBJS = @OBJLIST@
35
36 FDLIBS = @FDLIBS@                 # extra libs for File daemon
37
38 # extra items for linking on Win32
39 WIN32OBJS = win32/winmain.o win32/winlib.a win32/winres.res
40 win32 = $(WIN32OBJS) -luser32 -lgdi32
41
42 WIN32LIBS = $(@WIN32@)
43
44 .SUFFIXES:      .c .o
45 .PHONY:
46 .DONTCARE:
47
48 # inference rules
49 .c.o:
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 ===="
54         @echo " "
55
56 win32/winlib.a:
57         (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
58         @rm -f bacula-fd.exe
59
60 win32/winmain.o:
61         (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
62         @rm -f bacula-fd.exe
63
64 win32/winres.res:
65         (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
66         @rm -f bacula-fd.exe
67
68 # win32 libraries if needed
69 win32:  $(WIN32OBJS)
70         (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
71         @rm -f bacula-fd.exe
72
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)
76
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)
80         strip $@
81
82
83 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
84         cd $(topdir) \
85           && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
86
87 clean:
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); \
92         fi
93
94 realclean: clean
95         @$(RMF) tags bacula-fd.conf
96
97 distclean: realclean
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); \
102         fi
103
104 devclean: realclean
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); \
109         fi
110
111 install: all
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"; \
117         else \
118            destconf=$$srcconf; \
119         fi; \
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; \
124         fi
125
126
127
128 uninstall:
129         (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd)
130         (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd.conf)
131         (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd.conf.new)
132
133
134
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.
139
140 depend:
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; \
147         else \
148            $(MV) Makefile.bak Makefile; \
149            echo -e "Something went wrong\n\a"; \
150         fi
151
152 # -----------------------------------------------------------------------
153 # DO NOT DELETE: nice dependency list follows