Makefile 1.24 KB
Newer Older
1
2
3
# $OpenLDAP$

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
8
9
	$(LDAP_BUILD)/libraries/liblber/liblber.la

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

PROGRAMS = allop.la
18
MANPAGES = slapo-allop.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)

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

clean:
	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: