Makefile 1.69 KB
Newer Older
Howard Chu's avatar
Howard Chu committed
1
# $OpenLDAP$
2
3
4
5
6
7
8
9
10
11
12
# Copyright 2009 Jonathan Clarke <jonathan@phillipoux.net>.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted only as authorized by the OpenLDAP
# Public License.
#
# A copy of this license is available in the file LICENSE in the
# top-level directory of the distribution or, alternatively, at
# <http://www.OpenLDAP.org/license.html>.

13
LDAP_SRC = ../../..
14
LDAP_BUILD = $(LDAP_SRC)
15
LDAP_INC = -I$(LDAP_BUILD)/include -I$(LDAP_SRC)/include -I$(LDAP_SRC)/servers/slapd
16
LDAP_LIB = $(LDAP_BUILD)/libraries/libldap/libldap.la \
17
18
19
	$(LDAP_BUILD)/libraries/liblber/liblber.la

LIBTOOL = $(LDAP_BUILD)/libtool
20
INSTALL = /usr/bin/install
21
CC = gcc
22
OPT = -g -O2
23
24
25
26
27
DEFS = -DSLAPD_OVER_LASTBIND=SLAPD_MOD_DYNAMIC
INCS = $(LDAP_INC)
LIBS = $(LDAP_LIB)

PROGRAMS = lastbind.la
28
MANPAGES = slapo-lastbind.5
29
LTVER = 0:0:0
30

31
prefix=/usr/local
32
33
34
35
36
37
exec_prefix=$(prefix)
ldap_subdir=/openldap

libdir=$(exec_prefix)/lib
libexecdir=$(exec_prefix)/libexec
moduledir = $(libexecdir)$(ldap_subdir)
38
39
mandir = $(exec_prefix)/share/man
man5dir = $(mandir)/man5
40

41
.SUFFIXES: .c .o .lo
42

43
.c.lo:
44
	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(OPT) $(CPPFLAGS) $(DEFS) $(INCS) -c $<
45

46
47
48
all: $(PROGRAMS)

lastbind.la: lastbind.lo
49
	$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -version-info $(LTVER) \
50
	-rpath $(moduledir) -module -o $@ $? $(LIBS)
51
52

clean:
53
54
	rm -rf *.o *.lo *.la .libs

55
56
57
install: install-lib install-man FORCE

install-lib: $(PROGRAMS)
58
59
60
61
	mkdir -p $(DESTDIR)$(moduledir)
	for p in $(PROGRAMS) ; do \
		$(LIBTOOL) --mode=install cp $$p $(DESTDIR)$(moduledir) ; \
	done
62

63
64
65
66
67
68
install-man: $(MANPAGES)
	mkdir -p  $(DESTDIR)$(man5dir)
	$(INSTALL) -m 644 $(MANPAGES) $(DESTDIR)$(man5dir)

FORCE: