Makefile 1.32 KB
Newer Older
HAMANO Tsukasa's avatar
HAMANO Tsukasa committed
1
2
3
4
5
6
7
8
9
# $OpenLDAP$

LDAP_SRC = ../../../..
LDAP_BUILD = ../../../..
LDAP_INC = -I$(LDAP_BUILD)/include -I$(LDAP_SRC)/include -I$(LDAP_SRC)/servers/slapd
LDAP_LIB = $(LDAP_BUILD)/libraries/libldap_r/libldap_r.la \
	$(LDAP_BUILD)/libraries/liblber/liblber.la

LIBTOOL = $(LDAP_BUILD)/libtool
10
INSTALL = /usr/bin/install
HAMANO Tsukasa's avatar
HAMANO Tsukasa committed
11
12
13
14
CC = gcc
OPT = -g -O2 -Wall
#DEFS = -DSLAPD_PBKDF2_DEBUG

15
16
17
18
19
SSL_INC =
SSL_LIB = -lcrypto

INCS = $(LDAP_INC) $(SSL_INC)
LIBS = $(LDAP_LIB) $(SSL_LIB)
HAMANO Tsukasa's avatar
HAMANO Tsukasa committed
20
21

PROGRAMS = pw-pbkdf2.la
22
MANPAGES = slapd-pw-pbkdf2.5
HAMANO Tsukasa's avatar
HAMANO Tsukasa committed
23
24
LTVER = 0:0:0

25
prefix=/usr/local
HAMANO Tsukasa's avatar
HAMANO Tsukasa committed
26
27
28
29
30
31
exec_prefix=$(prefix)
ldap_subdir=/openldap

libdir=$(exec_prefix)/lib
libexecdir=$(exec_prefix)/libexec
moduledir = $(libexecdir)$(ldap_subdir)
32
33
mandir = $(exec_prefix)/share/man
man5dir = $(mandir)/man5
HAMANO Tsukasa's avatar
HAMANO Tsukasa committed
34
35
36
37
38
39
40
41
42
43

.SUFFIXES: .c .o .lo

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

all:		$(PROGRAMS)

pw-pbkdf2.la: pw-pbkdf2.lo
	$(LIBTOOL) --mode=link $(CC) $(OPT) -version-info $(LTVER) \
44
	-rpath $(moduledir) -module -o $@ $? $(LIBS)
HAMANO Tsukasa's avatar
HAMANO Tsukasa committed
45
46
47
48

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

49
50
51
install: install-lib install-man FORCE

install-lib: $(PROGRAMS)
HAMANO Tsukasa's avatar
HAMANO Tsukasa committed
52
53
54
55
	mkdir -p $(DESTDIR)$(moduledir)
	for p in $(PROGRAMS) ; do \
		$(LIBTOOL) --mode=install cp $$p $(DESTDIR)$(moduledir) ; \
	done
56
57
58
59
60
61
62

install-man: $(MANPAGES)
	mkdir -p  $(DESTDIR)$(man5dir)
	$(INSTALL) -m 644 $(MANPAGES) $(DESTDIR)$(man5dir)

FORCE: