jcs's openbsd hax
openbsd
1# $OpenBSD: Makefile,v 1.9 2016/05/26 21:24:16 millert 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 ${CC} -E -P ${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>