]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/filed/Makefile.in
Windows tweaks
[bacula/bacula] / bacula / src / filed / Makefile.in
1 #
2 # Bacula Makefile
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 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 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))
58         @rm -f bacula-fd.exe
59
60 win32/winmain.o:
61         (cd win32; $(MAKE))
62         @rm -f bacula-fd.exe
63
64 win32/winres.res:
65         (cd win32; $(MAKE))
66         @rm -f bacula-fd.exe
67
68 # win32 libraries if needed
69 win32:  $(WIN32OBJS)
70         (cd win32; $(MAKE))
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 install: all
105         $(INSTALL_PROGRAM) bacula-fd $(DESTDIR)$(sbindir)/bacula-fd 
106         @srcconf=bacula-fd.conf; \
107         if  test -f ${DESTDIR}${sysconfdir}/$$srcconf; then \
108            destconf=$$srcconf.new; \
109            echo "  ==> Found existing $$srcconf, installing new conf file as $$destconf"; \
110         else \
111            destconf=$$srcconf; \
112         fi; \
113         echo "${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf"; \
114         ${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf
115
116 uninstall:
117         (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd)
118         (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd.conf)
119         (cd $(DESTDIR)$(sbindir); $(RMF) bacula-fd.conf.new)
120
121
122
123 # Semi-automatic generation of dependencies:
124 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
125 # and it also includes system headers.
126 # `semi'-automatic since dependencies are generated at distribution time.
127
128 depend:
129         @$(MV) Makefile Makefile.bak
130         @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
131         @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
132         @$(CC) -S -M $(CPPFLAGS) $(XINC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
133         @if test -f Makefile ; then \
134             $(RMF) Makefile.bak; \
135         else \
136            $(MV) Makefile.bak Makefile; \
137            echo -e "Something went wrong\n\a"; \
138         fi
139
140 # -----------------------------------------------------------------------
141 # DO NOT DELETE: nice dependency list follows