summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/man/Makefile.shprog
blob: 819ed33ebb8ec202dbd681399d2d4c2f46ac4c4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# $FreeBSD$

# This may become bsd.shprog.mk.  The general version would have to handle:
# - arbitrary sed substitutions.
# - programs without man pages.
# - programs with man pages in sections other than section 1.

MAN1=	${SHPROG:S/$/.1/g}

CLEANFILES+=	${SHPROG} ${MAN1}

all:	${SHPROG}

.sh:
	sed -e 's,%libdir%,${libdir},' -e 's,%bindir%,${bindir},' \
	    -e 's,%pager%,${pager},' \
		${.ALLSRC} > ${.TARGET}

.SUFFIXES: .man .1
.man.1:
	sed -e 's,%libdir%,${libdir},' -e 's,%bindir%,${bindir},' \
	    -e 's,%pager%,${pager},' -e 's,%troff%,${troff},' \
	    -e 's,%manpath_config_file%,${manpath_config_file},' \
		${.ALLSRC} > ${.TARGET}

beforeinstall:
	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
	    ${SHPROG} ${DESTDIR}${BINDIR}

.include <bsd.prog.mk>
OpenPOWER on IntegriCloud