summaryrefslogtreecommitdiff
path: root/src/plugins/dir/Makefile
blob: 48aa01dbd4e36be3575473606a5c15e21294868c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#
# Simple Makefile for building test FD plugins for Bacula
#
# Copyright (C) 2000-2015 Kern Sibbald
# License: BSD 2-Clause; see file LICENSE-FOSS
#

include Makefile.inc

.c.lo:
	@echo "Compiling $< ..."
	$(NO_ECHO)$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) $(CPPFLAGS) $(CFLAGS) -I${SRCDIR} -I${DIRDIR} -I${LIBDIR} -DWORKDIR=\"$(DESTDIR)$(working_dir)\" -c $<

%.lo: %.c %.h
	@echo "Pattern compiling $< ..."
	$(NO_ECHO)$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) $(CPPFLAGS) $(CFLAGS) -I${SRCDIR} -I${DIRDIR} -I${LIBDIR} -DWORKDIR=\"$(DESTDIR)$(working_dir)\" -c $(@:.lo=.c)

all: dirpluglib.lo example-plugin-dir.la test-authentication-api-dir.la

# example-plugin-dir.lo: example-plugin-dir.c ${DIRDIR}/dir_plugins.h
# 	$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) $(CFLAGS) -I../.. -I${DIRDIR} -c example-plugin-dir.c

example-plugin-dir.la: example-plugin-dir.lo
	@echo "Linking $(@:.la=.so) ..."
	$(NO_ECHO)$(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -shared example-plugin-dir.lo -o $@ -rpath $(plugindir) -module -export-dynamic -avoid-version

# test-authentication-api-dir.lo: test-authentication-api-dir.c ${DIRDIR}/dir_plugins.h
# 	$(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) $(CFLAGS) -I../.. -I${DIRDIR} -c test-authentication-api-dir.c

test-authentication-api-dir.la: test-authentication-api-dir.lo dirpluglib.lo
	@echo "Linking $(@:.la=.so) ..."
	$(NO_ECHO)$(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -shared $^ -o $@ -rpath $(plugindir) -module -export-dynamic -avoid-version

install: all
	$(NO_ECHO)$(MKDIR) $(DESTDIR)$(plugindir)

install-bpam-ldap:
	$(MAKE) -C ldap install

$(LIBTOOL_CLEAN_TARGET):
	$(NO_ECHO)find . -name '*.lo' -print | xargs $(LIBTOOL_CLEAN) $(RMF)
	$(NO_ECHO)$(RMF) *.la
	$(NO_ECHO)$(RMF) -r .libs _libs

clean: $(LIBTOOL_CLEAN_TARGET)
	$(NO_ECHO)rm -f main *.so *.o 1 2 3

distclean: clean
	$(NO_ECHO)rm -f Makefile

$(LIBTOOL_UNINSTALL_TARGET):
	$(NO_ECHO)$(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(plugindir)/example-plugin-dir.la

uninstall: $(LIBTOOL_UNINSTALL_TARGET)

depend: