xref: /openbsd/usr.bin/which/Makefile (revision 5af055cd)
1#	$OpenBSD: Makefile,v 1.8 2013/04/15 16:34:19 guenther Exp $
2
3PROG=	which
4MAN=	which.1 whereis.1
5LINKS=	${BINDIR}/which ${BINDIR}/whereis
6
7check_path_in_man:
8	@echo "Checking path expansion in whereis.1"; \
9	stdpath=`printf '#include <paths.h>\n_PATH_STDPATH\n' | \
10	${CPP} ${CPPFLAGS} - | \
11	sed -n 's/^[    ]*"\(.*\)".*/.D1 \1/p'` ; \
12	fgrep -xq "$$stdpath" ${.CURDIR}/whereis.1 && { touch $@; exit 0; }; \
13	echo "Update the expansion of _PATH_STDPATH in ${.CURDIR}/whereis.1"; \
14	exit 1
15
16all: check_path_in_man
17CLEANFILES = check_path_in_man
18
19.include <bsd.prog.mk>
20