]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/filed/Makefile.in
859b7e39ab235117f32b49c65a16330d4b790d31
[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 OPENSSL_LIBS = @OPENSSL_LIBS@
23 OPENSSL_INC = @OPENSSL_INC@
24
25 PYTHON_LIBS = @PYTHON_LIBS@
26 PYTHON_INC = @PYTHON_INCDIR@
27
28 first_rule: all
29 dummy:
30
31 #
32 SVRSRCS = filed.c authenticate.c acl.c backup.c chksum.c estimate.c \
33           filed_conf.c heartbeat.c job.c python.c \
34           restore.c status.c verify.c verify_vol.c
35 SVROBJS = filed.o authenticate.o acl.o backup.o chksum.o estimate.o \
36           filed_conf.o heartbeat.o job.o python.o \
37           restore.o status.o verify.o verify_vol.o
38
39 # these are the objects that are changed by the .configure process
40 EXTRAOBJS = @OBJLIST@
41
42 FDLIBS = @FDLIBS@                 # extra libs for File daemon
43
44 # extra items for linking on Win32
45 WIN32OBJS = win32/winmain.o win32/winlib.a win32/winres.res
46 win32 = $(WIN32OBJS) -luser32 -lgdi32
47
48 WIN32LIBS = $(@WIN32@)
49
50 .SUFFIXES:      .c .o
51 .PHONY:
52 .DONTCARE:
53
54 # inference rules
55 .c.o:
56         $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) $(OPENSSL_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
57 #-------------------------------------------------------------------------
58 all: Makefile @WIN32@ bacula-fd @STATIC_FD@
59         @echo "==== Make of filed is good ===="
60         @echo " "
61
62 win32/winlib.a:
63         (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
64         @rm -f bacula-fd.exe
65
66 win32/winmain.o:
67         (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
68         @rm -f bacula-fd.exe
69
70 win32/winres.res:
71         (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
72         @rm -f bacula-fd.exe
73
74 # win32 libraries if needed
75 win32:  $(WIN32OBJS)
76         (cd win32; $(MAKE) DESTDIR=$(DESTDIR))
77         @rm -f bacula-fd.exe
78
79 bacula-fd:  $(SVROBJS) ../findlib/libfind.a ../lib/libbac.a @WIN32@
80         $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(SVROBJS) \
81           $(WIN32LIBS) $(FDLIBS) -lfind -lbac -lm $(PYTHON_LIBS) $(LIBS) $(DLIB) $(OPENSSL_LIBS)
82
83 static-bacula-fd:  $(SVROBJS) ../findlib/libfind.a ../lib/libbac.a @WIN32@
84         $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -L../findlib -o $@ $(SVROBJS) \
85            $(WIN32LIBS) $(FDLIBS) -lfind -lbac -lm $(PYTHON_LIBS) $(LIBS) $(DLIB) $(OPENSSL_LIBS)
86         strip $@
87
88
89 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
90         cd $(topdir) \
91           && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
92
93 clean:
94         @$(RMF) bacula-fd filed core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
95         @$(RMF) static-bacula-fd
96         if test -f win32/Makefile; then \
97            (cd win32; $(MAKE) clean); \
98         fi
99
100 realclean: clean
101         @$(RMF) tags bacula-fd.conf
102
103 distclean: realclean
104         if test $(srcdir) = .; then $(MAKE) realclean; fi
105         (cd $(srcdir); $(RMF) Makefile; $(RMF) -r CVS)
106         if test -f win32/Makefile; then \
107            (cd win32; $(MAKE) distclean); \
108         fi
109
110 devclean: realclean
111         if test $(srcdir) = .; then $(MAKE) realclean; fi
112         (cd $(srcdir); $(RMF) Makefile)
113         if test -f win32/Makefile; then \
114            (cd win32; $(MAKE) devclean); \
115         fi
116
117 install: all
118         $(INSTALL_PROGRAM) bacula-fd $(DESTDIR)$(sbindir)/bacula-fd 
119         @srcconf=bacula-fd.conf; \
120         if  test -f ${DESTDIR}${sysconfdir}/$$srcconf; then \
121            destconf=$$srcconf.new; \
122            echo "  ==> Found existing $$srcconf, installing new conf file as $$destconf"; \
123         else \
124            destconf=$$srcconf; \
125         fi; \
126         echo "${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf"; \
127         ${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf
128         @if test -f static-bacula-fd; then \
129            $(INSTALL_PROGRAM) static-bacula-fd $(DESTDIR)$(sbindir)/static-bacula-fd; \
130         fi
131
132
133
134 uninstall:
135         (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd)
136         (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd.conf)
137         (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd.conf.new)
138
139
140
141 # Semi-automatic generation of dependencies:
142 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
143 # and it also includes system headers.
144 # `semi'-automatic since dependencies are generated at distribution time.
145
146 depend:
147         @$(MV) Makefile Makefile.bak
148         @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
149         @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
150         @$(CXX) -S -M $(CPPFLAGS) $(XINC) $(PYTHON_INC) $(OPENSSL_INC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
151         @if test -f Makefile ; then \
152             $(RMF) Makefile.bak; \
153         else \
154            $(MV) Makefile.bak Makefile; \
155            echo " ===== Something went wrong in make depend ====="; \
156         fi
157
158 # -----------------------------------------------------------------------
159 # DO NOT DELETE: nice dependency list follows