]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/tools/Makefile.in
kes I reworked the OpenSSL include/lib flags to be handled in
[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 FINDOBJS = testfind.o ../dird/dird_conf.o ../dird/inc_conf.o ../dird/run_conf.o
31
32 # these are the objects that are changed by the .configure process
33 EXTRAOBJS = @OBJLIST@
34
35 DIRCONFOBJS = ../dird/dird_conf.o ../dird/run_conf.o ../dird/inc_conf.o
36
37 NODIRTOOLS = bsmtp
38 DIRTOOLS = bsmtp dbcheck drivetype fstype testfind testls bregex bwild bbatch bregtest
39 TOOLS = $(@DIR_TOOLS@)
40
41 INSNODIRTOOLS = bsmtp
42 INSDIRTOOLS = bsmtp dbcheck bwild bregex
43 INSTOOLS = $(INS@DIR_TOOLS@)
44
45
46 .SUFFIXES:      .c .o
47 .PHONY:
48 .DONTCARE:
49
50 # inference rules
51 .c.o:
52         @echo "Compiling $<"
53         $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
54 #-------------------------------------------------------------------------
55 all: Makefile $(TOOLS) gigaslam
56         @echo "==== Make of tools is good ===="
57         @echo " "
58
59 bsmtp:  bsmtp.o ../lib/libbac.a        
60         $(CXX) $(LDFLAGS) -L../lib -o $@ bsmtp.o -lbac -lm $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
61
62 bregtest:       bregtest.o ../lib/libbac.a        
63         $(CXX) $(LDFLAGS) -L../lib -o $@ bregtest.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 drivetype: drivetype.o ../lib/libbac.a ../findlib/libfind.a
72         $(CXX) $(LDFLAGS) -L../lib -L../findlib -o $@ drivetype.o -lfind -lbac -lm $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
73
74 dird_conf.o: ../dird/dird_conf.c
75         $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
76
77 run_conf.o: ../dird/run_conf.c
78         $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
79
80 inc_conf.o: ../dird/inc_conf.c
81         $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
82
83 testfind: ../findlib/libfind.a ../lib/libbac.a $(FINDOBJS)
84         $(CXX) -g $(LDFLAGS) -L. -L../lib -L../findlib -o $@ $(FINDOBJS) \
85           $(DLIB) -lfind -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
86
87 testls: ../findlib/libfind.a ../lib/libbac.a testls.o
88         $(CXX) -g $(LDFLAGS) -L. -L../lib -L../findlib -o $@ testls.o \
89           $(DLIB) -lfind -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
90
91 bregex: ../findlib/libfind.a ../lib/libbac.a bregex.o
92         $(CXX) -g $(LDFLAGS) -L. -L../lib -o $@ bregex.o \
93           $(DLIB) -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
94
95 bwild:  ../findlib/libfind.a ../lib/libbac.a bwild.o
96         $(CXX) -g $(LDFLAGS) -L. -L../lib -o $@ bwild.o \
97           $(DLIB) -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
98
99 bbatch: ../lib/libbac.a bbatch.o
100         $(CXX) -g $(LDFLAGS) -L../cats -L. -L../lib -o $@ bbatch.o \
101           -lsql -lbac -lm $(DB_LIBS) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
102
103 gigaslam.o: gigaslam.c
104         $(CC) -c $<  
105
106 gigaslam: gigaslam.o
107         $(CC) -o $@ gigaslam.o
108
109
110 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
111         cd $(topdir) \
112           && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
113
114 clean:
115         @$(RMF) bsmtp core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
116         @$(RMF) $(DIRTOOLS)
117
118 realclean: clean
119         @$(RMF) tags
120
121 distclean: realclean
122         if test $(srcdir) = .; then $(MAKE) realclean; fi
123         (cd $(srcdir); $(RMF) Makefile)
124
125 devclean: realclean
126         if test $(srcdir) = .; then $(MAKE) realclean; fi
127         (cd $(srcdir); $(RMF) Makefile)
128
129 # Allow non-root execution of bsmtp for non-root Directors
130 install: $(INSTOOLS)
131         @for tool in ${INSTOOLS} ; do \
132            $(INSTALL_PROGRAM) $$tool $(DESTDIR)$(sbindir)/$$tool ; \
133         done
134         chmod 755 $(DESTDIR)$(sbindir)/bsmtp
135
136 uninstall:
137         @for tool in ${INSTOOLS} ; do \
138            $(RMF) $(DESTDIR)$(sbindir)/$$tool ; \
139         done
140
141
142
143 # Semi-automatic generation of dependencies:
144 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
145 # and it also includes system headers.
146 # `semi'-automatic since dependencies are generated at distribution time.
147
148 depend:
149         @$(MV) Makefile Makefile.bak
150         @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
151         @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
152         @$(CXX) -S -M $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(SQL_INC) *.c >> Makefile
153         @if test -f Makefile ; then \
154             $(RMF) Makefile.bak; \
155         else \
156            $(MV) Makefile.bak Makefile; \
157            echo " ===== Something went wrong in make depend ====="; \
158         fi
159
160 # -----------------------------------------------------------------------
161 # DO NOT DELETE: nice dependency list follows