xref: /netbsd-src/external/bsd/openldap/Makefile (revision 4e6df137e8e14049b5a701d249962c480449c141)
1#	$NetBSD: Makefile,v 1.2 2008/07/23 00:21:19 lukem Exp $
2
3.include "openldap.mk"
4
5SUBDIR=		include
6
7SUBDIR+=	lib .WAIT
8
9SUBDIR+=	bin
10
11
12#
13#	maintainer rules
14#	----------------
15#
16#	configure	run configure and create various files for target build.
17#	update-include	make configure, then update ./include/ appropriately
18#	update-man	make configure, then update ./man/ appropriately
19#
20
21#
22#	Run configure to create various files.
23#	This should only be necessary after updating ./dist/
24#
25
26CONFIGURE_ARGS+=	--prefix=${LDAP_PREFIX}
27CONFIGURE_ARGS+=	--sysconfdir=${LDAP_ETCDIR}
28CONFIGURE_ARGS+=	--localstatedir=${LDAP_RUNDIR}
29
30CONFIGURE_ARGS+=	--enable-dynamic
31CONFIGURE_ARGS+=	--disable-slapd
32CONFIGURE_ARGS+=	--with-tls=openssl
33CONFIGURE_ARGS+=	--with-threads
34CONFIGURE_ARGS+=	--without-cyrus-sasl
35
36configure: work/config.status .PHONY
37
38work/config.status: ${LDAP_DISTDIR}/configure Makefile openldap.mk
39	mkdir -p work
40	(cd work \
41	    && ${CONFIGURE_ENV} sh ${LDAP_DISTDIR}/configure ${CONFIGURE_ARGS} \
42	    || false)
43
44update-include: work/config.status .PHONY
45	(cd work/include \
46	    && ${MAKE} ldap_config.h \
47	    || false)
48	@for wf in `find work/include -name '*.h'`; do \
49		tf=${LDAP_SRCDIR}/include/$${wf##*/}; \
50		tf=$${tf%.tmp} ; \
51		cmp -s $${wf} $${tf} > /dev/null 2>&1 || ( \
52			rm -f $${tf} && \
53			cp $${wf} $${tf} && \
54			echo "Updated $${tf}" ; \
55		) ; \
56	done
57
58update-man: work/config.status .PHONY
59	(cd work/doc/man \
60	    && ${MAKE} \
61	    || false)
62	@for wf in `find work/doc/man -name '*.[0-9].tmp'` ; do \
63		tf=${LDAP_SRCDIR}/man/$${wf##*/}; \
64		tf=$${tf%.tmp} ; \
65		cmp -s $${wf} $${tf} > /dev/null 2>&1 || ( \
66			rm -f $${tf} && \
67			cp $${wf} $${tf} && \
68			echo "Updated $${tf}" ; \
69		) ; \
70	done
71
72
73.PHONY: clean.work
74
75clean: clean.work
76clean.work:
77	-rm -f -r work
78
79
80.include <bsd.hostprog.mk>
81.include <bsd.subdir.mk>
82