1 1.1 christos # $OpenLDAP$ 2 1.1 christos 3 1.1 christos LDAP_SRC = ../../.. 4 1.1 christos LDAP_BUILD = $(LDAP_SRC) 5 1.1 christos LDAP_INC = -I$(LDAP_BUILD)/include -I$(LDAP_SRC)/include -I$(LDAP_SRC)/servers/slapd 6 1.1 christos LDAP_LIB = $(LDAP_BUILD)/libraries/libldap/libldap.la \ 7 1.1 christos $(LDAP_BUILD)/libraries/liblber/liblber.la 8 1.1 christos 9 1.1 christos LIBTOOL = $(LDAP_BUILD)/libtool 10 1.1 christos INSTALL = /usr/bin/install 11 1.1 christos CC = gcc 12 1.1 christos OPT = -g -O2 13 1.1 christos DEFS = -DSLAPD_OVER_RBAC=SLAPD_MOD_DYNAMIC 14 1.1 christos INCS = $(LDAP_INC) 15 1.1 christos LIBS = $(LDAP_LIB) 16 1.1 christos 17 1.1 christos PROGRAMS = rbac.la 18 1.1 christos MANPAGES = slapo-rbac.5 19 1.1 christos 20 1.1 christos LTVER = 0:0:0 21 1.1 christos 22 1.1 christos prefix=/usr/local 23 1.1 christos exec_prefix=$(prefix) 24 1.1 christos ldap_subdir=/openldap 25 1.1 christos 26 1.1 christos libdir=$(exec_prefix)/lib 27 1.1 christos libexecdir=$(exec_prefix)/libexec 28 1.1 christos moduledir = $(libexecdir)$(ldap_subdir) 29 1.1 christos mandir = $(exec_prefix)/share/man 30 1.1 christos man5dir = $(mandir)/man5 31 1.1 christos 32 1.1 christos SRCS = rbac.c rbacperm.c rbacsess.c rbacuser.c rbacreq.c rbacaudit.c init.c rbacacl.c util.c jts.c 33 1.1 christos OBJS = $(patsubst %.c,%.o,$(SRCS)) 34 1.1 christos LOBJS = $(patsubst %.c,%.lo,$(SRCS)) 35 1.1 christos 36 1.1 christos .SUFFIXES: .c .lo 37 1.1 christos 38 1.1 christos %.lo: %.c rbac.h 39 1.1 christos $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(OPT) $(CPPFLAGS) $(DEFS) $(INCS) -c $< 40 1.1 christos 41 1.1 christos all: $(PROGRAMS) 42 1.1 christos 43 1.1 christos rbac.la: $(LOBJS) 44 1.1 christos $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -version-info $(LTVER) \ 45 1.1 christos -rpath $(moduledir) -module -o $@ $^ $(LIBS) 46 1.1 christos 47 1.1 christos clean: 48 1.1 christos rm -rf *.o *.lo *.la .libs 49 1.1 christos 50 1.1 christos install: install-lib install-man FORCE 51 1.1 christos 52 1.1 christos install-lib: $(PROGRAMS) 53 1.1 christos mkdir -p $(DESTDIR)$(moduledir) 54 1.1 christos for p in $(PROGRAMS) ; do \ 55 1.1 christos $(LIBTOOL) --mode=install cp $$p $(DESTDIR)$(moduledir) ; \ 56 1.1 christos done 57 1.1 christos 58 1.1 christos install-man: $(MANPAGES) 59 1.1 christos mkdir -p $(DESTDIR)$(man5dir) 60 1.1 christos $(INSTALL) -m 644 $(MANPAGES) $(DESTDIR)$(man5dir) 61 1.1 christos 62 1.1 christos FORCE: 63 1.1 christos 64