]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/tools/Makefile.in
Backport from Bacula Enterprise
[bacula/bacula] / bacula / src / tools / Makefile.in
1 #
2 # Copyright (C) 2000-2015 Kern Sibbald
3 # License: BSD 2-Clause; see file LICENSE-FOSS
4 #
5 # Bacula Tools Makefile
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/tools
19
20 DEBUG=@DEBUG@
21
22 DB_LIBS=@DB_LIBS@
23
24 first_rule: all
25 dummy:
26
27 #
28
29 GETTEXT_LIBS = @LIBINTL@
30
31 FINDOBJS = testfind.o ../dird/dird_conf.o ../dird/inc_conf.o ../dird/run_conf.o ../dird/ua_acl.o
32
33 # these are the objects that are changed by the .configure process
34 EXTRAOBJS = @OBJLIST@
35
36 DIRCONFOBJS = ../dird/dird_conf.o ../dird/run_conf.o ../dird/inc_conf.o ../dird/ua_acl.o
37
38 NODIRTOOLS = bsmtp
39 DIRTOOLS = bsmtp dbcheck drivetype fstype testfind testls bregex bwild bbatch bregtest bvfs_test
40 TOOLS = $(@DIR_TOOLS@)
41
42 INSNODIRTOOLS = bsmtp
43 INSDIRTOOLS = bsmtp dbcheck bwild bregex
44 INSTOOLS = $(INS@DIR_TOOLS@)
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) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
54 #-------------------------------------------------------------------------
55 all: Makefile $(TOOLS) gigaslam grow
56         @echo "==== Make of tools is good ===="
57         @echo " "
58
59 bsmtp: Makefile bsmtp.o ../lib/libbac$(DEFAULT_ARCHIVE_TYPE)        
60         $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L../lib -o $@ bsmtp.o -lbac -lm $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
61
62 bsnapshot: Makefile bsnapshot.o ../lib/libbac$(DEFAULT_ARCHIVE_TYPE)
63         $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L../lib -o $@ bsnapshot.o ../lib/ini$(DEFAULT_OBJECT_TYPE) -lbac -lm $(DLIB) $(LIBS) $(GETTEXT_LIBS)
64
65
66 bregtest: Makefile bregtest.o ../lib/libbac$(DEFAULT_ARCHIVE_TYPE)         
67         $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L../lib -o $@ bregtest.o -lbac -lm $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
68
69 dbcheck: Makefile dbcheck.o ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) \
70          ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) ../cats/libbaccats$(DEFAULT_ARCHIVE_TYPE) $(DIRCONFOBJS)
71         $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L../lib -L../cats -o $@ dbcheck.o $(DIRCONFOBJS) \
72           -lbaccats -lbacsql -lbaccfg -lbac -lm $(DB_LIBS) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
73
74 fstype: Makefile fstype.o ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE)
75         $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L../lib -L../findlib -o $@ fstype.o -lbacfind -lbac -lm \
76           $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
77
78 drivetype: Makefile drivetype.o ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE)
79         $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L../lib -L../findlib -o $@ drivetype.o -lbacfind -lbac -lm \
80           $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
81
82 dird_conf.o: ../dird/dird_conf.c
83         $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
84
85 run_conf.o: ../dird/run_conf.c
86         $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
87
88 inc_conf.o: ../dird/inc_conf.c
89         $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
90
91 timelimit: timelimit.o
92         ${CC} ${DEFS} ${DEBUG} -pipe -DHAVE_ERRNO_H -DHAVE_SETITIMER -DHAVE_SIGACTION -c timelimit.c 
93         ${CC} -o timelimit timelimit.o
94
95 testfind: Makefile ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../lib/libbaccfg$(DEFAULT_ARCHIVE_TYPE) \
96           ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) $(FINDOBJS)
97         $(LIBTOOL_LINK) $(CXX) -g $(LDFLAGS) -o $@ $(FINDOBJS) -L. -L../lib -L../findlib \
98           $(DLIB) -lbacfind -lbaccfg -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
99
100 testls: Makefile ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) testls.o
101         $(LIBTOOL_LINK) $(CXX) -g $(LDFLAGS) -L. -L../lib -L../findlib -o $@ testls.o \
102           $(DLIB) -lbacfind -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
103
104 bregex: Makefile ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) bregex.o
105         $(LIBTOOL_LINK) $(CXX) -g $(LDFLAGS) -L. -L../lib -o $@ bregex.o \
106           $(DLIB) -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
107
108 bwild:  Makefile ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) bwild.o
109         $(LIBTOOL_LINK) $(CXX) -g $(LDFLAGS) -L. -L../lib -o $@ bwild.o \
110           $(DLIB) -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
111
112 bbatch: Makefile ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) \
113         ../cats/libbaccats$(DEFAULT_ARCHIVE_TYPE) bbatch.o
114         $(LIBTOOL_LINK) $(CXX) -g $(LDFLAGS) -L../cats -L. -L../lib -o $@ bbatch.o \
115           -lbaccats -lbacsql -lbac -lm $(DB_LIBS) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
116
117 bvfs_test: Makefile ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) \
118            ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) ../cats/libbaccats$(DEFAULT_ARCHIVE_TYPE) bvfs_test.o
119         $(LIBTOOL_LINK) $(CXX) -g $(LDFLAGS) -L../cats -L. -L../lib -L../findlib -o $@ bvfs_test.o  \
120           -lbaccats -lbacsql -lbacfind -lbac -lm $(DB_LIBS) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
121
122 cats_test.o: cats_test.c
123         echo "Compiling $<"
124         $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
125
126 cats_test: Makefile ../findlib/libbacfind$(DEFAULT_ARCHIVE_TYPE) ../lib/libbac$(DEFAULT_ARCHIVE_TYPE) ../cats/libbacsql$(DEFAULT_ARCHIVE_TYPE) cats_test.o
127         $(LIBTOOL_LINK) $(CXX) -g $(LDFLAGS) -L../cats -L. -L../lib -L../findlib -o $@ cats_test.o  \
128           -lbaccats -lbacsql -lbacfind -lbac -lm $(DB_LIBS) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
129
130 gigaslam.o: gigaslam.c
131         $(CXX) $(CFLAGS) -c $<
132
133 gigaslam: gigaslam.o
134         $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -o $@ gigaslam.o
135
136 grow: Makefile grow.o ../lib/libbac$(DEFAULT_ARCHIVE_TYPE)
137         $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L../lib -o $@ grow.o -lbac -lm $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
138
139 bpluginfo.o: bpluginfo.c
140         $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) -I../filed -I../dird -I../stored $(DINCLUDE) $(CFLAGS) $<
141
142 bpluginfo: Makefile bpluginfo.o
143         $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L../lib -o $@ bpluginfo.o -lbac $(DLIB) $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
144
145 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
146         cd $(topdir) \
147           && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
148
149 libtool-clean:
150         @$(RMF) -r .libs _libs
151
152 clean:  libtool-clean
153         @$(RMF) core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
154         @$(RMF) $(DIRTOOLS) gigaslam grow
155
156 realclean: clean
157         @$(RMF) tags
158
159 distclean: realclean
160         if test $(srcdir) = .; then $(MAKE) realclean; fi
161         (cd $(srcdir); $(RMF) Makefile)
162
163 devclean: realclean
164         if test $(srcdir) = .; then $(MAKE) realclean; fi
165         (cd $(srcdir); $(RMF) Makefile)
166
167 install-bsnapshot: bsnapshot
168         $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) bsnapshot $(DESTDIR)$(sbindir)/bsnapshot
169
170 installall:  $(TOOLS) timelimit
171         @for tool in ${TOOLS} timelimit ; do \
172            $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) $$tool $(DESTDIR)$(sbindir)/$$tool ; \
173         done
174 #       chattr +i $(DESTDIR)$(sbindir)/bsmtp
175 #       chmod 755 $(DESTDIR)$(sbindir)/bsmtp
176
177 # Allow non-root execution of bsmtp for non-root Directors
178 install: $(INSTOOLS)
179         @for tool in ${INSTOOLS} ; do \
180            $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) $$tool $(DESTDIR)$(sbindir)/$$tool ; \
181         done
182 #       chattr +i $(DESTDIR)$(sbindir)/bsmtp
183 #       chmod 755 $(DESTDIR)$(sbindir)/bsmtp
184
185 uninstall:
186         @for tool in ${INSTOOLS} ; do \
187            $(RMF) $(DESTDIR)$(sbindir)/$$tool ; \
188         done
189
190
191
192 # Semi-automatic generation of dependencies:
193 # Use gcc -MM because X11 `makedepend' doesn't work on all systems
194 # and it also includes system headers.
195 # `semi'-automatic since dependencies are generated at distribution time.
196
197 depend:
198         @$(MV) Makefile Makefile.bak
199         @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
200         @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
201         @$(CXX) -S -M $(CPPFLAGS) -I$(srcdir) -I$(basedir) *.c >> Makefile
202         @if test -f Makefile ; then \
203             $(RMF) Makefile.bak; \
204         else \
205            $(MV) Makefile.bak Makefile; \
206            echo " ===== Something went wrong in make depend ====="; \
207         fi
208
209 # -----------------------------------------------------------------------
210 # DO NOT DELETE: nice dependency list follows