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
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 rwlock_test: Makefile
145 $(CXX) -DTEST_RWLOCK $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) rwlock.c
146 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ rwlock.o $(LIBS) $(DLIB) -lbac -lm
148 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) rwlock.c
150 md5sum: Makefile md5.o
152 $(CXX) -DMD5_SUM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) md5.c
153 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ md5.o $(LIBS) $(DLIB) -lbac $(OPENSSL_LIBS) -lm
155 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) md5.c
157 sha1sum: Makefile sha1.o
159 $(CXX) -DSHA1_SUM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) sha1.c
160 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ sha1.o $(LIBS) $(DLIB) -lbac $(OPENSSL_LIBS) -lm
162 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) sha1.c
164 bsnprintf: Makefile bsnprintf.o
166 $(CXX) -DTEST_PROGRAM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) bsnprintf.c
167 $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ bsnprintf.o $(LIBS) $(DLIB) -lbac $(OPENSSL_LIBS) -lm
169 $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) bsnprintf.c
172 $(MKDIR) $(DESTDIR)/$(includedir)/bacula
173 for I in $(INCLUDE_FILES); do \
174 $(INSTALL_DATA) $$I $(DESTDIR)$(includedir)/bacula/`basename $$I`; \
178 for I in $(INCLUDE_FILES); do \
179 $(RMF) $(DESTDIR)$(includedir)/bacula/`basename $$I`; \
183 $(MKDIR) $(DESTDIR)$(libdir)
184 $(LIBTOOL_INSTALL_FINISH) $(INSTALL_PROGRAM) libbac.la $(DESTDIR)$(libdir)
185 $(LIBTOOL_INSTALL_FINISH) $(INSTALL_PROGRAM) libbaccfg.la $(DESTDIR)$(libdir)
186 $(LIBTOOL_INSTALL_FINISH) $(INSTALL_PROGRAM) libbacpy.la $(DESTDIR)$(libdir)
189 $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbac.la
190 $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbaccfg.la
191 $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbacpy.la
193 install: @LIBTOOL_INSTALL_TARGET@ @INCLUDE_INSTALL_TARGET@
195 uninstall: @LIBTOOL_UNINSTALL_TARGET@ @INCLUDE_UNINSTALL_TARGET@
198 find . -name '*.lo' -print | xargs $(LIBTOOL_CLEAN) $(RMF)
200 $(RMF) -r .libs _libs
202 clean: @LIBTOOL_CLEAN_TARGET@
203 $(RMF) core a.out *.o *.bak *.tex *.pdf *~ *.intpro *.extpro 1 2 3
204 $(RMF) rwlock_test md5sum sha1sum
210 if test $(srcdir) = .; then $(MAKE) realclean; fi
211 (cd $(srcdir); $(RMF) Makefile)
213 # Semi-automatic generation of dependencies:
214 # Use gcc -M because X11 `makedepend' doesn't work on all systems
215 # and it also includes system headers.
216 # `semi'-automatic since dependencies are generated at distribution time.
219 @$(MV) Makefile Makefile.bak
220 @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile
221 @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile
222 @for src in $(LIBBAC_SRCS) $(LIBBACCFG_SRCS) $(LIBBACPY_SRCS); do \
223 $(CXX) -S -M -MT `basename $$src .c`$(DEFAULT_OBJECT_TYPE) $(CPPFLAGS) $(XINC) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(SQL_INC) $$src >> Makefile; \
225 @if test -f Makefile ; then \
226 $(RMF) Makefile.bak; \
228 $(MV) Makefile.bak Makefile; \
229 echo " ===== Something went wrong in make depend ====="; \
232 # -----------------------------------------------------------------------
233 # DO NOT DELETE: nice dependency list follows