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

# Path to the OpenLDAP source tree
16
LDAP_SRC=../../..
17
18
19

# Path to the OpenLDAP object tree - same as above unless
# you're doing out-of-tree builds.
20
LDAP_BUILD=$(LDAP_SRC)
21

22
LDAP_INC = -I$(LDAP_BUILD)/include -I$(LDAP_SRC)/include -I$(LDAP_SRC)/servers/slapd
23
LDAP_LIB = $(LDAP_BUILD)/libraries/libldap/libldap.la \
24
	$(LDAP_BUILD)/libraries/liblber/liblber.la
25

26
NLDAPD_INC=-Inss-pam-ldapd
27

28
LIBTOOL = $(LDAP_BUILD)/libtool
29
INSTALL = /usr/bin/install
30
OPT = -g -O2
31
32
33
34
CC = gcc
DEFS =
INCS = $(LDAP_INC) $(NLDAPD_INC)
LIBS = $(LDAP_LIB)
35

36
37
prefix=/usr/local
exec_prefix=$(prefix)
Howard Chu's avatar
Howard Chu committed
38
39
ldap_subdir=/openldap

40
libdir=$(exec_prefix)/lib
Howard Chu's avatar
Howard Chu committed
41
libexecdir=$(exec_prefix)/libexec
42
moduledir = $(libexecdir)$(ldap_subdir)
Howard Chu's avatar
Howard Chu committed
43
44
sysconfdir = $(prefix)/etc$(ldap_subdir)
schemadir = $(sysconfdir)/schema
45
46
mandir = $(exec_prefix)/share/man
man5dir = $(mandir)/man5
47

48
all:	nssov.la
49
50
51
52

XOBJS = tio.lo

OBJS = alias.lo ether.lo group.lo host.lo netgroup.lo network.lo \
53
	nssov.lo passwd.lo protocol.lo rpc.lo service.lo shadow.lo pam.lo
54

55
56
MANPAGES = slapo-nssov.5

57
58
59
.SUFFIXES: .c .o .lo

.c.lo:
60
	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(OPT) $(CPPFLAGS) $(DEFS) $(INCS) -c $<
61

62
tio.lo:	nss-pam-ldapd/tio.c
63
	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(OPT) $(CPPFLAGS) $(DEFS) $(INCS) -c $?
64
65
66
67

$(OBJS):	nssov.h

nssov.la:	$(OBJS) $(XOBJS)
68
	$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -version-info 0:0:0 \
69
	-rpath $(moduledir) -module -o $@ $(OBJS) $(XOBJS) $(LIBS)
70

71
72
73
install: install-lib install-man FORCE

install-lib: nssov.la
74
75
	mkdir -p $(DESTDIR)$(moduledir)
	$(LIBTOOL) --mode=install cp nssov.la $(DESTDIR)$(moduledir)
Howard Chu's avatar
Howard Chu committed
76
	cp ldapns.schema $(DESTDIR)$(schemadir)
77

78
79
80
81
82
83
install-man: $(MANPAGES)
	mkdir -p  $(DESTDIR)$(man5dir)
	$(INSTALL) -m 644 $(MANPAGES) $(DESTDIR)$(man5dir)

FORCE:

84
85
clean:
	rm -f *.*o *.la .libs/*
86
	rm -rf .libs