]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/dird/Makefile.in
b5c6d9f1b21f01b958364205a49eaed8e5958a91
[bacula/bacula] / bacula / src / dird / Makefile.in
1 #
2 #  Bacula Director Makefile
3 #
4 #  Version $Id$
5 #  
6 @MCOMMON@
7
8 srcdir =        .
9 VPATH =         .
10 .PATH:          .
11
12 # one up
13 basedir = ..
14 # top dir
15 topdir = ../..
16 # this dir relative to top dir
17 thisdir = src/dird
18
19 DEBUG=@DEBUG@
20
21 PYTHON_LIBS = @PYTHON_LIBS@
22 PYTHON_INC = @PYTHON_INCDIR@
23
24 first_rule: all
25 dummy:
26
27 #
28 SVRSRCS = dird.c admin.c authenticate.c \
29           autoprune.c backup.c bsr.c \
30           catreq.c dird_conf.c expand.c \
31           fd_cmds.c getmsg.c inc_conf.c job.c \
32           jobq.c mac.c \
33           mountreq.c msgchan.c next_vol.c newvol.c \
34           python.c \
35           recycle.c restore.c run_conf.c \
36           scheduler.c sql_cmds.c \
37           ua_acl.c ua_cmds.c ua_dotcmds.c \
38           ua_query.c \
39           ua_input.c ua_label.c ua_output.c ua_prune.c \
40           ua_purge.c ua_restore.c ua_run.c \
41           ua_select.c ua_server.c \
42           ua_status.c ua_tree.c ua_update.c verify.c
43 SVROBJS = dird.o admin.o authenticate.o \
44           autoprune.o backup.o bsr.o \
45           catreq.o dird_conf.o expand.o \
46           fd_cmds.o getmsg.o inc_conf.o job.o \
47           jobq.o mac.o \
48           mountreq.o msgchan.o next_vol.o newvol.o \
49           python.o \
50           recycle.o restore.o run_conf.o \
51           scheduler.o sql_cmds.o \
52           ua_acl.o ua_cmds.o ua_dotcmds.o \
53           ua_query.o \
54           ua_input.o ua_label.o ua_output.o ua_prune.o \
55           ua_purge.o ua_restore.o ua_run.o \
56           ua_select.o ua_server.o \
57           ua_status.o ua_tree.o ua_update.o verify.o
58
59 # these are the objects that are changed by the .configure process
60 EXTRAOBJS = @OBJLIST@
61
62 .SUFFIXES:      .c .o
63 .PHONY:
64 .DONTCARE:
65
66 # inference rules
67 .c.o:
68         $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
69 #-------------------------------------------------------------------------
70 all: Makefile bacula-dir @STATIC_DIR@
71         @echo "==== Make of dird is good ===="
72         @echo " "
73
74 bacula-dir:  $(SVROBJS) ../lib/libbac.a ../cats/libsql.a ../findlib/libfind.a
75         $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -L../cats -L../findlib -o $@ $(SVROBJS) \
76               -lsql -lfind -lbac -lm $(PYTHON_LIBS) $(DLIB) $(DB_LIBS) $(LIBS)
77
78 static-bacula-dir:  $(SVROBJS) ../lib/libbac.a ../cats/libsql.a ../findlib/libfind.a
79         $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -L../cats -L../findlib -o $@ $(SVROBJS) \
80               -lsql -lbac -lfind -lm $(PYTHON_LIBS) $(DLIB) $(DB_LIBS) $(LIBS) 
81         strip $@
82
83
84 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
85         cd $(topdir) \
86           && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
87
88 clean:
89         @$(RMF) dird bacula-dir core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
90         @$(RMF) static-bacula-dir
91
92 realclean: clean
93         @$(RMF) tags bacula-dir.conf
94
95 distclean: realclean
96         if test $(srcdir) = .; then $(MAKE) realclean; fi
97         (cd $(srcdir); $(RMF) Makefile; $(RMF) -r CVS)
98
99 devclean: realclean
100         if test $(srcdir) = .; then $(MAKE) realclean; fi
101         (cd $(srcdir); $(RMF) Makefile)
102
103 install: all
104         $(INSTALL_PROGRAM) bacula-dir $(DESTDIR)$(sbindir)/bacula-dir
105         @srcconf=bacula-dir.conf; \
106            if  test -f ${DESTDIR}${sysconfdir}/$$srcconf; then \
107               destconf=$$srcconf.new; \
108               echo "  ==> Found existing $$srcconf, installing new conf file as $$destconf"; \
109            else \
110               destconf=$$srcconf; \
111            fi; \
112            echo "${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf"; \
113            ${INSTALL_CONFIG} $$srcconf ${DESTDIR}${sysconfdir}/$$destconf
114         @if  test -f ${DESTDIR}${scriptdir}/query.sql; then \
115            echo "  ==> Saving existing query.sql to query.sql.old"; \
116            $(MV) -f ${DESTDIR}${scriptdir}/query.sql ${DESTDIR}${scriptdir}/query.sql.old; \
117         fi 
118         ${INSTALL_DATA} query.sql ${DESTDIR}${scriptdir}/query.sql
119         @if test -f static-bacula-dir; then \
120            $(INSTALL_PROGRAM) static-bacula-dir $(DESTDIR)$(sbindir)/static-bacula-dir; \
121         fi
122
123
124 uninstall:
125         (cd $(DESTDIR)$(sbindir); $(RMF) bacula-dir)
126         (cd $(DESTDIR)$(sysconfdir); $(RMF) bacula-dir.conf bacula-dir.conf.new)
127         (cd $(DESTDIR)$(scriptdir); $(RMF) query.sql)
128
129
130
131 # Semi-automatic generation of dependencies:
132 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
133 # and it also includes system headers.
134 # `semi'-automatic since dependencies are generated at distribution time.
135
136 depend:
137         @$(MV) Makefile Makefile.bak
138         @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
139         @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
140         @$(CXX) -S -M $(CPPFLAGS) $(XINC) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
141         @if test -f Makefile ; then \
142             $(RMF) Makefile.bak; \
143         else \
144            $(MV) Makefile.bak Makefile; \
145            echo -e "Something went wrong\n\a"; \
146         fi
147
148 # -----------------------------------------------------------------------
149 # DO NOT DELETE: nice dependency list follows