bsd.doc.mk changes:

Don't gratuitously pipe thru a cat(1) if NODOCCOMPRESS.

Only create _stamp.extra when necessary.

Get rid of SOELIMPP and OBJS.

Use Groff version of soelim(1); we need its -I option
for the following to work.

Don't needlessly chdir to SRCDIR.  Only a few documents
need CD_HACK, and those that need it either use refer(1)
or .PSPIC macro which internally uses the .psbb call.
This commit is contained in:
Ruslan Ermilov 2002-10-29 14:56:09 +00:00
parent 408b5dd1c3
commit b382ba4fb1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=106143
31 changed files with 164 additions and 191 deletions

View File

@ -1,8 +1,5 @@
# $FreeBSD$
SUBDIR= eqn grn html pic refer tbl
# BSD already provides soelim(1)
MISC= soelim
SUBDIR= eqn grn html pic refer soelim tbl
.include <bsd.subdir.mk>

View File

@ -4,7 +4,6 @@
.\" @(#)nfs.rfc.ms 2.2 88/08/05 4.0 RPCSRC
.\" $FreeBSD$
.\"
.so stubs
.de BT
.if \\n%=1 .tl ''- % -''
..

View File

@ -4,7 +4,6 @@
.\" @(#)rpc.prog.ms 2.3 88/08/11 4.0 RPCSRC
.\" $FreeBSD$
.\"
.so stubs
.de BT
.if \\n%=1 .tl ''- % -''
..

View File

@ -4,7 +4,6 @@
.\" @(#)rpc.rfc.ms 2.2 88/08/05 4.0 RPCSRC
.\" $FreeBSD$
.\"
.so stubs
.de BT
.if \\n%=1 .tl ''- % -''
..

View File

@ -4,7 +4,6 @@
.\" @(#)rpcgen.ms 2.2 88/08/04 4.0 RPCSRC
.\" $FreeBSD$
.\"
.so stubs
.de BT
.if \\n%=1 .tl ''- % -''
..

View File

@ -4,7 +4,6 @@
.\" @(#)xdr.nts.ms 2.2 88/08/05 4.0 RPCSRC
.\" $FreeBSD$
.\"
.so stubs
.EQ
delim $$
.EN

View File

@ -4,7 +4,6 @@
.\" @(#)xdr.rfc.ms 2.2 88/08/05 4.0 RPCSRC
.\" $FreeBSD$
.\"
.so stubs
.de BT
.if \\n%=1 .tl ''- % -''
..

View File

@ -1,9 +1,10 @@
# $FreeBSD$
USE_PIC=1
VOLUME= papers
DOC= bio
SRCS= bio.ms
MACROS= -ms
VOLUME= papers
DOC= bio
SRCS= bio.ms
MACROS= -ms
USE_PIC= YES
CD_HACK= ${.CURDIR}
.include <bsd.doc.mk>

View File

@ -1,8 +1,11 @@
# $FreeBSD$
VOLUME= papers
DOC= jail
SRCS= paper.ms
EXTRA= implementation.ms mgt.ms future.ms
MACROS= -ms
VOLUME= papers
DOC= jail
SRCS= paper.ms
EXTRA= implementation.ms mgt.ms future.ms
MACROS= -ms
USE_SOELIM= YES
CD_HACK= ${.CURDIR}
.include <bsd.doc.mk>

View File

@ -1,20 +1,18 @@
# From: @(#)Makefile 1.8 (Berkeley) 6/8/93
# $FreeBSD$
VOLUME= papers
DOC= kernmalloc
SRCS= kernmalloc.ms appendix.ms
SRCDIR= ${.OBJDIR} # ack!
MACROS= -ms
USE_TBL= yes
USE_PIC= yes
USE_EQN= yes
CLEANFILES+= kernmalloc.ms appendix.ms
VOLUME= papers
DOC= kernmalloc
SRCS= kernmalloc.t appendix.ms
EXTRA= alloc.fig usage.tbl
MACROS= -ms
USE_EQN= YES
USE_PIC= YES
USE_SOELIM= YES
USE_TBL= YES
CLEANFILES= appendix.ms
kernmalloc.ms: kernmalloc.t alloc.fig usage.tbl
(cd ${.CURDIR}; ${SOELIM} kernmalloc.t) > ${.TARGET}
appendix.ms: appendix.t
vgrind -f < ${.CURDIR}/appendix.t > ${.TARGET}
appendix.ms: appendix.t
${GRIND} < ${.ALLSRC} > ${.TARGET}
.include <bsd.doc.mk>

