[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.6, Wed Apr 10 02:57:20 2013 UTC (11 years, 2 months ago) by guenther
Branch: MAIN
Changes since 1.5: +21 -2 lines

Get the standard path from _PATH_STDPATH instead of
sysctl({CTL_USER,USER_CS_PATH}).  Expand that into the manpage
too.

_PATH_STDPATH suggested by miod@
Corrections from schwarze@ and jmc@
ok millert@ miod@ schwarze@ jmc@

#	$OpenBSD: Makefile,v 1.6 2013/04/10 02:57:20 guenther Exp $

whereis_MAN = ${.OBJDIR}/whereis.1
man_depends = ${.OBJDIR}/whereis.d

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

${whereis_MAN}: ${.CURDIR}/whereis.1 /usr/include/paths.h
	stdpath=`printf '#include <paths.h>\n_PATH_STDPATH\n' | \
		${CPP} ${CPPFLAGS} -MD -MT '$${.OBJDIR}/whereis.1' \
		-MF ${man_depends} - | \
		sed -n 's/^[ 	]*"\(.*\)".*/\1/p'` ; \
	sed "s!_PATH_STDPATH!$${stdpath}!" < ${.CURDIR}/whereis.1 >$@

CLEANFILES = ${whereis_MAN}
cleandir: cleanlocaldepend
cleanlocaldepend:
	rm -f ${man_depends}

.if exists(${man_depends})
. include "${man_depends}"
.endif

.include <bsd.prog.mk>