Makefile 1.87 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-2021 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
	$(LDAP_BUILD)/libraries/liblber/liblber.la

LIBTOOL = $(LDAP_BUILD)/libtool
CC = gcc
23
OPT = -g -O2
24
25
26
27
28
DEFS = -DSLAPD_OVER_RDNVAL=SLAPD_MOD_DYNAMIC \
	-DSLAPD_OVER_PGUID=SLAPD_MOD_DYNAMIC \
	-DSLAPD_OVER_VERNUM=SLAPD_MOD_DYNAMIC
INCS = $(LDAP_INC)
LIBS = $(LDAP_LIB)
29

30
31
PROGRAMS = pguid.la rdnval.la vernum.la
LTVER = 0:0:0
32
33
34
35
36
37
38
39
40

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

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

41
.SUFFIXES: .c .o .lo
42

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

46
all: $(PROGRAMS)
47

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

52
rdnval.la: rdnval.lo
53
	$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -version-info $(LTVER) \
54
	-rpath $(moduledir) -module -o $@ $? $(LIBS)
55

56
vernum.la: vernum.lo
57
	$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -version-info $(LTVER) \
58
	-rpath $(moduledir) -module -o $@ $? $(LIBS)
59

60
clean:
61
	rm -rf *.o *.lo *.la .libs
62

63
install: $(PROGRAMS)
64
	mkdir -p $(DESTDIR)$(moduledir)
65
66
67
	for p in $(PROGRAMS) ; do \
		$(LIBTOOL) --mode=install cp $$p $(DESTDIR)$(moduledir) ; \
	done
68