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
40 # include files installed when using libtool
42 INCLUDE_FILES = ../baconfig.h ../bacula.h ../bc_types.h \
43 ../config.h ../jcr.h ../version.h \
44 address_conf.h alist.h attr.h base64.h \
45 berrno.h bits.h bpipe.h breg.h bregex.h \
46 bsock.h btime.h btimers.h crypto.h dlist.h \
47 fnmatch.h guid_to_name.h htable.h lex.h \
48 lib.h md5.h mem_pool.h message.h mntent_cache.h \
49 openssl.h plugins.h protos.h queue.h rblist.h \
50 runscript.h rwlock.h serial.h sha1.h \
51 smartall.h status.h tls.h tree.h var.h \
52 waitq.h watchdog.h workq.h \
54 pythonlib.h lockmgr.h devlock.h
59 LIBBAC_SRCS = attr.c base64.c berrno.c bsys.c bget_msg.c \
60 bnet.c bnet_server.c runscript.c \
61 bsock.c bpipe.c bsnprintf.c btime.c \
62 cram-md5.c crc32.c crypto.c daemon.c edit.c fnmatch.c \
63 guid_to_name.c hmac.c jcr.c lex.c alist.c dlist.c \
64 md5.c message.c mem_pool.c mntent_cache.c openssl.c \
65 plugins.c priv.c queue.c bregex.c \
66 rwlock.c scan.c serial.c sha1.c \
67 signal.c smartall.c rblist.c tls.c tree.c \
68 util.c var.c watchdog.c workq.c btimers.c \
69 address_conf.c breg.c htable.c lockmgr.c devlock.c
71 LIBBAC_OBJS = $(LIBBAC_SRCS:.c=.o)
72 LIBBAC_LOBJS = $(LIBBAC_SRCS:.c=.lo)
75 # libbaccfg (config functions)
77 LIBBACCFG_SRCS = parse_conf.c res.c
78 LIBBACCFG_OBJS = $(LIBBACCFG_SRCS:.c=.o)
79 LIBBACCFG_LOBJS = $(LIBBACCFG_SRCS:.c=.lo)
82 # libbacpy (python functions)
84 LIBBACPY_SRCS = pythonlib.c
85 LIBBACPY_OBJS = $(LIBBACPY_SRCS:.c=.o)
86 LIBBACPY_LOBJS = $(LIBBACPY_SRCS:.c=.lo)
88 .SUFFIXES: .c .cc .o .lo .ch .dvi .pdf .tex .view .w .1
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) $<
103 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
107 $(NO_ECHO)$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
109 # specific build rules
111 pythonlib.o: pythonlib.c
113 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(python) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
115 pythonlib.lo: pythonlib.c
117 $(NO_ECHO)$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(python) -I../configlib -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
119 #-------------------------------------------------------------------------
120 all: Makefile libbac$(DEFAULT_ARCHIVE_TYPE) libbaccfg$(DEFAULT_ARCHIVE_TYPE) libbacpy$(DEFAULT_ARCHIVE_TYPE)
121 @echo "==== Make of lib is good ===="
124 libbac.a: $(LIBBAC_OBJS)
125 @echo "Making $@ ..."
126 $(AR) rc $@ $(LIBBAC_OBJS)
129 libbac.la: Makefile $(LIBBAC_LOBJS)
130 @echo "Making $@ ..."
131 $(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) $(ZLIBS)
133 libbaccfg.a: $(LIBBACCFG_OBJS)
134 @echo "Making $@ ..."
135 $(AR) rc $@ $(LIBBACCFG_OBJS)
138 libbaccfg.la: Makefile $(LIBBACCFG_LOBJS)
139 @echo "Making $@ ..."
140 $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(LIBBACCFG_LOBJS) -export-dynamic -rpath $(libdir) -release $(LIBBACCFG_LT_CURRENT).$(LIBBACCFG_LT_REVISION).$(LIBBACCFG_LT_AGE)
142 libbacpy.a: $(LIBBACPY_OBJS)
143 @echo "Making $@ ..."
144 $(AR) rc $@ $(LIBBACPY_OBJS)
147 libbacpy.la: Makefile $(LIBBACPY_LOBJS)
148 @echo "Making $@ ..."
149 $(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)
151 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
153 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
155 lockmgr_test: Makefile
157 $(CXX) -D _TEST_IT $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) lockmgr.c
158 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ lockmgr.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
160 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) lockmgr.c
162 rwlock_test: Makefile
164 $(CXX) -DTEST_RWLOCK $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) rwlock.c
165 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ rwlock.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
167 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) rwlock.c
169 devlock_test: Makefile
171 $(CXX) -DTEST_devlock $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) devlock.c
172 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ devlock.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
174 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) devlock.c
177 md5sum: Makefile md5.o
179 $(CXX) -DMD5_SUM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) md5.c
180 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ md5.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
182 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) md5.c
184 sha1sum: Makefile sha1.o
186 $(CXX) -DSHA1_SUM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) sha1.c
187 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ sha1.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
189 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) sha1.c
191 bsnprintf: Makefile bsnprintf.o
193 $(CXX) -DTEST_PROGRAM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) bsnprintf.c
194 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ bsnprintf.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
196 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) bsnprintf.c
199 $(MKDIR) $(DESTDIR)/$(includedir)/bacula
200 for I in $(INCLUDE_FILES); do \
201 $(INSTALL_DATA) $$I $(DESTDIR)$(includedir)/bacula/`basename $$I`; \
205 for I in $(INCLUDE_FILES); do \
206 $(RMF) $(DESTDIR)$(includedir)/bacula/`basename $$I`; \
210 $(MKDIR) $(DESTDIR)$(libdir)
211 $(LIBTOOL_INSTALL_FINISH) $(INSTALL_PROGRAM) libbac.la $(DESTDIR)$(libdir)
212 $(LIBTOOL_INSTALL_FINISH) $(INSTALL_PROGRAM) libbaccfg.la $(DESTDIR)$(libdir)
213 $(LIBTOOL_INSTALL_FINISH) $(INSTALL_PROGRAM) libbacpy.la $(DESTDIR)$(libdir)
216 $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbac.la
217 $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbaccfg.la
218 $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbacpy.la
220 install: @LIBTOOL_INSTALL_TARGET@ @INCLUDE_INSTALL_TARGET@
222 uninstall: @LIBTOOL_UNINSTALL_TARGET@ @INCLUDE_UNINSTALL_TARGET@
225 @find . -name '*.lo' -print | xargs $(LIBTOOL_CLEAN) $(RMF)
227 @$(RMF) -r .libs _libs
230 @$(RMF) core a.out *.o *.bak *.tex *.pdf *~ *.intpro *.extpro 1 2 3
231 @$(RMF) rwlock_test md5sum sha1sum
237 if test $(srcdir) = .; then $(MAKE) realclean; fi
238 (cd $(srcdir); $(RMF) Makefile)
240 # Semi-automatic generation of dependencies:
241 # Use gcc -M because X11 `makedepend' doesn't work on all systems
242 # and it also includes system headers.
243 # `semi'-automatic since dependencies are generated at distribution time.
246 @$(MV) Makefile Makefile.bak
247 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
248 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
249 @for src in $(LIBBAC_SRCS) $(LIBBACCFG_SRCS) $(LIBBACPY_SRCS); do \
250 $(CXX) -S -M -MT `basename $$src .c`$(DEFAULT_OBJECT_TYPE) $(CPPFLAGS) $(XINC) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(SQL_INC) $$src >> Makefile; \
252 @if test -f Makefile ; then \
253 $(RMF) Makefile.bak; \
255 $(MV) Makefile.bak Makefile; \
256 echo " ===== Something went wrong in make depend ====="; \
259 # -----------------------------------------------------------------------
260 # DO NOT DELETE: nice dependency list follows