1#
2# Simple Makefile for building test FD plugins for Bacula
3#
4# Copyright (C) 2000-2015 by Kern Sibbald
5# License: BSD 2-Clause; see file LICENSE-FOSS
6#
7#
8@MCOMMON@
9
10
11# No optimization for now for easy debugging
12
13FDDIR=../../filed
14SRCDIR=../..
15LIBDIR=../../lib
16
17topdir = @BUILD_DIR@
18thisdir = src/plugins/fd
19
20.SUFFIXES:    .c .lo
21
22.c.lo:
23	$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) $(CPPFLAGS) $(CFLAGS) -I${SRCDIR} -I${FDDIR} -DTEST_PROGRAM -c $<
24
25all: bpipe-fd.la test-plugin-fd.la test-deltaseq-fd.la pluglib.lo
26
27example-plugin-fd.lo: example-plugin-fd.c ${FDDIR}/fd_plugins.h
28	$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) $(CPPFLAGS) $(CFLAGS) -I../.. -I${FDDIR} -c example-plugin-fd.c
29
30example-plugin-fd.la: Makefile example-plugin-fd$(DEFAULT_OBJECT_TYPE)
31	$(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -shared example-plugin-fd.lo -o $@ -rpath $(plugindir) -module -export-dynamic -avoid-version
32
33bpipe-fd.lo: bpipe-fd.c ${FDDIR}/fd_plugins.h
34	$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) $(CPPFLAGS) $(CFLAGS) -I../.. -I${FDDIR} -c bpipe-fd.c
35
36bpipe-fd.la: Makefile bpipe-fd$(DEFAULT_OBJECT_TYPE)
37	$(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -shared bpipe-fd.lo -o $@ -rpath $(plugindir) -module -export-dynamic -avoid-version
38
39cdp: cdp-fd.la
40
41cdp-fd.lo: cdp-fd.c journal.h folder-record.h file-record.h settings-record.h ${FDDIR}/fd_plugins.h
42	$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) $(CPPFLAGS) $(CFLAGS) -Wno-unused-function -I../.. -I${FDDIR} -c cdp-fd.c
43
44journal.lo: journal.c journal.h folder-record.h file-record.h settings-record.h ${FDDIR}/fd_plugins.h
45	$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) $(CPPFLAGS) $(CFLAGS) -Wno-unused-function -I../.. -I${FDDIR} -c journal.c
46
47cdp-fd.la: Makefile cdp-fd$(DEFAULT_OBJECT_TYPE) journal.lo
48	$(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -shared cdp-fd.lo journal.lo -o $@ -rpath $(plugindir) -module -export-dynamic -avoid-version
49
50install-cdp: cdp-fd.la
51	$(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) cdp-fd.la $(DESTDIR)$(plugindir)
52	$(RMF) $(DESTDIR)$(plugindir)/cdp-fd.la
53
54
55
56test-deltaseq-fd.lo: test-deltaseq-fd.c ${FDDIR}/fd_plugins.h fd_common.h
57	$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) $(CPPFLAGS) $(CFLAGS) -I../.. -I${FDDIR} -c test-deltaseq-fd.c
58
59test-deltaseq-fd.la: Makefile test-deltaseq-fd$(DEFAULT_OBJECT_TYPE)
60	$(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -shared test-deltaseq-fd.lo -o $@ -rpath $(plugindir) -module -export-dynamic -avoid-version
61
62test-plugin-fd.lo: test-plugin-fd.c ${FDDIR}/fd_plugins.h
63	$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) $(CPPFLAGS) $(CFLAGS) -I../.. -I${FDDIR} -c test-plugin-fd.c
64
65test-plugin-fd.la: Makefile test-plugin-fd$(DEFAULT_OBJECT_TYPE)
66	$(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -shared test-plugin-fd.lo -o $@ -rpath $(plugindir) -module -export-dynamic -avoid-version
67
68install: all
69	$(MKDIR) $(DESTDIR)$(plugindir)
70	$(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) bpipe-fd.la $(DESTDIR)$(plugindir)
71	$(RMF) $(DESTDIR)$(plugindir)/bpipe-fd.la
72
73install-test-plugin: all
74	$(MKDIR) $(DESTDIR)$(plugindir)
75	$(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) test-plugin-fd.la $(DESTDIR)$(plugindir)
76	$(RMF) $(DESTDIR)$(plugindir)/test-plugin-fd.la
77	$(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) test-deltaseq-fd.la $(DESTDIR)$(plugindir)
78	$(RMF) $(DESTDIR)$(plugindir)/test-deltaseq-fd.la
79
80Makefile: Makefile.in $(topdir)/config.status
81	cd $(topdir) \
82	  && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
83
84libtool-clean:
85	@find . -name '*.lo' -print | xargs $(LIBTOOL_CLEAN) $(RMF)
86	@$(RMF) *.la
87	@$(RMF) -r .libs _libs
88
89clean:	libtool-clean
90	@rm -f main *.so *.o 1 2 3
91
92distclean: clean
93	@rm -f Makefile *.la *.lo
94	@rm -rf .libs
95
96libtool-uninstall:
97	$(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(plugindir)/bpipe-fd.so
98
99uninstall: @LIBTOOL_UNINSTALL_TARGET@
100
101depend:
102