View File

@ -1,20 +1,17 @@
# From: @(#)Makefile 5.3 (Berkeley) 6/8/93
# $FreeBSD$
VOLUME= papers
DOC= px
SRCS= tmac.p pxin0.n pxin1.n pxin2.n pxin3.n pxin4.n
EXTRA= fig1.1.n fig1.2.n fig1.3.n fig2.3.raw fig2.4.n fig3.2.n \
fig3.3.n table2.1.n table2.2.n table2.3.n table3.1.n
OBJS= fig2.3.n
CLEANFILES+=fig2.3.n
MACROS= -ms
USE_SOELIM= yes
USE_SOELIMPP= yes
USE_TBL= yes
VOLUME= papers
DOC= px
SRCS= tmac.p pxin0.n pxin1.n pxin2.n pxin3.n pxin4.n
EXTRA= fig1.1.n fig1.2.n fig1.3.n fig2.3.n fig2.4.n fig3.2.n \
fig3.3.n table2.1.n table2.2.n table2.3.n table3.1.n
MACROS= -ms
USE_SOELIM= YES
USE_TBL= YES
CLEANFILES= fig2.3.n
fig2.3.n: fig2.3.raw
sort ${.CURDIR}/fig2.3.raw >fig2.3.n
sort ${.ALLSRC} >${.TARGET}
.include <bsd.doc.mk>

View File

@ -1,12 +1,12 @@
# From: @(#)Makefile 1.6 (Berkeley) 6/8/93
# $FreeBSD$
VOLUME= papers
DOC= releng
SRCS= 0.t 1.t 2.t 3.t
MACROS= -ms
EXTRA= ref.bib
USE_REFER= yes
VOLUME= papers
DOC= releng
SRCS= 0.t 1.t 2.t 3.t
EXTRA= ref.bib
MACROS= -ms
USE_REFER= YES
CD_HACK= ${.CURDIR}
.include <bsd.doc.mk>

View File

@ -1,16 +1,14 @@
# From: @(#)Makefile 1.6 (Berkeley) 6/8/93
# $FreeBSD$
VOLUME= papers
DOC= sysperf
MACROS= -ms
SRCS= 0.t 1.t 2.t 3.t 4.t 5.t 6.t 7.t
EXTRA= a1.t a2.t
SRCS+= appendix.tmp
VOLUME= papers
DOC= sysperf
SRCS= 0.t 1.t 2.t 3.t 4.t 5.t 6.t 7.t appendix.tmp
EXTRA= a1.t a2.t
MACROS= -ms
USE_EQN= YES
USE_TBL= YES
CLEANFILES= appendix.tmp
SRCDIR= ${.OBJDIR}
USE_EQN= yes
USE_TBL= yes
appendix.tmp: a1.t a2.t
${GRIND} ${.CURDIR}/a1.t | awk '/\.\(\)/{ cnt = 2 } \

View File

@ -1,12 +1,12 @@
# @(#)Makefile 8.1 (Berkeley) 6/8/93
# $FreeBSD$
VOLUME= psd/01.cacm
SRCS= p.mac p1 p2 p3 p4 p5 p6
EXTRA= ref.bib
MACROS= -ms
USE_REFER= yes
USE_TBL= yes
VOLUME= psd/01.cacm
SRCS= p.mac p1 p2 p3 p4 p5 p6
EXTRA= ref.bib
MACROS= -ms
USE_REFER= YES
USE_TBL= YES
CD_HACK= ${.CURDIR}
.include <bsd.doc.mk>

View File

