Makefile 1.28 KB
Newer Older
Quanah Gibson-Mount's avatar
Quanah Gibson-Mount committed
1
# $OpenLDAP$
2

3
LDAP_SRC = ../../..
4
LDAP_BUILD = $(LDAP_SRC)
5
LDAP_INC = -I$(LDAP_BUILD)/include -I$(LDAP_SRC)/include -I$(LDAP_SRC)/servers/slapd
6
LDAP_LIB = $(LDAP_BUILD)/libraries/libldap/libldap.la \
7
	$(LDAP_BUILD)/libraries/liblber/liblber.la
8

9
LIBTOOL = $(LDAP_BUILD)/libtool
10
INSTALL = /usr/bin/install
11
CC = gcc
12
OPT = -g -O2
13
14
15
DEFS = -DSLAPD_OVER_CLOAK=SLAPD_MOD_DYNAMIC
INCS = $(LDAP_INC)
LIBS = $(LDAP_LIB)
16

17
PROGRAMS = cloak.la
18
MANPAGES = slapo-cloak.5
19
20
21
22
23
24
25
26
27
LTVER = 0:0:0

prefix=/usr/local
exec_prefix=$(prefix)
ldap_subdir=/openldap

libdir=$(exec_prefix)/lib
libexecdir=$(exec_prefix)/libexec
moduledir = $(libexecdir)$(ldap_subdir)
28
29
mandir = $(exec_prefix)/share/man
man5dir = $(mandir)/man5
30
31
32
33

.SUFFIXES: .c .o .lo

.c.lo:
34
	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(OPT) $(CPPFLAGS) $(DEFS) $(INCS) -c $<
35
36
37
38

all: $(PROGRAMS)

cloak.la: cloak.lo
39
	$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -version-info $(LTVER) \
40
	-rpath $(moduledir) -module -o $@ $? $(LIBS)
41
42

clean:
43
44
	rm -rf *.o *.lo *.la .libs

45
46
47
install: install-lib install-man FORCE

install-lib: $(PROGRAMS)
48
49
50
51
52
	mkdir -p $(DESTDIR)$(moduledir)
	for p in $(PROGRAMS) ; do \
		$(LIBTOOL) --mode=install cp $$p $(DESTDIR)$(moduledir) ; \
	done

53
54
55
56
57
58
install-man: $(MANPAGES)
	mkdir -p  $(DESTDIR)$(man5dir)
	$(INSTALL) -m 644 $(MANPAGES) $(DESTDIR)$(man5dir)

FORCE: