diff options
author | Todd T. Fries <todd@cvs.openbsd.org> | 2008-06-16 08:18:40 +0000 |
---|---|---|
committer | Todd T. Fries <todd@cvs.openbsd.org> | 2008-06-16 08:18:40 +0000 |
commit | 84c4211c374c42b06af9b8acafbe05bc51ea8750 (patch) | |
tree | eb94aa06e1bfecf925eca67f74bf181b70cffb35 | |
parent | a0e750fb13efa9e3304fbd1cf8a87ba73db71614 (diff) |
build MAKEDEV.8's conditionally upon more than just rcsid changes also
-rw-r--r-- | etc/MAKEDEV.man | 4 | ||||
-rw-r--r-- | etc/Makefile.inc | 53 |
2 files changed, 49 insertions, 8 deletions
diff --git a/etc/MAKEDEV.man b/etc/MAKEDEV.man index d83e3d9321f..9827d9b3c6b 100644 --- a/etc/MAKEDEV.man +++ b/etc/MAKEDEV.man @@ -1,7 +1,7 @@ define(COMM,`.\"')dnl include(MAKEDEV.mansub)dnl dnl -vers(a, {-$OpenBSD: MAKEDEV.man,v 1.3 2004/03/12 18:12:12 miod Exp $-})dnl +vers(a, {-$OpenBSD: MAKEDEV.man,v 1.4 2008/06/16 08:18:39 todd Exp $-})dnl dnl define(quote,{-.Dq $1 -})dnl @@ -23,7 +23,7 @@ define({-_std-},)dnl divert(1)dnl dnl send md shell fragments to the bit bucket... define(__mddivert,11)dnl -include(etc.MACHINE/MAKEDEV.md)dnl +include(MAKEDEV.md)dnl dnl .El divert(0)dnl diff --git a/etc/Makefile.inc b/etc/Makefile.inc index 3da639c951f..3947adfbf18 100644 --- a/etc/Makefile.inc +++ b/etc/Makefile.inc @@ -1,28 +1,69 @@ -# $OpenBSD: Makefile.inc,v 1.3 2008/06/15 01:56:59 deraadt Exp $ +# $OpenBSD: Makefile.inc,v 1.4 2008/06/16 08:18:39 todd Exp $ + +M=${.CURDIR:C/^.*\/etc\.([^\/]*)$/\1/} + +DOCDIR= ${.CURDIR}/../../share/man/man8/man8.${M} + +MAKEDEV: ${.CURDIR}/MAKEDEV ${DOCDIR}/MAKEDEV.8 + +# set 'NOCLEAN=:' to debug MAKEDEVSRC= ${.CURDIR}/../MAKEDEV.mi MAKEDEVSRC+= ${.CURDIR}/../MAKEDEV.sub MAKEDEVSRC+= ${.CURDIR}/../MAKEDEV.common MAKEDEVSRC+= MAKEDEV.md -MAKEDEV: ${MAKEDEVSRC} +${.CURDIR}/MAKEDEV: ${MAKEDEVSRC} @if m4 -I${.CURDIR}/.. -I${.CURDIR} \ ${.CURDIR}/../MAKEDEV.mi > MAKEDEV.tmp; then \ if ! [ -f ${.CURDIR}/MAKEDEV ]; then \ echo " m4 -I.. -I. ../MAKEDEV.mi > MAKEDEV"; \ cp MAKEDEV.tmp ${.CURDIR}/MAKEDEV; \ - rm MAKEDEV.tmp; \ + ${NOCLEAN} rm MAKEDEV.tmp; \ exit 0; \ fi; \ diff MAKEDEV.tmp ${.CURDIR}/MAKEDEV > diffout1 || true; \ sed -e 's/^--.*$$//' \ -e 's/^[\<\>] #.*OpenBSD.*Exp $$//' \ - -e 's/^[0-9]*c[0-9]*$$//' \ + -e 's/^[0-9,]*c[0-9,]*$$//' \ -e '/^$$/d' \ diffout1 > diffout2; \ if [ -s diffout2 ]; then \ echo " m4 -I.. -I. ../MAKEDEV.mi > MAKEDEV"; \ cp MAKEDEV.tmp ${.CURDIR}/MAKEDEV || true; \ + ${NOCLEAN} rm MAKEDEV.tmp; \ fi; \ - rm diffout1 diffout2; \ - fi + ${NOCLEAN} rm -f diffout1 diffout2; \ + fi; ${NOCLEAN} rm -f MAKEDEV.tmp + +MAKEDEVDOC= ${.CURDIR}/../MAKEDEV.man +MAKEDEVDOC+= ${.CURDIR}/../MAKEDEV.mansub +MAKEDEVDOC+= ${.CURDIR}/../MAKEDEV.common +MAKEDEVDOC+= MAKEDEV.md + +${DOCDIR}/MAKEDEV.8: ${MAKEDEVDOC} + @if m4 -I${.CURDIR}/.. -I${.CURDIR} \ + ${.CURDIR}/../MAKEDEV.man > MAKEDEV.mtmp; then \ + if ! [ -f ${DOCDIR}/MAKEDEV.8 ]; then \ + echo " m4 -I.. -I. ../MAKEDEV.man > ${DOCDIR}/MAKEDEV.8"; \ + cp MAKEDEV.mtmp ${DOCDIR}/MAKEDEV.8; \ + ${NOCLEAN} rm MAKEDEV.mtmp; \ + exit 0; \ + fi; \ + diff MAKEDEV.mtmp ${DOCDIR}/MAKEDEV.8 > mdiffout1 || true; \ + sed -e 's/^--.*$$//' \ + -e 's/^[\<\>] \.\\".*OpenBSD.*Exp $$//' \ + -e 's/^[\<\>] \.\\".*\$$OpenBSD.*\$$$$//' \ + -e 's/^[\<\>] \.Dd .*[0-9][0-9][0-9][0-9]$$//' \ + -e 's/^[0-9,]*c[0-9,]*$$//' \ + -e '/^$$/d' \ + mdiffout1 > mdiffout2; \ + if [ -s mdiffout2 ]; then \ + echo " m4 -I.. -I. ../MAKEDEV.man > ${DOCDIR}/MAKEDEV.8"; \ + cp MAKEDEV.mtmp ${DOCDIR}/MAKEDEV.8 || true; \ + ${NOCLEAN} rm MAKEDEV.mtmp; \ + fi; \ + ${NOCLEAN} rm -f mdiffout1 mdiffout2; \ + fi; ${NOCLEAN} rm -f MAKEDEV.mtmp + +.PHONY: ${.CURDIR}/MAKEDEV ${DOCDIR}/MAKEDEV.8 |