Debian Codegraph @

contrib/slapd-modules/ppm/Makefile

raw ◀ ▶
Source reconstructed at patch state 0 of 2 — not the installed (fully patched) source.
2 Debian patches touch this file
1 # $OpenLDAP$
2 # Copyright 2014 David Coutadeur, Paris.
3 # All rights reserved.
4 #
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted only as authorized by the OpenLDAP
7 # Public License.
8 #
9 # A copy of this license is available in the file LICENSE in the
10 # top-level directory of the distribution or, alternatively, at
11 # <http://www.OpenLDAP.org/license.html>.
12
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/liblber/liblber.la $(LDAP_BUILD)/libraries/libldap/libldap.la
17
18 LIBTOOL = $(LDAP_BUILD)/libtool
19 INSTALL = /usr/bin/install
20 CC = gcc
21 OPT = -g -O2 -fpic
22
23 # To skip linking against CRACKLIB make CRACK=no
24 CRACK=yes
25 CRACKDEF_yes= -DCRACKLIB
26 CRACKDEF_no=
27
28 CRACKLIB_yes= -lcrack
29 CRACKLIB_no=
30
31 CRACKDEF=$(CRACKDEF_$(CRACK))
32 CRACKLIB=$(CRACKLIB_$(CRACK))
33
34 DEFS = -DDEBUG $(CRACKDEF)
35 # Define if using a config file:
36 # -DCONFIG_FILE="\"$(sysconfdir)/$(EXAMPLE)\""
37
38 INCS = $(LDAP_INC)
39 LIBS = $(LDAP_LIB)
40
41 PROGRAMS=ppm.so
42 LTVER = 0:0:0
43
44 LDAP_LIBS = -L$(LDAP_BUILD)/libraries/liblber/.libs -L$(LDAP_BUILD)/libraries/libldap/.libs -lldap -llber
45
46 prefix=/usr/local
47 exec_prefix=$(prefix)
48 ldap_subdir=/openldap
49
50 libdir=$(exec_prefix)/lib
51 libexecdir=$(exec_prefix)/libexec
52 moduledir = $(libexecdir)$(ldap_subdir)
53 mandir = $(exec_prefix)/share/man
54 man5dir = $(mandir)/man5
55 etcdir = $(exec_prefix)/etc
56 sysconfdir = $(etcdir)$(ldap_subdir)
57
58 TEST=ppm_test
59 EXAMPLE=ppm.example
60 TESTS=./unit_tests.sh
61
62 MANDOC=slapm-ppm.5
63 MDDOC=ppm.md
64
65 all: ppm $(TEST)
66
67 $(TEST): ppm
68 $(CC) $(CFLAGS) $(OPT) $(CPPFLAGS) $(DEFS) $(LDFLAGS) $(INCS) -Wl,-rpath=. -o $(TEST) ppm_test.c $(PROGRAMS) $(LDAP_LIBS) $(CRACKLIB)
69
70 ppm.o:
71 $(CC) $(CFLAGS) $(OPT) $(CPPFLAGS) $(DEFS) -c $(INCS) ppm.c
72
73 ppm: ppm.o
74 $(CC) $(LDFLAGS) $(INCS) -shared -o $(PROGRAMS) ppm.o $(CRACKLIB)
75
76 install: ppm
77 mkdir -p $(DESTDIR)$(moduledir)
78 for p in $(PROGRAMS); do \
79 $(LIBTOOL) --mode=install cp $$p $(DESTDIR)/$(moduledir) ; \
80 done
81 $(INSTALL) -m 644 $(EXAMPLE) $(DESTDIR)$(sysconfdir)/
82 $(INSTALL) -m 644 $(MANDOC) $(DESTDIR)$(man5dir)/
83 # $(INSTALL) -m 755 $(TEST) $(libdir)
84
85 .PHONY: clean
86
87 clean:
88 $(RM) -f ppm.o $(PROGRAMS) ppm.lo $(TEST)
89 $(RM) -rf .libs
90
91 test: ppm $(TEST)
92 LDAP_SRC=$(LDAP_SRC) $(TESTS)
93
94 doc:
95 pandoc $(MDDOC) -s -t man -o $(MANDOC)
96 sed -i -e 's#ETCDIR#$(DESTDIR)$(sysconfdir)#g' $(MANDOC)
97