@ -1,13 +1,13 @@
# @(#)Makefile 8.1 (Berkeley) 6/8/93
# $FreeBSD$
VOLUME= psd/02.implement
SRCS= implement
EXTRA= ref.bib
MACROS= -ms
USE_PIC= yes
USE_REFER= yes
USE_SOELIM= yes
VOLUME= psd/02.implement
SRCS= implement
EXTRA= ref.bib
MACROS= -ms
USE_PIC= YES
USE_REFER= YES
USE_SOELIM= YES
CD_HACK= ${.CURDIR}
.include <bsd.doc.mk>

View File

@ -2,7 +2,7 @@
# $FreeBSD$
VOLUME= psd/12.make
SRCS= tutorial.ms
SRCS= stubs tutorial.ms
MACROS= -ms
SRCDIR= ${.CURDIR}/../../../../usr.bin/make/PSD.doc

View File

@ -1,11 +1,11 @@
# @(#)Makefile 8.1 (Berkeley) 8/14/93
# $FreeBSD$
VOLUME= psd/15.yacc
SRCS= ss.. ss0 ss1 ss2 ss3 ss4 ss5 ss6 ss7 ss8 ss9 ssA ssB ssa ssb ssc ssd
EXTRA= ref.bib
MACROS= -ms
USE_REFER= yes
VOLUME= psd/15.yacc
SRCS= ss.. ss0 ss1 ss2 ss3 ss4 ss5 ss6 ss7 ss8 ss9 ssA ssB ssa ssb ssc ssd
EXTRA= ref.bib
MACROS= -ms
USE_REFER= YES
CD_HACK= ${.CURDIR}
.include <bsd.doc.mk>

View File

@ -1,10 +1,9 @@
# $FreeBSD$
VOLUME= psd/22.rpcgen
SRCS= rpcgen.ms
MACROS= -ms
SRCDIR= ${.CURDIR}/../../../../lib/libc/rpc/PSD.doc
USE_TBL= yes
VOLUME= psd/22.rpcgen
SRCS= stubs rpcgen.ms
MACROS= -ms
USE_TBL= YES
SRCDIR= ${.CURDIR}/../../../../lib/libc/rpc/PSD.doc
.include <bsd.doc.mk>

View File

@ -1,11 +1,10 @@
# $FreeBSD$
VOLUME= psd/23.rpc
SRCS= rpc.prog.ms
MACROS= -ms
SRCDIR= ${.CURDIR}/../../../../lib/libc/rpc/PSD.doc
USE_TBL= yes
USE_PIC= yes
VOLUME= psd/23.rpc
SRCS= stubs rpc.prog.ms
MACROS= -ms
USE_TBL= YES
USE_PIC= YES
SRCDIR= ${.CURDIR}/../../../../lib/libc/rpc/PSD.doc
.include <bsd.doc.mk>

View File

@ -1,10 +1,9 @@
# $FreeBSD$
VOLUME= psd/24.xdr
SRCS= xdr.nts.ms
MACROS= -ms
SRCDIR= ${.CURDIR}/../../../../lib/libc/rpc/PSD.doc
USE_EQN= yes
VOLUME= psd/24.xdr
SRCS= stubs xdr.nts.ms
MACROS= -ms
USE_EQN= YES
SRCDIR= ${.CURDIR}/../../../../lib/libc/rpc/PSD.doc
.include <bsd.doc.mk>

View File

@ -1,10 +1,9 @@
# $FreeBSD$
VOLUME= psd/25.xdrrfc
SRCS= xdr.rfc.ms
MACROS= -ms
SRCDIR= ${.CURDIR}/../../../../lib/libc/rpc/PSD.doc
USE_TBL= yes
VOLUME= psd/25.xdrrfc
SRCS= stubs xdr.rfc.ms
MACROS= -ms
USE_TBL= YES
SRCDIR= ${.CURDIR}/../../../../lib/libc/rpc/PSD.doc
.include <bsd.doc.mk>

View File

