5 # Define library versions
6 LIBBAC_LT_RELEASE = @LIBBAC_LT_RELEASE@
7 LIBBACCFG_LT_RELEASE = @LIBBACCFG_LT_RELEASE@
8 LIBBACPY_LT_RELEASE = @LIBBACPY_LT_RELEASE@
11 python = @PYTHON_INCDIR@
21 # this dir relative to top dir
32 # include files installed when using libtool
34 INCLUDE_FILES = ../baconfig.h ../bacula.h ../bc_types.h \
35 ../config.h ../jcr.h ../version.h \
36 address_conf.h alist.h attr.h base64.h \
37 berrno.h bits.h bpipe.h breg.h bregex.h \
38 bsock.h btime.h btimers.h crypto.h dlist.h \
39 fnmatch.h guid_to_name.h htable.h lex.h \
40 lib.h md5.h mem_pool.h message.h mntent_cache.h \
41 openssl.h plugins.h protos.h queue.h rblist.h \
42 runscript.h rwlock.h serial.h sellist.h sha1.h \
43 smartall.h status.h tls.h tree.h var.h \
44 waitq.h watchdog.h workq.h \
46 pythonlib.h lockmgr.h devlock.h
51 LIBBAC_SRCS = attr.c base64.c berrno.c bsys.c binflate.c bget_msg.c \
52 bnet.c bnet_server.c runscript.c \
53 bsock.c bpipe.c bsnprintf.c btime.c \
54 cram-md5.c crc32.c crypto.c daemon.c edit.c fnmatch.c \
55 guid_to_name.c hmac.c jcr.c lex.c alist.c dlist.c \
56 md5.c message.c mem_pool.c mntent_cache.c openssl.c \
57 plugins.c priv.c queue.c bregex.c \
58 rwlock.c scan.c sellist.c serial.c sha1.c \
59 signal.c smartall.c rblist.c tls.c tree.c \
60 util.c var.c watchdog.c workq.c btimers.c \
61 address_conf.c breg.c htable.c lockmgr.c devlock.c
63 LIBBAC_OBJS = $(LIBBAC_SRCS:.c=.o)
64 LIBBAC_LOBJS = $(LIBBAC_SRCS:.c=.lo)
67 # libbaccfg (config functions)
69 LIBBACCFG_SRCS = ini.c parse_conf.c res.c
70 LIBBACCFG_OBJS = $(LIBBACCFG_SRCS:.c=.o)
71 LIBBACCFG_LOBJS = $(LIBBACCFG_SRCS:.c=.lo)
74 # libbacpy (python functions)
76 LIBBACPY_SRCS = pythonlib.c
77 LIBBACPY_OBJS = $(LIBBACPY_SRCS:.c=.o)
78 LIBBACPY_LOBJS = $(LIBBACPY_SRCS:.c=.lo)
80 .SUFFIXES: .c .cc .o .lo .ch .dvi .pdf .tex .view .w .1
87 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
91 $(NO_ECHO)$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
95 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
99 $(NO_ECHO)$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
101 # specific build rules
103 pythonlib.o: pythonlib.c
105 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(python) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
107 pythonlib.lo: pythonlib.c
109 $(NO_ECHO)$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(python) -I../configlib -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
111 #-------------------------------------------------------------------------
112 all: Makefile libbac$(DEFAULT_ARCHIVE_TYPE) libbaccfg$(DEFAULT_ARCHIVE_TYPE) libbacpy$(DEFAULT_ARCHIVE_TYPE)
113 @echo "==== Make of lib is good ===="
116 libbac.a: $(LIBBAC_OBJS)
117 @echo "Making $@ ..."
118 $(AR) rc $@ $(LIBBAC_OBJS)
121 libbac.la: Makefile $(LIBBAC_LOBJS)
122 @echo "Making $@ ..."
123 $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(LIBBAC_LOBJS) -export-dynamic -rpath $(libdir) -release $(LIBBAC_LT_RELEASE) $(WRAPLIBS) $(CAP_LIBS) $(ZLIBS) $(OPENSSL_LIBS) $(LIBS)
125 libbaccfg.a: $(LIBBACCFG_OBJS)
126 @echo "Making $@ ..."
127 $(AR) rc $@ $(LIBBACCFG_OBJS)
130 libbaccfg.la: Makefile $(LIBBACCFG_LOBJS)
131 @echo "Making $@ ..."
132 $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(LIBBACCFG_LOBJS) -export-dynamic -rpath $(libdir) -release $(LIBBACCFG_LT_RELEASE) $(OPENSSL_LIBS) $(LIBS)
134 libbacpy.a: $(LIBBACPY_OBJS)
135 @echo "Making $@ ..."
136 $(AR) rc $@ $(LIBBACPY_OBJS)
139 libbacpy.la: Makefile $(LIBBACPY_LOBJS)
140 @echo "Making $@ ..."
141 $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(LIBBACPY_LOBJS) -export-dynamic -rpath $(libdir) -release $(LIBBACPY_LT_RELEASE) $(PYTHON_LIBS) $(OPENSSL_LIBS) $(LIBS)
143 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
145 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
147 lockmgr_test: Makefile
149 $(CXX) -D _TEST_IT $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) lockmgr.c
150 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ lockmgr.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
152 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) lockmgr.c
154 base64_test: Makefile
156 $(CXX) -DBIN_TEST $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) base64.c
157 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ base64.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
159 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) base64.c
161 rwlock_test: Makefile
163 $(CXX) -DTEST_RWLOCK $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) rwlock.c
164 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ rwlock.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
166 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) rwlock.c
168 devlock_test: Makefile
170 $(CXX) -DTEST_devlock $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) devlock.c
171 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ devlock.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
173 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) devlock.c
175 htable_test: Makefile
177 $(CXX) -DTEST_SMALL_HTABLE -DTEST_NON_CHAR -DTEST_PROGRAM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) htable.c
178 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ htable.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
180 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) htable.c
182 crc32sum: Makefile crc32.o
184 $(CXX) -DCRC32_SUM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) crc32.c
185 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ crc32.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
187 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) crc32.c
189 md5sum: Makefile md5.o
191 $(CXX) -DMD5_SUM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) md5.c
192 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ md5.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
194 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) md5.c
196 sha1sum: Makefile sha1.o
198 $(CXX) -DSHA1_SUM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) sha1.c
199 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ sha1.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
201 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) sha1.c
203 bsnprintf: Makefile bsnprintf.o
205 $(CXX) -DTEST_PROGRAM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) bsnprintf.c
206 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ bsnprintf.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
208 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) bsnprintf.c
212 $(CXX) -DTEST_PROGRAM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) ini.c
213 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ ini.o -lbaccfg -lbac $(DLIB) -lm $(LIBS) $(OPENSSL_LIBS)
215 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) ini.c
218 $(MKDIR) $(DESTDIR)/$(includedir)/bacula
219 for I in $(INCLUDE_FILES); do \
220 $(INSTALL_DATA) $$I $(DESTDIR)$(includedir)/bacula/`basename $$I`; \
224 for I in $(INCLUDE_FILES); do \
225 $(RMF) $(DESTDIR)$(includedir)/bacula/`basename $$I`; \
229 $(MKDIR) $(DESTDIR)$(libdir)
230 $(LIBTOOL_INSTALL_FINISH) $(INSTALL_LIB) libbac.la $(DESTDIR)$(libdir)
231 $(LIBTOOL_INSTALL_FINISH) $(INSTALL_LIB) libbaccfg.la $(DESTDIR)$(libdir)
232 $(LIBTOOL_INSTALL_FINISH) $(INSTALL_LIB) libbacpy.la $(DESTDIR)$(libdir)
235 $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbac.la
236 $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbaccfg.la
237 $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbacpy.la
239 install: @LIBTOOL_INSTALL_TARGET@ @INCLUDE_INSTALL_TARGET@
241 uninstall: @LIBTOOL_UNINSTALL_TARGET@ @INCLUDE_UNINSTALL_TARGET@
244 @find . -name '*.lo' -print | xargs $(LIBTOOL_CLEAN) $(RMF)
246 @$(RMF) -r .libs _libs
249 @$(RMF) core a.out *.o *.bak *.tex *.pdf *~ *.intpro *.extpro 1 2 3
250 @$(RMF) rwlock_test md5sum sha1sum
256 if test $(srcdir) = .; then $(MAKE) realclean; fi
257 (cd $(srcdir); $(RMF) Makefile)
259 # Semi-automatic generation of dependencies:
260 # Use gcc -M because X11 `makedepend' doesn't work on all systems
261 # and it also includes system headers.
262 # `semi'-automatic since dependencies are generated at distribution time.
265 @$(MV) Makefile Makefile.bak
266 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
267 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
268 @for src in $(LIBBAC_SRCS) $(LIBBACCFG_SRCS) $(LIBBACPY_SRCS); do \
269 $(CXX) -S -M -MT `basename $$src .c`$(DEFAULT_OBJECT_TYPE) $(CPPFLAGS) $(XINC) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $$src >> Makefile; \
271 @if test -f Makefile ; then \
272 $(RMF) Makefile.bak; \
274 $(MV) Makefile.bak Makefile; \
275 echo " ===== Something went wrong in make depend ====="; \
278 # -----------------------------------------------------------------------
279 # DO NOT DELETE: nice dependency list follows