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