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