xref: /netbsd-src/external/bsd/openldap/dist/contrib/slapd-modules/rbac/Makefile (revision e670fd5c413e99c2f6a37901bb21c537fcd322d2)
1*e670fd5cSchristos# $OpenLDAP$
2*e670fd5cSchristos
3*e670fd5cSchristosLDAP_SRC = ../../..
4*e670fd5cSchristosLDAP_BUILD = $(LDAP_SRC)
5*e670fd5cSchristosLDAP_INC = -I$(LDAP_BUILD)/include -I$(LDAP_SRC)/include -I$(LDAP_SRC)/servers/slapd
6*e670fd5cSchristosLDAP_LIB = $(LDAP_BUILD)/libraries/libldap/libldap.la \
7*e670fd5cSchristos	$(LDAP_BUILD)/libraries/liblber/liblber.la
8*e670fd5cSchristos
9*e670fd5cSchristosLIBTOOL = $(LDAP_BUILD)/libtool
10*e670fd5cSchristosINSTALL = /usr/bin/install
11*e670fd5cSchristosCC = gcc
12*e670fd5cSchristosOPT = -g -O2
13*e670fd5cSchristosDEFS = -DSLAPD_OVER_RBAC=SLAPD_MOD_DYNAMIC
14*e670fd5cSchristosINCS = $(LDAP_INC)
15*e670fd5cSchristosLIBS = $(LDAP_LIB)
16*e670fd5cSchristos
17*e670fd5cSchristosPROGRAMS = rbac.la
18*e670fd5cSchristosMANPAGES = slapo-rbac.5
19*e670fd5cSchristos
20*e670fd5cSchristosLTVER = 0:0:0
21*e670fd5cSchristos
22*e670fd5cSchristosprefix=/usr/local
23*e670fd5cSchristosexec_prefix=$(prefix)
24*e670fd5cSchristosldap_subdir=/openldap
25*e670fd5cSchristos
26*e670fd5cSchristoslibdir=$(exec_prefix)/lib
27*e670fd5cSchristoslibexecdir=$(exec_prefix)/libexec
28*e670fd5cSchristosmoduledir = $(libexecdir)$(ldap_subdir)
29*e670fd5cSchristosmandir = $(exec_prefix)/share/man
30*e670fd5cSchristosman5dir = $(mandir)/man5
31*e670fd5cSchristos
32*e670fd5cSchristosSRCS = rbac.c rbacperm.c rbacsess.c rbacuser.c rbacreq.c rbacaudit.c init.c rbacacl.c util.c jts.c
33*e670fd5cSchristosOBJS = $(patsubst %.c,%.o,$(SRCS))
34*e670fd5cSchristosLOBJS = $(patsubst %.c,%.lo,$(SRCS))
35*e670fd5cSchristos
36*e670fd5cSchristos.SUFFIXES: .c .lo
37*e670fd5cSchristos
38*e670fd5cSchristos%.lo: %.c rbac.h
39*e670fd5cSchristos	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(OPT) $(CPPFLAGS) $(DEFS) $(INCS) -c $<
40*e670fd5cSchristos
41*e670fd5cSchristosall: $(PROGRAMS)
42*e670fd5cSchristos
43*e670fd5cSchristosrbac.la: $(LOBJS)
44*e670fd5cSchristos	$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -version-info $(LTVER) \
45*e670fd5cSchristos		-rpath $(moduledir) -module -o $@ $^ $(LIBS)
46*e670fd5cSchristos
47*e670fd5cSchristosclean:
48*e670fd5cSchristos	rm -rf *.o *.lo *.la .libs
49*e670fd5cSchristos
50*e670fd5cSchristosinstall: install-lib install-man FORCE
51*e670fd5cSchristos
52*e670fd5cSchristosinstall-lib: $(PROGRAMS)
53*e670fd5cSchristos	mkdir -p $(DESTDIR)$(moduledir)
54*e670fd5cSchristos	for p in $(PROGRAMS) ; do \
55*e670fd5cSchristos		$(LIBTOOL) --mode=install cp $$p $(DESTDIR)$(moduledir) ; \
56*e670fd5cSchristos	done
57*e670fd5cSchristos
58*e670fd5cSchristosinstall-man: $(MANPAGES)
59*e670fd5cSchristos	mkdir -p  $(DESTDIR)$(man5dir)
60*e670fd5cSchristos	$(INSTALL) -m 644 $(MANPAGES) $(DESTDIR)$(man5dir)
61*e670fd5cSchristos
62*e670fd5cSchristosFORCE:
63*e670fd5cSchristos
64