@ -1,10 +1,9 @@
# $FreeBSD$
VOLUME= psd/26.rpcrfc
SRCS= rpc.rfc.ms
MACROS= -ms
SRCDIR= ${.CURDIR}/../../../../lib/libc/rpc/PSD.doc
USE_TBL= yes
VOLUME= psd/26.rpcrfc
SRCS= stubs rpc.rfc.ms
MACROS= -ms
USE_TBL= YES
SRCDIR= ${.CURDIR}/../../../../lib/libc/rpc/PSD.doc
.include <bsd.doc.mk>

View File

@ -1,10 +1,9 @@
# $FreeBSD$
VOLUME= psd/27.nfsrfc
SRCS= nfs.rfc.ms
MACROS= -ms
SRCDIR= ${.CURDIR}/../../../../lib/libc/rpc/PSD.doc
USE_TBL= yes
VOLUME= psd/27.nfsrfc
SRCS= stubs nfs.rfc.ms
MACROS= -ms
USE_TBL= YES
SRCDIR= ${.CURDIR}/../../../../lib/libc/rpc/PSD.doc
.include <bsd.doc.mk>

View File

@ -1,27 +1,25 @@
# From: @(#)Makefile 8.16 (Berkeley) 8/15/94
# $FreeBSD$
VOLUME= usd/13.viref
SRCS= vi.ref
EXTRA= ex.cmd.roff ref.so set.opt.roff vi.cmd.roff
OBJS= index.so
MACROS= -me -U
CLEANFILES+=index index.so
USE_SOELIM= yes
USE_SOELIMPP= yes
USE_TBL= yes
SRCDIR= ${.CURDIR}/../../../../contrib/nvi/docs/USD.doc/vi.ref
VOLUME= usd/13.viref
SRCS= vi.ref
EXTRA= ex.cmd.roff ref.so set.opt.roff vi.cmd.roff index.so
MACROS= -me
CLEANFILES= index index.so
TRFLAGS= -U # this is to hide warnings only
USE_SOELIM= YES
USE_TBL= YES
SRCDIR= ${.CURDIR}/../../../../contrib/nvi/docs/USD.doc/vi.ref
# Build index.so as a side-effect of building the paper.
index.so: ${SRCS} ${EXTRA}
(cd ${SRCDIR}; ${SOELIMPP} -e 's:^\.so index.so$$::' ${SRCS}) | \
${ROFF} > /dev/null
index.so: ${SRCS} ${EXTRA:Nindex.so}
(cd ${SRCDIR}; sed -e 's:^\.so index.so$$::' ${SRCS}) | ${ROFF} -U -z
sed -e 's/MINUSSIGN/-/' \
-e 's/DOUBLEQUOTE/""/' \
-e "s/SQUOTE/'/" \
-e 's/ /__SPACE/g' < index | \
sort -u '-t ' -k 1,1 -k 2n | awk -f ${SRCDIR}/merge.awk | \
sed -e 's/__SPACE/ /g' \
-e "s/^\\(['\\.]\\)/\\\\\&\\1/" > index.so
-e "s/^\\(['\\.]\\)/\\\\\&\\1/" > index.so
.include <bsd.doc.mk>

View File

@ -1,14 +1,11 @@
# From: @(#)Makefile 8.1 (Berkeley) 6/8/93
# $FreeBSD$
VOLUME= usd/19.memacros
SRCS= meintro.me-sed
MACROS= -me
SRCDIR= ${.OBJDIR}
GROFFDIR=${.CURDIR}/../../../../contrib/groff
.PATH: ${GROFFDIR}/doc
VOLUME= usd/19.memacros
SRCS= meintro.me-sed
MACROS= -me
GROFFDIR= ${.CURDIR}/../../../../contrib/groff
SRCDIR= ${GROFFDIR}/doc
version=`cat ${GROFFDIR}/VERSION`
revision=`sed -e 's/^0$$//' -e 's/^[1-9].*$$/.&/' ${GROFFDIR}/REVISION`
@ -16,6 +13,6 @@ revision=`sed -e 's/^0$$//' -e 's/^[1-9].*$$/.&/' ${GROFFDIR}/REVISION`
meintro.me-sed: meintro.me
sed -e "s;@VERSION@;$(version)$(revision);" ${.ALLSRC} > ${.TARGET}
CLEANFILES+=${SRCS}
CLEANFILES= ${SRCS}
.include <bsd.doc.mk>

