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 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 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 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 = 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 rwlock_test: Makefile
156 $(CXX) -DTEST_RWLOCK $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) rwlock.c
157 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ rwlock.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
159 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) rwlock.c
161 devlock_test: Makefile
163 $(CXX) -DTEST_devlock $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) devlock.c
164 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ devlock.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
166 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) devlock.c
168 htable_test: Makefile
170 $(CXX) -DTEST_SMALL_HTABLE -DTEST_NON_CHAR -DTEST_PROGRAM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) htable.c
171 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ htable.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
173 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) htable.c
175 crc32sum: Makefile crc32.o
177 $(CXX) -DCRC32_SUM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) crc32.c
178 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ crc32.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
180 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) crc32.c
182 md5sum: Makefile md5.o
184 $(CXX) -DMD5_SUM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) md5.c
185 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ md5.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
187 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) md5.c
189 sha1sum: Makefile sha1.o
191 $(CXX) -DSHA1_SUM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) sha1.c
192 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ sha1.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
194 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) sha1.c
196 bsnprintf: Makefile bsnprintf.o
198 $(CXX) -DTEST_PROGRAM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) bsnprintf.c
199 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ bsnprintf.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
201 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) bsnprintf.c
204 $(MKDIR) $(DESTDIR)/$(includedir)/bacula
205 for I in $(INCLUDE_FILES); do \
206 $(INSTALL_DATA) $$I $(DESTDIR)$(includedir)/bacula/`basename $$I`; \
210 for I in $(INCLUDE_FILES); do \
211 $(RMF) $(DESTDIR)$(includedir)/bacula/`basename $$I`; \
215 $(MKDIR) $(DESTDIR)$(libdir)
216 $(LIBTOOL_INSTALL_FINISH) $(INSTALL_LIB) libbac.la $(DESTDIR)$(libdir)
217 $(LIBTOOL_INSTALL_FINISH) $(INSTALL_LIB) libbaccfg.la $(DESTDIR)$(libdir)
218 $(LIBTOOL_INSTALL_FINISH) $(INSTALL_LIB) libbacpy.la $(DESTDIR)$(libdir)
221 $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbac.la
222 $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbaccfg.la
223 $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbacpy.la
225 install: @LIBTOOL_INSTALL_TARGET@ @INCLUDE_INSTALL_TARGET@
227 uninstall: @LIBTOOL_UNINSTALL_TARGET@ @INCLUDE_UNINSTALL_TARGET@
230 @find . -name '*.lo' -print | xargs $(LIBTOOL_CLEAN) $(RMF)
232 @$(RMF) -r .libs _libs
235 @$(RMF) core a.out *.o *.bak *.tex *.pdf *~ *.intpro *.extpro 1 2 3
236 @$(RMF) rwlock_test md5sum sha1sum
242 if test $(srcdir) = .; then $(MAKE) realclean; fi
243 (cd $(srcdir); $(RMF) Makefile)
245 # Semi-automatic generation of dependencies:
246 # Use gcc -M because X11 `makedepend' doesn't work on all systems
247 # and it also includes system headers.
248 # `semi'-automatic since dependencies are generated at distribution time.
251 @$(MV) Makefile Makefile.bak
252 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
253 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
254 @for src in $(LIBBAC_SRCS) $(LIBBACCFG_SRCS) $(LIBBACPY_SRCS); do \
255 $(CXX) -S -M -MT `basename $$src .c`$(DEFAULT_OBJECT_TYPE) $(CPPFLAGS) $(XINC) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $$src >> Makefile; \
257 @if test -f Makefile ; then \
258 $(RMF) Makefile.bak; \
260 $(MV) Makefile.bak Makefile; \
261 echo " ===== Something went wrong in make depend ====="; \
264 # -----------------------------------------------------------------------
265 # DO NOT DELETE: nice dependency list follows