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=$(DEFAULT_OBJECT_TYPE))
56 LIBBAC_LT_REVISION = 0
60 # libbaccfg (config functions)
62 LIBBACCFG_SRCS = parse_conf.c res.c
63 LIBBACCFG_OBJS = $(LIBBACCFG_SRCS:.c=$(DEFAULT_OBJECT_TYPE))
64 LIBBACCFG_LT_CURRENT = 1
65 LIBBACCFG_LT_REVISION = 0
69 # libbacpy (python functions)
71 LIBBACPY_SRCS = pythonlib.c
72 LIBBACPY_OBJS = $(LIBBACPY_SRCS:.c=$(DEFAULT_OBJECT_TYPE))
73 LIBBACPY_LT_CURRENT = 1
74 LIBBACPY_LT_REVISION = 0
77 .SUFFIXES: .c .cc .o .lo .ch .dvi .pdf .tex .view .w .1
84 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
88 $(NO_ECHO)$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
92 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
96 $(NO_ECHO)$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
98 # specific build rules
100 pythonlib.o: pythonlib.c
102 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(python) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
104 pythonlib.lo: pythonlib.c
106 $(NO_ECHO)$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(python) -I../configlib -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
108 #-------------------------------------------------------------------------
109 all: Makefile libbac$(DEFAULT_ARCHIVE_TYPE) libbaccfg$(DEFAULT_ARCHIVE_TYPE) libbacpy$(DEFAULT_ARCHIVE_TYPE)
110 @echo "==== Make of lib is good ===="
113 libbac.a: $(LIBBAC_OBJS)
114 @echo "Making $@ ..."
115 $(AR) rc $@ $(LIBBAC_OBJS)
118 libbac.la: Makefile $(LIBBAC_OBJS)
119 @echo "Making $@ ..."
120 $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(LIBBAC_OBJS) -export-dynamic -rpath $(libdir) -version-info $(LIBBAC_LT_CURRENT):$(LIBBAC_LT_REVISION):$(LIBBAC_LT_AGE) $(WRAPLIBS) $(CAP_LIBS)
122 libbaccfg.a: $(LIBBACCFG_OBJS)
123 @echo "Making $@ ..."
124 $(AR) rc $@ $(LIBBACCFG_OBJS)
127 libbaccfg.la: Makefile $(LIBBACCFG_OBJS)
128 @echo "Making $@ ..."
129 $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(LIBBACCFG_OBJS) -export-dynamic -rpath $(libdir) -version-info $(LIBBACCFG_LT_CURRENT):$(LIBBACCFG_LT_REVISION):$(LIBBACCFG_LT_AGE)
131 libbacpy.a: $(LIBBACPY_OBJS)
132 @echo "Making $@ ..."
133 $(AR) rc $@ $(LIBBACPY_OBJS)
136 libbacpy.la: Makefile $(LIBBACPY_OBJS)
137 @echo "Making $@ ..."
138 $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(LIBBACPY_OBJS) -export-dynamic -rpath $(libdir) -version-info $(LIBBACPY_LT_CURRENT):$(LIBBACPY_LT_REVISION):$(LIBBACPY_LT_AGE) $(PYTHON_LIBS)
140 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
142 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
144 lockmgr_test: Makefile
146 $(CXX) -D _TEST_IT $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) lockmgr.c
147 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ lockmgr.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
149 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) lockmgr.c
151 rwlock_test: Makefile
153 $(CXX) -DTEST_RWLOCK $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) rwlock.c
154 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ rwlock.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
156 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) rwlock.c
158 md5sum: Makefile md5.o
160 $(CXX) -DMD5_SUM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) md5.c
161 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ md5.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
163 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) md5.c
165 sha1sum: Makefile sha1.o
167 $(CXX) -DSHA1_SUM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) sha1.c
168 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ sha1.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
170 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) sha1.c
172 bsnprintf: Makefile bsnprintf.o
174 $(CXX) -DTEST_PROGRAM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) bsnprintf.c
175 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ bsnprintf.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
177 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) bsnprintf.c
180 $(MKDIR) $(DESTDIR)/$(includedir)/bacula
181 for I in $(INCLUDE_FILES); do \
182 $(INSTALL_DATA) $$I $(DESTDIR)$(includedir)/bacula/`basename $$I`; \
186 for I in $(INCLUDE_FILES); do \
187 $(RMF) $(DESTDIR)$(includedir)/bacula/`basename $$I`; \
191 $(MKDIR) $(DESTDIR)$(libdir)
192 $(LIBTOOL_INSTALL_FINISH) $(INSTALL_PROGRAM) libbac.la $(DESTDIR)$(libdir)
193 $(LIBTOOL_INSTALL_FINISH) $(INSTALL_PROGRAM) libbaccfg.la $(DESTDIR)$(libdir)
194 $(LIBTOOL_INSTALL_FINISH) $(INSTALL_PROGRAM) libbacpy.la $(DESTDIR)$(libdir)
197 $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbac.la
198 $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbaccfg.la
199 $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbacpy.la
201 install: @LIBTOOL_INSTALL_TARGET@ @INCLUDE_INSTALL_TARGET@
203 uninstall: @LIBTOOL_UNINSTALL_TARGET@ @INCLUDE_UNINSTALL_TARGET@
206 @find . -name '*.lo' -print | xargs $(LIBTOOL_CLEAN) $(RMF)
208 @$(RMF) -r .libs _libs
211 @$(RMF) core a.out *.o *.bak *.tex *.pdf *~ *.intpro *.extpro 1 2 3
212 @$(RMF) rwlock_test md5sum sha1sum
218 if test $(srcdir) = .; then $(MAKE) realclean; fi
219 (cd $(srcdir); $(RMF) Makefile)
221 # Semi-automatic generation of dependencies:
222 # Use gcc -M because X11 `makedepend' doesn't work on all systems
223 # and it also includes system headers.
224 # `semi'-automatic since dependencies are generated at distribution time.
227 @$(MV) Makefile Makefile.bak
228 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
229 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
230 @for src in $(LIBBAC_SRCS) $(LIBBACCFG_SRCS) $(LIBBACPY_SRCS); do \
231 $(CXX) -S -M -MT `basename $$src .c`$(DEFAULT_OBJECT_TYPE) $(CPPFLAGS) $(XINC) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(SQL_INC) $$src >> Makefile; \
233 @if test -f Makefile ; then \
234 $(RMF) Makefile.bak; \
236 $(MV) Makefile.bak Makefile; \
237 echo " ===== Something went wrong in make depend ====="; \
240 # -----------------------------------------------------------------------
241 # DO NOT DELETE: nice dependency list follows