View File

@ -1,14 +1,11 @@
# From: @(#)Makefile 8.1 (Berkeley) 6/8/93
# $FreeBSD$
VOLUME= usd/20.meref
SRCS= meref.me-sed
MACROS= -me
SRCDIR= ${.OBJDIR}
GROFFDIR=${.CURDIR}/../../../../contrib/groff
.PATH: ${GROFFDIR}/doc
VOLUME= usd/20.meref
SRCS= meref.me-sed
MACROS= -me
GROFFDIR= ${.CURDIR}/../../../../contrib/groff
SRCDIR= ${GROFFDIR}/doc
version=`cat ${GROFFDIR}/VERSION`
revision=`sed -e 's/^0$$//' -e 's/^[1-9].*$$/.&/' ${GROFFDIR}/REVISION`
@ -16,6 +13,6 @@ revision=`sed -e 's/^0$$//' -e 's/^[1-9].*$$/.&/' ${GROFFDIR}/REVISION`
meref.me-sed: meref.me
sed -e "s;@VERSION@;$(version)$(revision);" ${.ALLSRC} > ${.TARGET}
CLEANFILES+=${SRCS}
CLEANFILES= ${SRCS}
.include <bsd.doc.mk>

View File

@ -1,10 +1,8 @@
# @(#)Makefile 8.1 (Berkeley) 8/14/93
# $FreeBSD$
VOLUME= usd/21.troff
SRCS= m0 m0a m1 m2 m3 m4 m5
SRCS+= table1 table2
MACROS= m.mac
USE_TBL=YES
VOLUME= usd/21.troff
SRCS= m.mac m0 m0a m1 m2 m3 m4 m5 table1 table2
USE_TBL= YES
.include <bsd.doc.mk>

View File

@ -41,6 +41,5 @@ VOLUME= usd/22.trofftut
SRCS= tt.mac tt00 tt01 tt02 tt03 tt04 tt05 tt06 tt07 tt08 tt09 tt10 \
tt11 tt12 tt13 tt14 ttack ttcharset ttindex
MACROS= -ms
SRCDIR= ${.OBJDIR}
.include <bsd.doc.mk>

View File

