4 python = @PYTHON_INCDIR@
14 # this dir relative to top dir
24 # include files installed when using libtool
26 INCLUDE_FILES = ../baconfig.h ../bacula.h ../bc_types.h \
27 ../config.h ../jcr.h ../version.h \
28 address_conf.h alist.h attr.h base64.h \
29 berrno.h bits.h bpipe.h breg.h bregex.h \
30 bsock.h btime.h btimers.h crypto.h dlist.h \
31 fnmatch.h guid_to_name.h htable.h lex.h \
32 lib.h md5.h mem_pool.h message.h openssl.h \
33 plugins.h protos.h queue.h rblist.h \
34 runscript.h rwlock.h serial.h sha1.h \
35 smartall.h status.h tls.h tree.h var.h \
36 waitq.h watchdog.h workq.h \
43 LIBBAC_SRCS = attr.c base64.c berrno.c bsys.c bget_msg.c \
44 bnet.c bnet_server.c runscript.c \
45 bsock.c bpipe.c bsnprintf.c btime.c \
46 cram-md5.c crc32.c crypto.c daemon.c edit.c fnmatch.c \
47 guid_to_name.c hmac.c jcr.c lex.c alist.c dlist.c \
48 md5.c message.c mem_pool.c openssl.c \
49 plugins.c priv.c queue.c bregex.c \
50 rwlock.c scan.c serial.c sha1.c \
51 signal.c smartall.c rblist.c tls.c tree.c \
52 util.c var.c watchdog.c workq.c btimers.c \
53 address_conf.c breg.c htable.c lockmgr.c
54 LIBBAC_OBJS = $(LIBBAC_SRCS:.c=.o)
55 LIBBAC_LOBJS = $(LIBBAC_SRCS:.c=.lo)
57 LIBBAC_LT_REVISION = 1
61 # libbaccfg (config functions)
63 LIBBACCFG_SRCS = parse_conf.c res.c
64 LIBBACCFG_OBJS = $(LIBBACCFG_SRCS:.c=.o)
65 LIBBACCFG_LOBJS = $(LIBBACCFG_SRCS:.c=.lo)
66 LIBBACCFG_LT_CURRENT = 5
67 LIBBACCFG_LT_REVISION = 1
71 # libbacpy (python functions)
73 LIBBACPY_SRCS = pythonlib.c
74 LIBBACPY_OBJS = $(LIBBACPY_SRCS:.c=.o)
75 LIBBACPY_LOBJS = $(LIBBACPY_SRCS:.c=.lo)
76 LIBBACPY_LT_CURRENT = 5
77 LIBBACPY_LT_REVISION = 1
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) -version-info $(LIBBAC_LT_CURRENT):$(LIBBAC_LT_REVISION):$(LIBBAC_LT_AGE) $(WRAPLIBS) $(CAP_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) -version-info $(LIBBACCFG_LT_CURRENT):$(LIBBACCFG_LT_REVISION):$(LIBBACCFG_LT_AGE)
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) -version-info $(LIBBACPY_LT_CURRENT):$(LIBBACPY_LT_REVISION):$(LIBBACPY_LT_AGE) $(PYTHON_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 md5sum: Makefile md5.o
163 $(CXX) -DMD5_SUM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) md5.c
164 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ md5.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
166 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) md5.c
168 sha1sum: Makefile sha1.o
170 $(CXX) -DSHA1_SUM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) sha1.c
171 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ sha1.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
173 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) sha1.c
175 bsnprintf: Makefile bsnprintf.o
177 $(CXX) -DTEST_PROGRAM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) bsnprintf.c
178 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ bsnprintf.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
180 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) bsnprintf.c
183 $(MKDIR) $(DESTDIR)/$(includedir)/bacula
184 for I in $(INCLUDE_FILES); do \
185 $(INSTALL_DATA) $$I $(DESTDIR)$(includedir)/bacula/`basename $$I`; \
189 for I in $(INCLUDE_FILES); do \
190 $(RMF) $(DESTDIR)$(includedir)/bacula/`basename $$I`; \
194 $(MKDIR) $(DESTDIR)$(libdir)
195 $(LIBTOOL_INSTALL_FINISH) $(INSTALL_PROGRAM) libbac.la $(DESTDIR)$(libdir)
196 $(LIBTOOL_INSTALL_FINISH) $(INSTALL_PROGRAM) libbaccfg.la $(DESTDIR)$(libdir)
197 $(LIBTOOL_INSTALL_FINISH) $(INSTALL_PROGRAM) libbacpy.la $(DESTDIR)$(libdir)
200 $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbac.la
201 $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbaccfg.la
202 $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbacpy.la
204 install: @LIBTOOL_INSTALL_TARGET@ @INCLUDE_INSTALL_TARGET@
206 uninstall: @LIBTOOL_UNINSTALL_TARGET@ @INCLUDE_UNINSTALL_TARGET@
209 @find . -name '*.lo' -print | xargs $(LIBTOOL_CLEAN) $(RMF)
211 @$(RMF) -r .libs _libs
214 @$(RMF) core a.out *.o *.bak *.tex *.pdf *~ *.intpro *.extpro 1 2 3
215 @$(RMF) rwlock_test md5sum sha1sum
221 if test $(srcdir) = .; then $(MAKE) realclean; fi
222 (cd $(srcdir); $(RMF) Makefile)
224 # Semi-automatic generation of dependencies:
225 # Use gcc -M because X11 `makedepend' doesn't work on all systems
226 # and it also includes system headers.
227 # `semi'-automatic since dependencies are generated at distribution time.
230 @$(MV) Makefile Makefile.bak
231 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
232 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
233 @for src in $(LIBBAC_SRCS) $(LIBBACCFG_SRCS) $(LIBBACPY_SRCS); do \
234 $(CXX) -S -M -MT `basename $$src .c`$(DEFAULT_OBJECT_TYPE) $(CPPFLAGS) $(XINC) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(SQL_INC) $$src >> Makefile; \
236 @if test -f Makefile ; then \
237 $(RMF) Makefile.bak; \
239 $(MV) Makefile.bak Makefile; \
240 echo " ===== Something went wrong in make depend ====="; \
243 # -----------------------------------------------------------------------
244 # DO NOT DELETE: nice dependency list follows