Makefile 1.49 KB
Newer Older
1
2
3
# $OpenLDAP$
# This work is part of OpenLDAP Software <http://www.openldap.org/>.
#
Quanah Gibson-Mount's avatar
Quanah Gibson-Mount committed
4
# Copyright 1998-2020 The OpenLDAP Foundation.
5
6
7
8
9
10
11
12
13
14
# Copyright 2004 Howard Chu, Symas Corp. 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>.

15
LDAP_SRC = ../../..
16
LDAP_BUILD = $(LDAP_SRC)
17
LDAP_INC = -I$(LDAP_BUILD)/include -I$(LDAP_SRC)/include -I$(LDAP_SRC)/servers/slapd
18
LDAP_LIB = $(LDAP_BUILD)/libraries/libldap/libldap.la \
19
20
21
22
23
24
25
26
27
28
29
	$(LDAP_BUILD)/libraries/liblber/liblber.la

LIBTOOL = $(LDAP_BUILD)/libtool
CC = gcc
OPT = -g -O2 -Wall
DEFS = -DSLAPD_OVER_DUPENT=SLAPD_MOD_DYNAMIC
INCS = $(LDAP_INC)
LIBS = $(LDAP_LIB)

PROGRAMS = dupent.la
LTVER = 0:0:0
30
31
32
33
34
35
36
37
38

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

libdir=$(exec_prefix)/lib
libexecdir=$(exec_prefix)/libexec
moduledir = $(libexecdir)$(ldap_subdir)

39
.SUFFIXES: .c .o .lo
40

41
42
.c.lo:
	$(LIBTOOL) --mode=compile $(CC) $(OPT) $(DEFS) $(INCS) -c $<
43

44
all: $(PROGRAMS)
45

46
47
dupent.la: dupent.lo
	$(LIBTOOL) --mode=link $(CC) $(OPT) -version-info $(LTVER) \
48
	-rpath $(moduledir) -module -o $@ $? $(LIBS)
49
50

clean:
51
	rm -rf *.o *.lo *.la .libs
52

53
install: $(PROGRAMS)
54
	mkdir -p $(DESTDIR)$(moduledir)
55
56
57
	for p in $(PROGRAMS) ; do \
		$(LIBTOOL) --mode=install cp $$p $(DESTDIR)$(moduledir) ; \
	done
58