head 3.6; access; symbols; locks; strict; comment @# @; 3.6 date 2004.11.19.07.06.07; author grog; state Exp; branches; next 3.5; 3.5 date 2004.11.19.02.52.41; author grog; state Exp; branches; next 3.4; 3.4 date 2004.11.19.02.20.42; author grog; state Exp; branches; next 3.3; 3.3 date 2004.11.19.02.17.46; author grog; state Exp; branches; next 3.2; 3.2 date 2004.11.19.02.00.38; author grog; state Exp; branches; next 3.1; 3.1 date 99.08.24.08.28.24; author grog; state Exp; branches; next 3.0; 3.0 date 95.06.26.08.08.39; author grog; state Exp; branches; next 1.11; 1.11 date 95.06.25.12.44.04; author grog; state Exp; branches; next 1.10; 1.10 date 95.06.24.12.44.00; author grog; state Exp; branches; next 1.9; 1.9 date 95.06.12.03.24.06; author grog; state Exp; branches; next 1.8; 1.8 date 95.06.09.11.20.43; author grog; state Exp; branches; next 1.7; 1.7 date 95.06.09.04.29.45; author grog; state Exp; branches; next 1.6; 1.6 date 95.05.22.06.52.29; author grog; state Exp; branches; next 1.5; 1.5 date 95.01.30.11.48.24; author grog; state Exp; branches; next 1.4; 1.4 date 95.01.26.12.30.05; author grog; state Exp; branches; next 1.3; 1.3 date 95.01.26.11.43.23; author grog; state Exp; branches; next 1.2; 1.2 date 95.01.26.10.47.52; author grog; state Exp; branches; next 1.1; 1.1 date 95.01.25.13.39.09; author grog; state Exp; branches; next ; desc @Make auxiliary Makefile 'bookmakefile' @ 3.6 log @Remove $Log$ @ text @# Create the file book.make, which is included by the main # Makefile. This is needed because each chapter depends # on the previous chapter (due to the possibility of changed # page numbers), so we need to build a chain of dependencies. # # Usage: # $0 Preface Chapters # # $Id: makebookmakefile,v 3.5 2004/11/19 02:52:41 grog Exp grog $ # # parms=$* # save the original parameters echo >book.make "# Makefile generated automatically by $0 on `date`" echo >>book.make '# Do not edit this file' echo >>book.make base=`basename $1 .ps` # $1 is preface, by convention realtarget=Chapter/$base.ps echo >>book.make $1 Chapter/$1: ' Xref' $base.ms global.ms # echo >>book.make ' @@echo' TARGET: \$@@ echo >>book.make ' ' @@echo +++ Formatting $base to Chapter/00-$base.ps echo >>book.make ' ' @@\(echo \".FILE $base.ms\"\; echo \".af PN i\"\; soelim $base.ms\) \| \\ echo >>book.make ' ' sed -f \${CLEANUP} \| \${PIC} \| \${TBL} \| \\ echo >>book.make ' ' \${TROFF} -mgs -mpic \${MACROFILE} - \\ echo >>book.make ' ' \>Chapter/00-$base.ps 2\>Toc/$base echo >>book.make ' '@@-egrep -v ^\'Chapter\|File\|\>\<\' Toc/$base \|\| true echo >>book.make ' '@@echo 1 '>' Toc/$base.firstafter echo >>book.make ' '@@rm -f $realtarget\; ln Chapter/00-$base.ps $realtarget echo >>book.make while [ "$2" != "" ]; do base=`basename $2 .ps` realtarget=Chapter/$base.ps base1=`basename $1 .ps` echo >> book.make $2 Chapter/$2: ' ' Toc/$base.firstpage $base.ms global.ms # echo >>book.make ' @@echo' TARGET: \$@@ echo >>book.make ' ' @@title=$base\; \\ echo >>book.make ' ' read \< Toc/\$\$title.firstpage page\; \\ echo >>book.make ' ' echo -n \"+++ Chapter \$\$title starts on page \$\$page \"\; \\ echo >>book.make ' ' \(echo \".FILE \$\$title.ms\"\; echo \".pn \$\$page\"\; soelim \$\$title.ms\) \| \\ echo >>book.make ' ' sed -f \${CLEANUP} \| \${PIC} \| \${TBL} \| \\ echo >>book.make ' ' \${TROFF} -mgs -mpic \${MACROFILE} - \\ echo >>book.make ' ' \>$realtarget.tmp 2\>Toc/\$\$title\; \\ echo >>book.make ' ' exitcode=\$\$?\; \\ echo >>book.make ' ' mv $realtarget.tmp $realtarget\; \\ echo >>book.make ' ' chapter=\`awk \< Toc/\$\$title \'/Chapter/ {chapter = \$\$2}\; END {print chapter}\'\`\; \\ echo >>book.make ' ' chapter=\`basename \$\$chapter ,\`\; \\ echo >>book.make ' ' startpage=\$\$page\; \\ echo >>book.make ' ' page=\`awk \< $realtarget \'/%%Page:/ {page=\$\$2 }\; END {print page}\'\`\; \\ echo >>book.make ' ' if [ \$\$chapter -lt 10 ]\; then \\ echo >>book.make ' ' filename=Chapter/0\$\$chapter-\$\$title.ps\; \\ echo >>book.make ' ' else \\ echo >>book.make ' ' filename=Chapter/\$\$chapter-\$\$title.ps\; \\ echo >>book.make ' ' fi\; \\ echo >>book.make ' ' echo -n \"and ends on page \$\$page \"\; \\ echo >>book.make ' ' page=\`expr \$\$page + 1\`\; \\ echo >>book.make ' ' echo \\\(\`expr \$\$page - \$\$startpage\` pages\\\): \$\$filename\; \\ echo >>book.make ' ' if [ \`expr \$\$page % 2 \` -eq 0 ]\; then \\ echo >>book.make ' ' echo \" \(Last page is blank\)\"\; \\ echo >>book.make ' ' page=\`expr \$\$page + 1\`\; \\ echo >>book.make ' ' fi\; \\ echo >>book.make ' ' echo \$\$page \> Toc/\$\$title.firstafter\; \\ echo >>book.make ' ' egrep -v ^\'Chapter\|File\|\>\<\' Toc/\$\$title \|\| true\; \\ echo >>book.make ' ' rm -f \$\$filename\; \\ echo >>book.make ' ' ln $realtarget \$\$filename\; \\ echo >>book.make ' ' if [ \$\$exitcode -ne 0 ]\; then \\ echo >>book.make ' ' echo \"*** Exit code \$\$exitcode - format aborted\"\; \\ echo >>book.make ' ' fi echo >>book.make echo >> book.make Toc/$base.firstpage: ' ' Chapter/$1 # echo >>book.make ' @@echo' TARGET: \$@@ echo >>book.make ' ' @@rm -f Toc/$base.firstpage\; ln Toc/$base1.firstafter Toc/$base.firstpage echo >>book.make shift done echo >> book.make all: ' ' Chapter Toc fmt/exlist fmt/figlist fmt/index fmt/tablist fmt/toc Chapter/$1 echo >> book.make ' ' rm -f Book.Toc echo >> book.make ' ' -for i in \${SOURCES:.ms=}\; do grep PAGENO Toc/\$\$i \>\> Book.Toc\; done @ 3.5 log @Make silent again. @ text @d9 1 a9 46 # $Id: makebookmakefile,v 3.4 2004/11/19 02:20:42 grog Exp grog $ # # $Log: makebookmakefile,v $ # Revision 3.4 2004/11/19 02:20:42 grog # Evaluate TROFF later, not now. # # Revision 3.3 2004/11/19 02:17:46 grog # Remove -r$$. What was it intended to do? # # Revision 3.2 2004/11/19 02:00:38 grog # Use ${TROFF} instead of groff. # Don't die if grep on toc fails. # # Revision 3.1 1999/08/24 08:28:24 grog # Adapt for current environment # # Revision 3.0 1995/06/26 08:08:39 grog # Final draft # # Revision 1.10 1995/06/24 12:44:00 grog # Minor mods # # Revision 1.9 1995/06/12 03:24:06 grog # Mods to get xrefs right on ruby # # Revision 1.8 1995/06/09 11:20:43 grog # Minor mods # # Revision 1.7 1995/06/09 04:29:45 grog # Minor mods # Print out error messages # # Revision 1.6 1995/05/22 06:52:29 grog # Add dependencies on directories Chapter and Toc to 'all' target. # # Revision 1.5 1995/01/30 11:48:24 grog # Minor mods # # Revision 1.4 1995/01/26 12:30:05 grog # Minor mods # # Revision 1.3 1995/01/26 11:43:23 grog # Incorporate .ms.ps rule for each .ps target # # Revision 1.1 1995/01/25 13:39:09 grog # Initial revision @ 3.4 log @Evaluate TROFF later, not now. @ text @d9 1 a9 1 # $Id: makebookmakefile,v 3.3 2004/11/19 02:17:46 grog Exp grog $ d12 3 d67 1 a67 1 echo >>book.make ' ' \(echo \".FILE $base.ms\"\; echo \".af PN i\"\; soelim $base.ms\) \| \\ d82 1 a82 1 echo >>book.make ' ' title=$base\; \\ @ 3.3 log @Remove -r$$. What was it intended to do? @ text @d9 1 a9 1 # $Id: makebookmakefile,v 3.2 2004/11/19 02:00:38 grog Exp grog $ d12 3 d66 1 a66 1 echo >>book.make ' ' ${TROFF} -mgs -mpic \${MACROFILE} - \\ d84 1 a84 1 echo >>book.make ' ' ${TROFF} -mgs -mpic \${MACROFILE} - \\ @ 3.2 log @Use ${TROFF} instead of groff. Don't die if grep on toc fails. @ text @d9 1 a9 1 # $Id: makebookmakefile,v 3.1 1999/08/24 08:28:24 grog Exp grog $ d12 4 d61 1 a61 1 echo >>book.make ' ' @@\(echo \".FILE $base.ms\"\; echo \".af PN i\"\; soelim $base.ms\) \| \\ d63 1 a63 1 echo >>book.make ' ' ${TROFF} -r\$\$\$\$ -mgs -mpic \${MACROFILE} - \\ d76 1 a76 1 echo >>book.make ' ' @@title=$base\; \\ d81 1 a81 1 echo >>book.make ' ' ${TROFF} -r\$\$\$\$ -mgs -mpic \${MACROFILE} - \\ @ 3.1 log @Adapt for current environment @ text @d9 1 a9 1 # $Id: makebookmakefile,v 3.0 1995/06/26 08:08:39 grog Exp grog $ d12 3 d59 1 a59 1 echo >>book.make ' ' groff -r\$\$\$\$ -mgs -mpic \${MACROFILE} - \\ d61 1 a61 1 echo >>book.make ' '@@-egrep -v ^\'Chapter\|File\|\>\<\' Toc/$base d77 1 a77 1 echo >>book.make ' ' groff -r\$\$\$\$ -mgs -mpic \${MACROFILE} - \\ d98 1 a98 1 echo >>book.make ' ' egrep -v ^\'Chapter\|File\|\>\<\' Toc/\$\$title\; \\ @ 3.0 log @Final draft @ text @d9 1 a9 1 # $Id: makebookmakefile,v 1.10 1995/06/24 12:44:00 grog Exp grog $ d12 3 d54 1 a54 1 echo >>book.make ' ' @@\(echo \".FILE $base.ms\"\; echo \".af PN i\"\; gsoelim $base.ms\) \| \\ d72 1 a72 1 echo >>book.make ' ' \(echo \".FILE \$\$title.ms\"\; echo \".pn \$\$page\"\; gsoelim \$\$title.ms\) \| \\ @ 1.11 log @Minor mods @ text @d105 1 a105 1 echo >> book.make all: ' ' Chapter Toc Chapter/$1 @ 1.10 log @Minor mods @ text @d9 1 a9 1 # $Id: makebookmakefile,v 1.9 1995/06/12 03:24:06 grog Exp grog $ d12 3 d105 1 a105 1 echo >> book.make all: ' ' Chapter/$1 Chapter Toc @ 1.9 log @Mods to get xrefs right on ruby @ text @d9 1 a9 1 # $Id: makebookmakefile,v 1.8 1995/06/09 11:20:43 grog Exp grog $ d12 3 d47 1 a47 1 echo >>book.make ' ' echo +++ Formatting $base to Chapter/00-$base.ps d103 1 a103 1 echo >> book.make ' ' rm Book.Toc @ 1.8 log @Minor mods @ text @d9 1 a9 1 # $Id: makebookmakefile,v 1.7 1995/06/09 04:29:45 grog Exp grog $ d12 3 d40 1 a40 1 base=`basename $1 .ps` d100 2 a101 1 tocs=`echo $parms | sed 's@ 1.7 log @Minor mods Print out error messages @ text @d9 1 a9 1 # $Id: makebookmakefile,v 1.6 1995/05/22 06:52:29 grog Exp grog $ d12 4 d46 1 a46 1 echo >>book.make ' ' egrep -v ^\'Chapter\|File\|\>\<\' Toc/$base\; \\ @ 1.6 log @Add dependencies on directories Chapter and Toc to 'all' target. @ text @d9 1 a9 1 # $Id: makebookmakefile,v 1.5 1995/01/30 11:48:24 grog Exp grog $ d12 3 d42 2 a43 1 echo >>book.make ' 'echo 1 '>' Toc/$base.firstafter d79 1 @ 1.5 log @Minor mods @ text @d9 1 a9 1 # $Id: makebookmakefile,v 1.4 1995/01/26 12:30:05 grog Exp grog $ d12 3 d87 1 a87 1 echo >> book.make all: ' ' Chapter/$1 @ 1.4 log @Minor mods @ text @d9 1 a9 1 # $Id: makebookmakefile,v 1.3 1995/01/26 11:43:23 grog Exp grog $ d12 3 d52 1 a52 1 echo >>book.make ' ' \>$realtarget 2\>Toc/\$\$title\; \\ d54 1 d58 1 a58 1 echo >>book.make ' ' page=\`awk \< Toc/\$\$title \'/Chapter/ {pageno = \$\$6}\; END {print pageno}\'\`\; \\ @ 1.3 log @Incorporate .ms.ps rule for each .ps target @ text @d9 1 a9 1 # $Id: makebook.make,v 1.1 1995/01/25 13:39:09 grog Exp grog $ d11 4 a14 1 # $Log: makebook.make,v $ d25 2 a26 1 echo >>book.make Chapter/$1: ' Xref' $base.ms d34 1 a34 1 echo >>book.make ' '@@rm -f \$@@\; ln Chapter/00-$base.ps \$@@ d39 1 d41 1 a41 1 echo >> book.make Chapter/$2: ' ' Toc/$base.firstpage $base.ms d43 1 a43 1 echo >>book.make ' ' @@title=\`basename \$@@ .ps\`\; \\ d49 1 a49 1 echo >>book.make ' ' \>\$@@ 2\>Toc/\$\$title\; \\ d69 1 a69 1 echo >>book.make ' ' ln \$@@ \$\$filename\; \\ @ 1.2 log @Minor mods @ text @d23 1 d37 32 d70 1 @ 1.1 log @Initial revision @ text @d1 5 a5 1 # Format the complete book with the bignuts macros d9 5 a13 1 # $Id$ a14 1 # $Log$ d18 13 a30 7 echo >bookmakefile "# Makefile generated automatically by $0 on `date`" echo >>bookmakefile '# Do not edit this file' echo >>bookmakefile echo >>bookmakefile $1:: ' Xref' `basename $1 .ps`.ms echo >>bookmakefile ' 'echo 1 '>' Toc/`basename $1 .ps`.firstafter echo >>bookmakefile ' 'rm -f \$@@\; ln Chapter/00-preface.ps \$@@ echo >>bookmakefile d35 4 a38 4 echo >> bookmakefile $2: ' ' Toc/$base.firstpage $base.ms echo >> bookmakefile Toc/$base.firstpage: ' ' $1 echo >>bookmakefile ' ' @@rm -f Toc/$base.firstpage\; ln Toc/$base1.firstafter Toc/$base.firstpage echo >>bookmakefile d41 1 a41 1 echo >> bookmakefile all: ' ' $1 d43 1 a43 1 echo >> bookmakefile ' ' \(cd Toc \; cat $tocs \>../Book.Toc\) @