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