5 # Define library versions
6 LIBBAC_LT_CURRENT = @LIBBAC_LT_CURRENT@
7 LIBBAC_LT_REVISION = @LIBBAC_LT_REVISION@
8 LIBBAC_LT_AGE = @LIBBAC_LT_AGE@
10 LIBBACCFG_LT_CURRENT = @LIBBACCFG_LT_CURRENT@
11 LIBBACCFG_LT_REVISION = @LIBBACCFG_LT_REVISION@
12 LIBBACCFG_LT_AGE = @LIBBACCFG_LT_AGE@
14 LIBBACPY_LT_CURRENT = @LIBBACPY_LT_CURRENT@
15 LIBBACPY_LT_REVISION = @LIBBACPY_LT_REVISION@
16 LIBBACPY_LT_AGE = @LIBBACPY_LT_AGE@
19 python = @PYTHON_INCDIR@
29 # this dir relative to top dir
39 # include files installed when using libtool
41 INCLUDE_FILES = ../baconfig.h ../bacula.h ../bc_types.h \
42 ../config.h ../jcr.h ../version.h \
43 address_conf.h alist.h attr.h base64.h \
44 berrno.h bits.h bpipe.h breg.h bregex.h \
45 bsock.h btime.h btimers.h crypto.h dlist.h \
46 fnmatch.h guid_to_name.h htable.h lex.h \
47 lib.h md5.h mem_pool.h message.h openssl.h \
48 plugins.h protos.h queue.h rblist.h \
49 runscript.h rwlock.h serial.h sha1.h \
50 smartall.h status.h tls.h tree.h var.h \
51 waitq.h watchdog.h workq.h \
53 pythonlib.h lockmgr.h devlock.h
58 LIBBAC_SRCS = attr.c base64.c berrno.c bsys.c bget_msg.c \
59 bnet.c bnet_server.c runscript.c \
60 bsock.c bpipe.c bsnprintf.c btime.c \
61 cram-md5.c crc32.c crypto.c daemon.c edit.c fnmatch.c \
62 guid_to_name.c hmac.c jcr.c lex.c alist.c dlist.c \
63 md5.c message.c mem_pool.c openssl.c \
64 plugins.c priv.c queue.c bregex.c \
65 rwlock.c scan.c serial.c sha1.c \
66 signal.c smartall.c rblist.c tls.c tree.c \
67 util.c var.c watchdog.c workq.c btimers.c \
68 address_conf.c breg.c htable.c lockmgr.c devlock.c
70 LIBBAC_OBJS = $(LIBBAC_SRCS:.c=.o)
71 LIBBAC_LOBJS = $(LIBBAC_SRCS:.c=.lo)
74 # libbaccfg (config functions)
76 LIBBACCFG_SRCS = parse_conf.c res.c
77 LIBBACCFG_OBJS = $(LIBBACCFG_SRCS:.c=.o)
78 LIBBACCFG_LOBJS = $(LIBBACCFG_SRCS:.c=.lo)
81 # libbacpy (python functions)
83 LIBBACPY_SRCS = pythonlib.c
84 LIBBACPY_OBJS = $(LIBBACPY_SRCS:.c=.o)
85 LIBBACPY_LOBJS = $(LIBBACPY_SRCS:.c=.lo)
87 .SUFFIXES: .c .cc .o .lo .ch .dvi .pdf .tex .view .w .1
94 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
98 $(NO_ECHO)$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
102 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
106 $(NO_ECHO)$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
108 # specific build rules
110 pythonlib.o: pythonlib.c
112 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(python) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
114 pythonlib.lo: pythonlib.c
116 $(NO_ECHO)$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(python) -I../configlib -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
118 #-------------------------------------------------------------------------
119 all: Makefile libbac$(DEFAULT_ARCHIVE_TYPE) libbaccfg$(DEFAULT_ARCHIVE_TYPE) libbacpy$(DEFAULT_ARCHIVE_TYPE)
120 @echo "==== Make of lib is good ===="
123 libbac.a: $(LIBBAC_OBJS)
124 @echo "Making $@ ..."
125 $(AR) rc $@ $(LIBBAC_OBJS)
128 libbac.la: Makefile $(LIBBAC_LOBJS)
129 @echo "Making $@ ..."
130 $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(LIBBAC_LOBJS) -export-dynamic -rpath $(libdir) -release $(LIBBAC_LT_CURRENT).$(LIBBAC_LT_REVISION).$(LIBBAC_LT_AGE) $(WRAPLIBS) $(CAP_LIBS)
132 libbaccfg.a: $(LIBBACCFG_OBJS)
133 @echo "Making $@ ..."
134 $(AR) rc $@ $(LIBBACCFG_OBJS)
137 libbaccfg.la: Makefile $(LIBBACCFG_LOBJS)
138 @echo "Making $@ ..."
139 $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(LIBBACCFG_LOBJS) -export-dynamic -rpath $(libdir) -release $(LIBBACCFG_LT_CURRENT).$(LIBBACCFG_LT_REVISION).$(LIBBACCFG_LT_AGE)
141 libbacpy.a: $(LIBBACPY_OBJS)
142 @echo "Making $@ ..."
143 $(AR) rc $@ $(LIBBACPY_OBJS)
146 libbacpy.la: Makefile $(LIBBACPY_LOBJS)
147 @echo "Making $@ ..."
148 $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(LIBBACPY_LOBJS) -export-dynamic -rpath $(libdir) -release $(LIBBACPY_LT_CURRENT).$(LIBBACPY_LT_REVISION).$(LIBBACPY_LT_AGE) $(PYTHON_LIBS)
150 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
152 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
154 lockmgr_test: Makefile
156 $(CXX) -D _TEST_IT $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) lockmgr.c
157 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ lockmgr.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
159 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) lockmgr.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
176 md5sum: Makefile md5.o
178 $(CXX) -DMD5_SUM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) md5.c
179 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ md5.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
181 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) md5.c
183 sha1sum: Makefile sha1.o
185 $(CXX) -DSHA1_SUM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) sha1.c
186 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ sha1.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
188 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) sha1.c
190 bsnprintf: Makefile bsnprintf.o
192 $(CXX) -DTEST_PROGRAM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) bsnprintf.c
193 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ bsnprintf.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
195 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) bsnprintf.c
198 $(MKDIR) $(DESTDIR)/$(includedir)/bacula
199 for I in $(INCLUDE_FILES); do \
200 $(INSTALL_DATA) $$I $(DESTDIR)$(includedir)/bacula/`basename $$I`; \
204 for I in $(INCLUDE_FILES); do \
205 $(RMF) $(DESTDIR)$(includedir)/bacula/`basename $$I`; \
209 $(MKDIR) $(DESTDIR)$(libdir)
210 $(LIBTOOL_INSTALL_FINISH) $(INSTALL_PROGRAM) libbac.la $(DESTDIR)$(libdir)
211 $(LIBTOOL_INSTALL_FINISH) $(INSTALL_PROGRAM) libbaccfg.la $(DESTDIR)$(libdir)
212 $(LIBTOOL_INSTALL_FINISH) $(INSTALL_PROGRAM) libbacpy.la $(DESTDIR)$(libdir)
215 $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbac.la
216 $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbaccfg.la
217 $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbacpy.la
219 install: @LIBTOOL_INSTALL_TARGET@ @INCLUDE_INSTALL_TARGET@
221 uninstall: @LIBTOOL_UNINSTALL_TARGET@ @INCLUDE_UNINSTALL_TARGET@
224 @find . -name '*.lo' -print | xargs $(LIBTOOL_CLEAN) $(RMF)
226 @$(RMF) -r .libs _libs
229 @$(RMF) core a.out *.o *.bak *.tex *.pdf *~ *.intpro *.extpro 1 2 3
230 @$(RMF) rwlock_test md5sum sha1sum
236 if test $(srcdir) = .; then $(MAKE) realclean; fi
237 (cd $(srcdir); $(RMF) Makefile)
239 # Semi-automatic generation of dependencies:
240 # Use gcc -M because X11 `makedepend' doesn't work on all systems
241 # and it also includes system headers.
242 # `semi'-automatic since dependencies are generated at distribution time.
245 @$(MV) Makefile Makefile.bak
246 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
247 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
248 @for src in $(LIBBAC_SRCS) $(LIBBACCFG_SRCS) $(LIBBACPY_SRCS); do \
249 $(CXX) -S -M -MT `basename $$src .c`$(DEFAULT_OBJECT_TYPE) $(CPPFLAGS) $(XINC) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(SQL_INC) $$src >> Makefile; \
251 @if test -f Makefile ; then \
252 $(RMF) Makefile.bak; \
254 $(MV) Makefile.bak Makefile; \
255 echo " ===== Something went wrong in make depend ====="; \
258 # -----------------------------------------------------------------------
259 # DO NOT DELETE: nice dependency list follows