4 python = @PYTHON_INCDIR@
14 # this dir relative to top dir
23 # include files installed when using libtool
25 INCLUDE_FILES = ../baconfig.h ../bacula.h ../bc_types.h \
26 ../config.h ../jcr.h ../version.h \
27 address_conf.h alist.h attr.h base64.h \
28 berrno.h bits.h bpipe.h breg.h bregex.h \
29 bsock.h btime.h btimers.h crypto.h dlist.h \
30 fnmatch.h guid_to_name.h htable.h lex.h \
31 lib.h md5.h mem_pool.h message.h openssl.h \
32 plugins.h protos.h queue.h rblist.h \
33 runscript.h rwlock.h serial.h sha1.h \
34 smartall.h status.h tls.h tree.h var.h \
35 waitq.h watchdog.h workq.h \
42 LIBBAC_SRCS = attr.c base64.c berrno.c bsys.c bget_msg.c \
43 bnet.c bnet_server.c runscript.c \
44 bsock.c bpipe.c bsnprintf.c btime.c \
45 cram-md5.c crc32.c crypto.c daemon.c edit.c fnmatch.c \
46 guid_to_name.c hmac.c jcr.c lex.c alist.c dlist.c \
47 md5.c message.c mem_pool.c openssl.c \
48 plugins.c queue.c bregex.c \
49 rwlock.c scan.c serial.c sha1.c \
50 signal.c smartall.c rblist.c tls.c tree.c \
51 util.c var.c watchdog.c workq.c btimers.c \
52 address_conf.c breg.c htable.c lockmgr.c
53 LIBBAC_OBJS = $(LIBBAC_SRCS:.c=$(DEFAULT_OBJECT_TYPE))
55 LIBBAC_LT_REVISION = 0
59 # libbaccfg (config functions)
61 LIBBACCFG_SRCS = parse_conf.c res.c
62 LIBBACCFG_OBJS = $(LIBBACCFG_SRCS:.c=$(DEFAULT_OBJECT_TYPE))
63 LIBBACCFG_LT_CURRENT = 1
64 LIBBACCFG_LT_REVISION = 0
68 # libbacpy (python functions)
70 LIBBACPY_SRCS = pythonlib.c
71 LIBBACPY_OBJS = $(LIBBACPY_SRCS:.c=$(DEFAULT_OBJECT_TYPE))
72 LIBBACPY_LT_CURRENT = 1
73 LIBBACPY_LT_REVISION = 0
76 .SUFFIXES: .c .cc .o .lo .ch .dvi .pdf .tex .view .w .1
83 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
87 $(NO_ECHO)$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
91 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
95 $(NO_ECHO)$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
97 # specific build rules
99 pythonlib.o: pythonlib.c
101 $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(python) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
103 pythonlib.lo: pythonlib.c
105 $(NO_ECHO)$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) -c $(WCFLAGS) $(CPPFLAGS) $(python) -I../configlib -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
107 #-------------------------------------------------------------------------
108 all: Makefile libbac$(DEFAULT_ARCHIVE_TYPE) libbaccfg$(DEFAULT_ARCHIVE_TYPE) libbacpy$(DEFAULT_ARCHIVE_TYPE)
109 @echo "==== Make of lib is good ===="
112 libbac.a: $(LIBBAC_OBJS)
113 @echo "Making $@ ..."
114 $(AR) rc $@ $(LIBBAC_OBJS)
117 libbac.la: Makefile $(LIBBAC_OBJS)
118 @echo "Making $@ ..."
119 $(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)
121 libbaccfg.a: $(LIBBACCFG_OBJS)
122 @echo "Making $@ ..."
123 $(AR) rc $@ $(LIBBACCFG_OBJS)
126 libbaccfg.la: Makefile $(LIBBACCFG_OBJS)
127 @echo "Making $@ ..."
128 $(LIBTOOL_LINK) $(CXX) $(DEFS) $(DEBUG) $(LDFLAGS) -o $@ $(LIBBACCFG_OBJS) -export-dynamic -rpath $(libdir) -version-info $(LIBBACCFG_LT_CURRENT):$(LIBBACCFG_LT_REVISION):$(LIBBACCFG_LT_AGE)
130 libbacpy.a: $(LIBBACPY_OBJS)
131 @echo "Making $@ ..."
132 $(AR) rc $@ $(LIBBACPY_OBJS)
135 libbacpy.la: Makefile $(LIBBACPY_OBJS)
136 @echo "Making $@ ..."
137 $(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)
139 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
141 && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
143 lockmgr_test: Makefile
145 $(CXX) -D _TEST_IT $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) lockmgr.c
146 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ lockmgr.o $(LIBS) $(DLIB) -lbac $(OPENSSL_LIBS) -lm
148 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) lockmgr.c
150 rwlock_test: Makefile
152 $(CXX) -DTEST_RWLOCK $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) rwlock.c
153 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ rwlock.o $(LIBS) $(DLIB) -lbac $(OPENSSL_LIBS) -lm
155 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) rwlock.c
157 md5sum: Makefile md5.o
159 $(CXX) -DMD5_SUM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) md5.c
160 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ md5.o $(LIBS) $(DLIB) -lbac $(OPENSSL_LIBS) -lm
162 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) md5.c
164 sha1sum: Makefile sha1.o
166 $(CXX) -DSHA1_SUM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) sha1.c
167 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ sha1.o $(LIBS) $(DLIB) -lbac $(OPENSSL_LIBS) -lm
169 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) sha1.c
171 bsnprintf: Makefile bsnprintf.o
173 $(CXX) -DTEST_PROGRAM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) bsnprintf.c
174 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ bsnprintf.o $(LIBS) $(DLIB) -lbac $(OPENSSL_LIBS) -lm
176 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) bsnprintf.c
179 $(MKDIR) $(DESTDIR)/$(includedir)/bacula
180 for I in $(INCLUDE_FILES); do \
181 $(INSTALL_DATA) $$I $(DESTDIR)$(includedir)/bacula/`basename $$I`; \
185 for I in $(INCLUDE_FILES); do \
186 $(RMF) $(DESTDIR)$(includedir)/bacula/`basename $$I`; \
190 $(MKDIR) $(DESTDIR)$(libdir)
191 $(LIBTOOL_INSTALL_FINISH) $(INSTALL_PROGRAM) libbac.la $(DESTDIR)$(libdir)
192 $(LIBTOOL_INSTALL_FINISH) $(INSTALL_PROGRAM) libbaccfg.la $(DESTDIR)$(libdir)
193 $(LIBTOOL_INSTALL_FINISH) $(INSTALL_PROGRAM) libbacpy.la $(DESTDIR)$(libdir)
196 $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbac.la
197 $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbaccfg.la
198 $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbacpy.la
200 install: @LIBTOOL_INSTALL_TARGET@ @INCLUDE_INSTALL_TARGET@
202 uninstall: @LIBTOOL_UNINSTALL_TARGET@ @INCLUDE_UNINSTALL_TARGET@
205 @find . -name '*.lo' -print | xargs $(LIBTOOL_CLEAN) $(RMF)
207 @$(RMF) -r .libs _libs
210 @$(RMF) core a.out *.o *.bak *.tex *.pdf *~ *.intpro *.extpro 1 2 3
211 @$(RMF) rwlock_test md5sum sha1sum
217 if test $(srcdir) = .; then $(MAKE) realclean; fi
218 (cd $(srcdir); $(RMF) Makefile)
220 # Semi-automatic generation of dependencies:
221 # Use gcc -M because X11 `makedepend' doesn't work on all systems
222 # and it also includes system headers.
223 # `semi'-automatic since dependencies are generated at distribution time.
226 @$(MV) Makefile Makefile.bak
227 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
228 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
229 @for src in $(LIBBAC_SRCS) $(LIBBACCFG_SRCS) $(LIBBACPY_SRCS); do \
230 $(CXX) -S -M -MT `basename $$src .c`$(DEFAULT_OBJECT_TYPE) $(CPPFLAGS) $(XINC) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(SQL_INC) $$src >> Makefile; \
232 @if test -f Makefile ; then \
233 $(RMF) Makefile.bak; \
235 $(MV) Makefile.bak Makefile; \
236 echo " ===== Something went wrong in make depend ====="; \
239 # -----------------------------------------------------------------------
240 # DO NOT DELETE: nice dependency list follows