From 03e5b81db4ccfc49ed8672d83598a99bb438b76c Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Sat, 21 Oct 1995 14:27:19 +0000 Subject: 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. --- gnu/usr.bin/man/Makefile.shprog | 30 ++++++++++++++++++++++++++ gnu/usr.bin/man/apropos/Makefile | 46 ++++------------------------------------ gnu/usr.bin/man/whatis/Makefile | 43 ++++--------------------------------- 3 files changed, 38 insertions(+), 81 deletions(-) create mode 100644 gnu/usr.bin/man/Makefile.shprog (limited to 'gnu/usr.bin') diff --git a/gnu/usr.bin/man/Makefile.shprog b/gnu/usr.bin/man/Makefile.shprog new file mode 100644 index 000000000000..665a194917ff --- /dev/null +++ b/gnu/usr.bin/man/Makefile.shprog @@ -0,0 +1,30 @@ +# $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 diff --git a/gnu/usr.bin/man/apropos/Makefile b/gnu/usr.bin/man/apropos/Makefile index a13f02acd2d8..0e986bbb27ee 100644 --- a/gnu/usr.bin/man/apropos/Makefile +++ b/gnu/usr.bin/man/apropos/Makefile @@ -1,44 +1,6 @@ -# $Id: Makefile,v 1.8 1994/08/28 18:33:42 bde Exp $ +# $Id: Makefile,v 1.9 1995/07/25 00:33:07 bde Exp $ -.if exists(${.CURDIR}/obj) -MAN1= ${.CURDIR}/obj/apropos.1 -TARG= ${.CURDIR}/obj/apropos -.else -MAN1= ${.CURDIR}/apropos.1 -TARG= ${.CURDIR}/apropos -.endif +SHPROG= apropos -MANDEPEND= ${MAN1} - -CLEANFILES+= ${TARG} ${MAN1} - -all: ${TARG} ${MAN1} - -depend rcsfreeze tags all: - @echo -n - -${TARG}: ${.CURDIR}/apropos.sh - sed -e 's,%libdir%,${libdir},' -e 's,%bindir%,${bindir},' \ - -e 's,%pager%,${pager},' \ - ${.CURDIR}/apropos.sh > ${.TARGET} - -${MAN1}: ${.CURDIR}/apropos.man - 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},' \ - ${.CURDIR}/apropos.man > ${.TARGET} - -install: ${TARG} maninstall - ${INSTALL} -c -o bin -g bin -m 555 ${TARG} ${DESTDIR}/usr/bin - -.include "../Makefile.inc" - -.if make(maninstall) || make(install) -.if !defined(NOMAN) -.include -.elif !target(maninstall) -maninstall: -.endif -.endif - -.include +.include "../../Makefile.inc" +.include "../Makefile.shprog" diff --git a/gnu/usr.bin/man/whatis/Makefile b/gnu/usr.bin/man/whatis/Makefile index 8ca53dbbee7c..6fb62a287d59 100644 --- a/gnu/usr.bin/man/whatis/Makefile +++ b/gnu/usr.bin/man/whatis/Makefile @@ -1,41 +1,6 @@ -.if exists(${.CURDIR}/obj) -MAN1= ${.CURDIR}/obj/whatis.1 -TARG= ${.CURDIR}/obj/whatis -.else -MAN1= ${.CURDIR}/whatis.1 -TARG= ${.CURDIR}/whatis -.endif +# $Id$ -MANDEPEND= ${MAN1} +SHPROG= whatis -CLEANFILES+= ${TARG} ${MAN1} - -all: ${TARG} ${MAN1} - -depend rcsfreeze tags all: - @echo -n - -${TARG}: ${.CURDIR}/whatis.sh - sed -e 's,%libdir%,${libdir},' -e 's,%bindir%,${bindir},' \ - -e 's,%pager%,${pager},' \ - ${.CURDIR}/whatis.sh > ${.TARGET} - -${MAN1}: ${.CURDIR}/whatis.man - 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},' \ - ${.CURDIR}/whatis.man > ${.TARGET} - -install: ${TARG} maninstall - ${INSTALL} -c -o bin -g bin -m 555 ${TARG} ${DESTDIR}/usr/bin - -.include "../Makefile.inc" -.if make(maninstall) || make(install) -.if !defined(NOMAN) -.include -.else -maninstall: -.endif -.endif - -.include +.include "../../Makefile.inc" +.include "../Makefile.shprog" -- cgit v1.3