]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/tools/Makefile.in
25Jun06
[bacula/bacula] / bacula / src / tools / Makefile.in
1 #
2 # Bacula Tools Makefile
3 #
4 # Version $Id$
5 #
6 @MCOMMON@
7
8 PYTHON_INC = @PYTHON_INCDIR@
9
10 srcdir =        .
11 VPATH =         .
12 .PATH:          .
13
14 # one up
15 basedir = ..
16 # top dir
17 topdir = ../..
18 # this dir relative to top dir
19 thisdir = src/tools
20
21 DEBUG=@DEBUG@
22
23 first_rule: all
24 dummy:
25
26 #
27
28 GETTEXT_LIBS = @LIBINTL@
29
30 OPENSSL_INC = @OPENSSL_INC@
31 OPENSSL_LIBS = @OPENSSL_LIBS@
32
33 FINDOBJS = testfind.o
34
35 # these are the objects that are changed by the .configure process
36 EXTRAOBJS = @OBJLIST@
37
38 DIRCONFOBJS = ../dird/dird_conf.o ../dird/run_conf.o ../dird/inc_conf.o
39
40 NODIRTOOLS = bsmtp
41 DIRTOOLS = bsmtp dbcheck fstype testfind testls bregex bwild
42 TOOLS = $(@DIR_TOOLS@)
43
44 INSNODIRTOOLS = bsmtp
45 INSDIRTOOLS = bsmtp dbcheck bwild bregex
46 INSTOOLS = $(INS@DIR_TOOLS@)
47
48
49 .SUFFIXES:      .c .o
50 .PHONY:
51 .DONTCARE:
52
53 # inference rules
54 .c.o:
55         echo "Compiling $<"
56         $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
57 #-------------------------------------------------------------------------
58 all: Makefile $(TOOLS) 
59         @echo "==== Make of tools is good ===="
60         @echo " "
61
62 bsmtp:  bsmtp.o ../lib/libbac.a        
63         $(CXX) $(LDFLAGS) -L../lib -o $@ bsmtp.o -lbac -lm $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
64
65 dbcheck: dbcheck.o ../lib/libbac.a ../cats/libsql.a $(DIRCONFOBJS)
66         $(CXX) $(LDFLAGS) -L../lib -L../cats -o $@ dbcheck.o $(DIRCONFOBJS) -lsql -lbac -lm $(DB_LIBS) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
67
68 fstype: fstype.o ../lib/libbac.a ../findlib/libfind.a
69         $(CXX) $(LDFLAGS) -L../lib -L../findlib -o $@ fstype.o -lfind -lbac -lm $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
70
71 testfind: ../findlib/libfind.a ../lib/libbac.a $(FINDOBJS)
72         $(CXX) -g $(LDFLAGS) -L. -L../lib -L../findlib -o $@ $(FINDOBJS) \
73           $(DLIB) -lfind -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
74
75 testls: ../findlib/libfind.a ../lib/libbac.a testls.o
76         $(CXX) -g $(LDFLAGS) -L. -L../lib -L../findlib -o $@ testls.o \
77           $(DLIB) -lfind -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
78
79 bregex: ../findlib/libfind.a ../lib/libbac.a bregex.o
80         $(CXX) -g $(LDFLAGS) -L. -L../lib -o $@ bregex.o \
81           $(DLIB) -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
82
83 bwild:  ../findlib/libfind.a ../lib/libbac.a bwild.o
84         $(CXX) -g $(LDFLAGS) -L. -L../lib -o $@ bwild.o \
85           $(DLIB) -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
86
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) bsmtp core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
95         @$(RMF) $(DIRTOOLS)
96
97 realclean: clean
98         @$(RMF) tags
99
100 distclean: realclean
101         if test $(srcdir) = .; then $(MAKE) realclean; fi
102         (cd $(srcdir); $(RMF) Makefile)
103
104 devclean: realclean
105         if test $(srcdir) = .; then $(MAKE) realclean; fi
106         (cd $(srcdir); $(RMF) Makefile)
107
108 # Allow non-root execution of bsmtp for non-root Directors
109 install: $(INSTOOLS)
110         @for tool in ${INSTOOLS} ; do \
111            $(INSTALL_PROGRAM) $$tool $(DESTDIR)$(sbindir)/$$tool ; \
112         done
113         chmod 755 $(DESTDIR)$(sbindir)/bsmtp
114
115 uninstall:
116         @for tool in ${INSTOOLS} ; do \
117            $(RMF) $(DESTDIR)$(sbindir)/$$tool ; \
118         done
119
120
121
122 # Semi-automatic generation of dependencies:
123 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
124 # and it also includes system headers.
125 # `semi'-automatic since dependencies are generated at distribution time.
126
127 depend:
128         @$(MV) Makefile Makefile.bak
129         @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
130         @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
131         @$(CXX) -S -M $(CPPFLAGS) $(PYTHON_INC) $(OPENSSL_INC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
132         @if test -f Makefile ; then \
133             $(RMF) Makefile.bak; \
134         else \
135            $(MV) Makefile.bak Makefile; \
136            echo " ===== Something went wrong in make depend ====="; \
137         fi
138
139 # -----------------------------------------------------------------------
140 # DO NOT DELETE: nice dependency list follows