freebsd-dev/gnu/usr.bin/man/Makefile.shprog
Bruce Evans 03e5b81db4 Rewrite and merge some bogus makefiles to create Makefile.shprog. Just
include this in the old makefiles.

I intended to fix only the private maninstall rule but found a lot of
other bogons and bugs:
- strong resistance to installing the program anywhere other than
  ${DESTDIR}/usr/bin (first, ../../Makefile.inc was not included.
  ../Makefile/inc was redundantly included instead.  Second, /usr/bin
  was hard coded).
- the owner, group and permissions were hard coded.
- the man page was installed twice.
- MANDEPEND wasn't necessary.
- calculations to determine the obj directory weren't necessary.
- there were unnecessary private rules for depend, rcsfreeze and tags.
  We don't support the rcsfreeze target.
- there was an extra, bogus, rule for `all'.

The final version uses suffix rules to eliminate the remaining verboseness
involving directories (${.CURDIR}) and to potentially allow multiple
shell programs in one directory.
1995-10-21 14:27:19 +00:00

31 lines
779 B
Makefile

# $Id$
# 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>