[BACK]Return to Makefile CVS log [TXT][DIR] Up to [local] / src / usr.bin / which

File: [local] / src / usr.bin / which / Makefile (download)

Revision 1.7, Sat Apr 13 19:31:58 2013 UTC (11 years, 2 months ago) by guenther
Branch: MAIN
Changes since 1.6: +9 -17 lines

My clever "expand _PATH_STDPATH in whereis.1" logic broke the build if
you forgot to make obj first.  Switch to putting the path in the manpage
and just verifying at build-time whether it's correct.

Problem pointed out by rpe@

#	$OpenBSD: Makefile,v 1.7 2013/04/13 19:31:58 guenther Exp $

PROG=	which
MAN=	which.1 whereis.1
LINKS=	${BINDIR}/which ${BINDIR}/whereis

check_path_in_man:
	stdpath=`printf '#include <paths.h>\n_PATH_STDPATH\n' | \
	${CPP} ${CPPFLAGS} - | \
	sed -n 's/^[    ]*"\(.*\)".*/.Pa \1 ./p'` ; \
	fgrep -xq "$$stdpath" ${.CURDIR}/whereis.1 && { touch $@; exit 0; }; \
	echo "Update the expansion of _PATH_STDPATH in ${.CURDIR}/whereis.1"; \
	exit 1

all: check_path_in_man
CLEANFILES = check_path_in_man

.include <bsd.prog.mk>