@ -26,16 +26,11 @@ INDXBIB?= indxbib
PIC?= pic
REFER?= refer
.if ${PRINTERDEVICE} == "ascii"
ROFF?= groff -mtty-char ${TRFLAGS} ${MACROS} -o${PAGES}
ROFF?= groff -mtty-char ${TRFLAGS} ${MACROS} -o${PAGES}
.else
ROFF?= groff ${TRFLAGS} ${MACROS} -o${PAGES}
.endif
SOELIM?= soelim
SOELIMPP= sed ${SOELIMPPARGS}
SOELIMPPARGS0= ${SRCS} ${EXTRA}
SOELIMPPARGS1= ${SOELIMPPARGS0:S/^/-e\\ \'s:\(\.so[\\ \\ ][\\ \\ ]*\)\(/}
SOELIMPPARGS2= ${SOELIMPPARGS1:S/$/\)\$:\1${SRCDIR}\/\2:\'/}
SOELIMPPARGS= ${SOELIMPPARGS2:S/\\'/'/g}
TBL?= tbl
DOC?= paper
@ -45,25 +40,24 @@ TRFLAGS+= -T${PRINTERDEVICE}
.if defined(USE_EQN)
TRFLAGS+= -e
.endif
.if defined(USE_TBL)
TRFLAGS+= -t
.endif
.if defined(USE_PIC)
TRFLAGS+= -p
.endif
.if defined(USE_SOELIM)
TRFLAGS+= -s
.endif
.if defined(USE_REFER)
TRFLAGS+= -R
.endif
.if defined(USE_SOELIM)
TRFLAGS+= -I${SRCDIR}
.endif
.if defined(USE_TBL)
TRFLAGS+= -t
.endif
DCOMPRESS_EXT?= ${COMPRESS_EXT}
.if defined(NODOCCOMPRESS) || ${PRINTERDEVICE} == "html"
DFILE= ${DOC}.${PRINTERDEVICE}
DCOMPRESS_CMD= cat
DFILE= ${DOC}.${PRINTERDEVICE}
.else
DFILE= ${DOC}.${PRINTERDEVICE}${DCOMPRESS_EXT}
DFILE= ${DOC}.${PRINTERDEVICE}${DCOMPRESS_EXT}
DCOMPRESS_CMD?= ${COMPRESS_CMD}
.endif
@ -77,12 +71,12 @@ UNROFFFLAGS+= split=1
.endif
# Compatibility mode flag for groff. Use this when formatting documents with
# Berkeley me macros.
# Berkeley me macros (orig_me(7)).
COMPAT?= -C
.PATH: ${.CURDIR} ${SRCDIR}
all: ${DFILE}
all: ${DFILE}
.if !target(print)
print: ${DFILE}
@ -103,36 +97,46 @@ CLEANFILES+= ${DOC}.ascii ${DOC}.ascii${DCOMPRESS_EXT} \
realinstall:
.if ${PRINTERDEVICE} == "html"
cd ${SRCDIR}; \
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
${DOC}*.html ${DESTDIR}${BINDIR}/${VOLUME}
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
${DOC}*.html ${DESTDIR}${BINDIR}/${VOLUME}
.else
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
${DFILE} ${DESTDIR}${BINDIR}/${VOLUME}
${DFILE} ${DESTDIR}${BINDIR}/${VOLUME}
.endif
spell: ${SRCS}
(cd ${.CURDIR}; spell ${SRCS} ) | sort | \
(cd ${.CURDIR}; spell ${SRCS} ) | sort | \
comm -23 - ${.CURDIR}/spell.ok > ${DOC}.spell
BINDIR?= /usr/share/doc
BINMODE= 444
BINMODE= 444
SRCDIR?= ${.CURDIR}
.if !target(${DFILE})
_stamp.extraobjs: ${EXTRA} ${OBJS}
.if defined(EXTRA) && !empty(EXTRA)
_stamp.extra: ${EXTRA}
touch ${.TARGET}
CLEANFILES+= _stamp.extraobjs
${DFILE}: ${SRCS} _stamp.extraobjs
CLEANFILES+= _stamp.extra
${DFILE}: _stamp.extra
.endif
${DFILE}: ${SRCS}
.if ${PRINTERDEVICE} == "html"
cd ${SRCDIR}; ${UNROFF} ${MACROS} ${UNROFFFLAGS} \
document=${DOC} ${SRCS}
.elif defined(USE_SOELIMPP)
${SOELIMPP} ${.ALLSRC:N_stamp.extraobjs} | ${ROFF} | \
.elif defined(NODOCCOMPRESS)
.if defined(CD_HACK)
(cd ${CD_HACK}; ${ROFF} ${.ALLSRC:N_stamp.extra}) > ${.TARGET}
.else
${ROFF} ${.ALLSRC:N_stamp.extra} > ${.TARGET}
.endif
.else
.if defined(CD_HACK)
(cd ${CD_HACK}; ${ROFF} ${.ALLSRC:N_stamp.extra}) | \
${DCOMPRESS_CMD} > ${.TARGET}
.else
(cd ${SRCDIR}; ${ROFF} ${.ALLSRC:N_stamp.extraobjs}) | \
${DCOMPRESS_CMD} > ${.TARGET}
${ROFF} ${.ALLSRC:N_stamp.extra} | ${DCOMPRESS_CMD} > ${.TARGET}
.endif
.endif
.endif

View File

@ -146,7 +146,6 @@ SUBDIR= alias \
shar \
showmount \
sockstat \
soelim \
split \
stat \
su \

View File

@ -37,7 +37,6 @@
.\" @(#)tutorial.ms 8.1 (Berkeley) 8/18/93
.\" $FreeBSD$
.\"
.so stubs
.EH 'PSD:12-%''PMake \*- A Tutorial'
.OH 'PMake \*- A Tutorial''PSD:12-%'
.\" xH is a macro to provide numbered headers that are automatically stuffed