head 3.5; access; symbols; locks; strict; comment @# @; 3.5 date 99.08.24.23.26.08; author grog; state Exp; branches; next 3.4; 3.4 date 99.08.24.08.27.18; author grog; state Exp; branches; next 3.3; 3.3 date 95.06.27.11.15.56; author grog; state Exp; branches; next 3.2; 3.2 date 95.06.26.11.52.23; author grog; state Exp; branches; next 3.1; 3.1 date 95.06.26.08.38.38; author grog; state Exp; branches; next 3.0; 3.0 date 95.06.26.08.09.55; author grog; state Exp; branches; next 2.18; 2.18 date 95.06.25.12.40.26; author grog; state Exp; branches; next 2.17; 2.17 date 95.06.12.03.30.46; author grog; state Exp; branches; next 2.16; 2.16 date 95.06.12.03.24.15; author grog; state Exp; branches; next 2.15; 2.15 date 95.06.09.02.08.28; author grog; state Exp; branches; next 2.14; 2.14 date 95.05.22.06.17.10; author grog; state Exp; branches; next 2.13; 2.13 date 95.03.16.10.47.04; author grog; state Exp; branches; next 2.12; 2.12 date 95.02.28.12.06.20; author grog; state Exp; branches; next 2.11; 2.11 date 95.02.16.10.44.50; author grog; state Exp; branches; next 2.10; 2.10 date 95.02.04.17.55.07; author grog; state Exp; branches; next 2.9; 2.9 date 95.02.04.14.51.56; author grog; state Exp; branches; next 2.8; 2.8 date 95.01.26.15.24.17; author grog; state Exp; branches; next 2.7; 2.7 date 95.01.26.11.43.23; author grog; state Exp; branches; next 2.6; 2.6 date 95.01.26.11.03.57; author grog; state Exp; branches; next 2.5; 2.5 date 95.01.25.13.45.32; author grog; state Exp; branches; next 2.4; 2.4 date 95.01.25.13.39.25; author grog; state Exp; branches; next 2.3; 2.3 date 95.01.23.09.33.33; author grog; state Exp; branches; next 2.2; 2.2 date 95.01.23.08.16.47; author grog; state Exp; branches; next 2.1; 2.1 date 95.01.09.13.30.32; author grog; state Exp; branches; next 2.0; 2.0 date 95.01.09.13.22.08; author grog; state Exp; branches; next ; desc @@ 3.5 log @Do a silent Xref compare. Add foo target for testing. @ text @# Makefile for porting book # Greg Lehey, LEMIS # # $Id: Makefile,v 3.4 1999/08/24 08:27:18 grog Exp grog $ # # $Log: Makefile,v $ # Revision 3.4 1999/08/24 08:27:18 grog # Adapt for current environment # # Revision 3.3 1995/06/27 11:15:56 grog # Minor mods # # Revision 3.1 1995/06/26 08:38:38 grog # Minor mods (target clean) # # Revision 3.0 1995/06/26 08:09:55 grog # Final draft # # Revision 2.17 1995/06/12 03:30:46 grog # Force bash as shell # # Revision 2.16 1995/06/12 03:24:15 grog # Mods to get xrefs right on ruby # # Revision 2.15 1995/06/09 02:08:28 grog # Minor mods # # Revision 2.14 1995/05/22 06:17:10 grog # Major mods after Andy's review # # Revision 2.13 1995/03/16 10:47:04 grog # Minor mods # SHELL = /bin/bash # get site-specific paths include paths.make PREFACE = preface.ms PART1 = intro.ms unpacking.ms care-and-feeding.ms config.ms \ building.ms compiling.ms documentation.ms testing.ms install.ms epilogue.ms PART2 = part2.ms hdepend.ms kdepend.ms signals.ms filesys.ms \ terminal.ms time.ms headers.ms library.ms make.ms compiler.ms obj.ms APPENDICES = typesref.ms compflags.ms asflags.ms \ ldflags.ms appsource.ms bibliography.ms # The sources for all chapters SOURCES = ${PREFACE} ${PART1} ${PART2} ${APPENDICES} # All files to be maintained by RCS # This version includes files which currently don't get used. # ALL-SOURCES = ${SOURCES} global.ms totidy mkindex Makefile \ # tidycontents.el tidyindex.el chapters.ms makebookmakefile fxref ALL-SOURCES = ${SOURCES} global.ms Makefile makebookmakefile # PostScript for the chapters CHAPTERS = ${SOURCES:.ms=.ps} # The distribution files, for testing dist = porting-UNIX-software # The default target, all, is in book.make. The ${SOURCES} is to ensure that the # files stay checked out of RCS for all three makes. default: ${SOURCES} Chapter Toc make all make Xref.new make all make toc.ms index.ms include book.make book.make: Makefile makebookmakefile ./makebookmakefile ${SOURCES:.ms=.ps} .SUFFIXES: .ms .ps .psl .PS .txt Xref: if [ ! -f $@@ ]; then touch $@@; fi .FORCE: Xref.new: .FORCE # Now rebuild the Xrefs @@echo >Xref.new "\.\\\" Cross-references generated by $$0 `date`" @@cat Book.Toc|sed 's/>>Xref.new @@cat Book.Toc|sed 's/>/tmp/double-defines @@if [ -s /tmp/double-defines ]; then \ echo "*** Doubly defined references:"; \ ref=`xargs tmp-Xref.new tail +2 Xref >tmp-Xref.old -cmp tmp-Xref.old tmp-Xref.new; \ if [ $$? -ne 0 ]; then \ echo "++++ Xrefs have changed - need to repeat format"; \ mv Xref.new Xref; \ else \ echo +++ Xref files unchanged; \ fi rm tmp-Xref* book WholeBook.ps: default (echo ".pn 1"; for i in ${PART1} ${PART2} ${APPENDICES}; do \ echo ".FILE $$i"; echo ".ds RH \"\""; ${SOELIM} $$i; done; \ echo ".FILE preface.ms"; echo ".pn 1"; ${SOELIM} ${PREFACE}) | \ sed -f ${CLEANUP} | ${PIC} | ${TBL} | \ groff -r$$$$ -mgs -mpic ${MACROFILE} - \ >Chapter/$@@ 2>Toc/WholeBook egrep -v ^'Chapter|File|><' Toc/WholeBook book.txt: (echo ".pn 1"; for i in ${PART1} ${PART2} ${APPENDICES}; do \ echo ".FILE $$i"; echo ".ds RH \"\""; ${SOELIM} $$i; done; \ echo ".FILE preface.ms"; echo ".pn 1"; ${SOELIM} ${PREFACE}) | \ sed -f ${CLEANUP} | ${PIC} | ${TBL} | \ nroff -r$$$$ -mgs -mpic ${MACROFILE} - \ >Chapter/$@@ 2>Toc/WholeBook egrep -v ^'Chapter|File|><' Toc/WholeBook .ms.txt: echo ".pn 1"; echo ".ds RH \"\""; ${SOELIM} $< | \ sed -f ${CLEANUP} | ${PIC} | ${TBL} | \ nroff -r$$$$ -mgs -mpic ${MACROFILE} - \ >Chapter/$@@ 2>Toc/WholeBook sed < Chapter/$@@ > Chapter/`basename $@@ .txt`.ascii 's:.::g' egrep -v ^'Chapter|File|><' Toc/WholeBook toc.ms index.ms: .FORCE cd fmt/$*; cat ${SOURCES} > ../../$*.ms mkindex: tidycontents.el tidyindex.el chapters.ms # ${CHAPTERS}: global.ms .SUFFIXES: .ms .ps .psl .PS clean: rm -f *.toc *.ps *~ core core.* *.even *.odd Contents Index Xref make.log *.PS rm -rf *.Toc Chapter *.log Toc book.make book.tar.gz fmt rm -f Xref* tmp* bookmakefile paths.make realclean: clean rm -f ${ALL-SOURCES} makebookmakefile totidy # Check in with current date. ci: ci -d ${ALL-SOURCES} totidy ci2: ci -d -k2.0 ${ALL-SOURCES} totidy # Yes, make checks out automatically, but it doesn't use the -M option, so # it will remake even if it's not needed. co: -co -l -M -q ${ALL-SOURCES} totidy archive book.tar.gz: tar cf - ${ALL-SOURCES} ${SOURCES:.ms=.ps} | gzip >book.tar.gz srcarchive booksrc.tar.gz: (cd ${dist}; make clean) tar cfh - ${dist} | gzip >book.tar.gz incdiffs diffs: ${SOURCES} .FORCE rm -rf $@@ mkdir $@@ for i in ${SOURCES:.ms=}; do \ if [ "$@@" = "diffs" ]; then \ rcsdiff -r3.0 -uw $$i.ms 2>/dev/null >$@@/$$i; \ else \ rcsdiff -uw $$i.ms 2>/dev/null >$@@/$$i; \ fi; \ if [ ! -s $@@/$$i ]; then \ rm -f $@@/$$i; \ fi \ done # ${ALL-SOURCES}: # -co -M -q $@@ ${SOURCES}: global.ms paths.make: @@if [ -f paths.make.orig ]; then \ echo ; \ echo ++++++ This source tree doesn\'t contain a paths.make.; \ echo ++++++ This probably means that you have forgotten to; \ echo ++++++ configure it. I am creating one from the file; \ echo ++++++ paths.make.orig, but you will probably not be; \ echo ++++++ happy unless you edit it. See the file INSTALL; \ echo ++++++ for further confusing information.; \ echo ; \ cp paths.make.orig paths.make; \ else \ echo +++ Checking out paths.make; \ co -M -q paths.make; \ fi Chapter Toc fmt/exlist fmt/figlist fmt/index fmt/tablist fmt/toc: mkdir -p $@@ foo: echo ".pn 1"; echo ".ds RH \"\""; ${SOELIM} filesys.ms | \ sed -f ${CLEANUP} | ${PIC} | ${TBL} | \ nroff -r$$$$ -mgs -mpic ${MACROFILE} - \ >Chapter/$@@ 2>Toc/WholeBook sed < Chapter/$@@ > Chapter/`basename $@@ .txt`.ascii 's:.::g' egrep -v ^'Chapter|File|><' Toc/WholeBook @ 3.4 log @Adapt for current environment @ text @d4 1 a4 1 # $Id: Makefile,v 3.3 1995/06/27 11:15:56 grog Exp grog $ d7 3 d102 1 a102 1 cmp tmp-Xref.old tmp-Xref.new; \ d211 8 @ 3.3 log @Minor mods @ text @d4 1 a4 1 # $Id: Makefile,v 3.1 1995/06/26 08:38:38 grog Exp grog $ d7 3 d77 1 a77 1 .SUFFIXES: .ms .ps .psl .PS d110 2 a111 2 echo ".FILE $$i"; echo ".ds RH \"\""; gsoelim $$i; done; \ echo ".FILE preface.ms"; echo ".pn 1"; gsoelim ${PREFACE}) | \ d115 17 @ 3.2 log @Minor mods @ text @d150 15 @ 3.1 log @Minor mods (target clean) @ text @d4 1 a4 1 # $Id: Makefile,v 3.0 1995/06/26 08:09:55 grog Exp grog $ d7 3 d67 1 d113 3 @ 3.0 log @Final draft @ text @d4 1 a4 1 # $Id: Makefile,v 2.17 1995/06/12 03:30:46 grog Exp grog $ d7 3 d117 2 a118 2 rm -f *.toc *.ps *~ core core.* *.even *.odd Contents Index Xref fmt make.log *.PS rm -rf *.Toc Chapter *.log Toc book.make book.tar.gz @ 2.18 log @Final draft, second cut @ text @d98 1 a98 1 book WholeBook.ps: all d161 2 a162 2 Chapter Toc: mkdir $@@ @ 2.17 log @Force bash as shell @ text @d4 1 a4 1 # $Id: Makefile,v 2.16 1995/06/12 03:24:15 grog Exp $ d7 3 d114 3 a116 3 rm -f *.toc *.ps *~ core core.* *.even *.odd Contents Index Xref make.log *.PS rm -rf Contents.* Index.* *.Toc Chapter *.log Toc book.make book.tar.gz rm -f Xref* tmp* bookmakefile paths.make @ 2.16 log @Mods to get xrefs right on ruby @ text @d4 1 a4 1 # $Id: Makefile,v 2.15 1995/06/09 02:08:28 grog Exp grog $ d7 3 d19 2 @ 2.15 log @Minor mods @ text @d4 1 a4 1 # $Id: Makefile,v 2.14 1995/05/22 06:17:10 grog Exp grog $ d7 3 d69 2 a70 2 @@grep PAGENO Book.Toc|sed 's/>>Xref.new @@grep PAGENO Book.Toc|sed 's/>/tmp/double-defines d79 3 a81 3 @@tail +2 Xref.new >tmp-Xref.new @@tail +2 Xref >tmp-Xref.old @@cmp tmp-Xref.old tmp-Xref.new; \ @ 2.14 log @Major mods after Andy's review @ text @d4 1 a4 1 # $Id: Makefile,v 2.13 1995/03/16 10:47:04 grog Exp grog $ d7 3 d87 1 a87 1 WholeBook.ps: all d93 2 a94 1 >Chapter/$@@ 2>Toc/WholeBook; \ @ 2.13 log @Minor mods @ text @d4 1 a4 1 # $Id: Makefile,v 2.12 1995/02/28 12:06:20 grog Exp grog $ d7 3 d43 1 a43 3 default: ${SOURCES} if [ ! -d Chapter ]; then mkdir Chapter; fi if [ ! -d Toc ]; then mkdir Toc; fi d84 1 a84 1 WholeBook.ps: d144 4 a147 1 fi@ 2.12 log @Minor mods @ text @d4 1 a4 1 # $Id: Makefile,v 2.11 1995/02/16 10:44:50 grog Exp grog $ a6 30 # Revision 2.11 1995/02/16 10:44:50 grog # Mods for making archives, paths.make # # Revision 2.10 1995/02/04 17:55:07 grog # Minor mods # # Revision 2.9 1995/02/04 14:51:56 grog # Minor mods # # Revision 2.8 1995/01/26 15:24:17 grog # Minor mods # # Revision 2.7 1995/01/26 11:43:23 grog # Remove .ms.ps target (moved to book.make) # # Revision 2.6 1995/01/26 11:03:57 grog # Rewrite for paths.make and book.make # # Revision 2.4 1995/01/25 13:39:25 grog # Mods to rebuild correct version of book # # Revision 2.3 1995/01/23 09:33:33 grog # Minor mods # # Revision 2.2 1995/01/23 08:16:47 grog # Minor mods # # Revision 2.1 1995/01/09 13:30:32 grog # Reworked for shortened book format # d82 9 @ 2.11 log @Mods for making archives, paths.make @ text @d4 1 a4 1 # $Id: Makefile,v 2.10 1995/02/04 17:55:07 grog Exp grog $ d7 3 d80 1 a80 1 makebookmakefile ${SOURCES:.ms=.ps} d102 2 a103 2 @@tail -n +2 Xref.new >tmp-Xref.new @@tail -n +2 Xref >tmp-Xref.old @ 2.10 log @Minor mods @ text @d4 1 a4 1 # $Id: Makefile,v 2.9 1995/02/04 14:51:56 grog Exp grog $ d7 3 d57 1 a57 1 ALL-SOURCES = ${SOURCES} global.ms totidy Makefile makebookmakefile d62 4 a65 1 # The default target, all, is in bookmakefile. The ${SOURCES} is to ensure that the a103 2 echo Old and new Xref files:; \ ls -l tmp-Xref.new tmp-Xref.old; \ d108 1 d117 2 a118 2 rm -f Contents.* Index.* *.Toc Chapter/* *.log Toc/* rm -f Xref* tmp* makebookmakefile bookmakefile d121 1 a121 1 rm -f ${ALL-SOURCES} d125 1 a125 1 ci -d ${ALL-SOURCES} d128 1 a128 1 ci -d -k2.0 ${ALL-SOURCES} d133 1 a133 1 -co -l -M -q ${ALL-SOURCES} d139 2 a140 1 tar cf - ${ALL-SOURCES} | gzip >book.tar.gz d146 16 @ 2.9 log @Minor mods @ text @d4 1 a4 1 # $Id: Makefile,v 2.8 1995/01/26 15:24:17 grog Exp grog $ d7 3 d51 4 a54 2 ALL-SOURCES = ${SOURCES} global.ms totidy mkindex doformat Makefile \ tidycontents.el tidyindex.el chapters.ms makebookmakefile fxref d132 3 @ 2.8 log @Minor mods @ text @d4 1 a4 1 # $Id: Makefile,v 2.7 1995/01/26 11:43:23 grog Exp grog $ d7 3 d34 1 a34 1 PART1 = intro.ms case-study-intro.ms unpacking.ms care-and-feeding.ms config.ms \ d38 1 a38 1 terminal.ms headers.ms time.ms library.ms make.ms compiler.ms obj.ms d41 1 a41 1 ldflags.ms bibliography.ms @ 2.7 log @Remove .ms.ps target (moved to book.make) @ text @d4 1 a4 1 # $Id: Makefile,v 2.6 1995/01/26 11:03:57 grog Exp grog $ d7 3 d53 4 a56 1 default: ${SOURCES} all d75 1 a75 1 grep PAGENO Book.Toc|sed 's/>>Xref.new a86 2 @@echo Old and new Xref files: @@ls -l tmp-Xref.new tmp-Xref.old d90 2 d93 2 @ 2.6 log @Rewrite for paths.make and book.make @ text @d4 1 a4 1 # $Id: Makefile,v 2.4 1995/01/25 13:39:25 grog Exp grog $ d7 3 a60 32 .ms.ps:: @@title=`basename $@@ .ps`; \ read < Toc/$$title.firstpage page; \ echo -n "+++ Chapter $$title starts on page $$page "; \ (echo ".FILE $$title.ms"; echo ".pn $$page"; gsoelim $$title.ms) | \ sed -f ${CLEANUP} | ${PIC} | ${TBL} | \ groff -r$$$$ -mgs -mpic ${MACROFILE} - \ >$@@ 2>Toc/$$title; \ exitcode=$$?; \ chapter=`awk < Toc/$$title '/Chapter/ {chapter = $$2}; END {print chapter}'`; \ chapter=`basename $$chapter ,`; \ startpage=$$page; \ page=`awk < Toc/$$title '/Chapter/ {pageno = $$6}; END {print pageno}'`; \ if [ $$chapter -lt 10 ]; then \ filename=Chapter/0$$chapter-$$title.ps; \ else \ filename=Chapter/$$chapter-$$title.ps; \ fi; \ echo -n "and ends on page $$page "; \ page=`expr $$page + 1`; \ echo \(`expr $$page - $$startpage` pages\): $$filename; \ if [ `expr $$page % 2 ` -eq 0 ]; then \ echo " (Last page is blank)"; \ page=`expr $$page + 1`; \ fi; \ echo $$page > Toc/$$title.firstafter; \ rm -f Chapter/$$filename; \ ln $@@ Chapter/$$filename; \ if [ $$exitcode -ne 0 ]; then \ echo "*** Exit code $$exitcode - format aborted"; \ fi; \ d62 1 @ 2.5 log @Minor mods @ text @d20 2 a22 6 TBL = tbl PIC = pic TROFF = groff # Macro extension name for the O'Reilly Nutshell ms macros MACRO = O d26 1 a26 1 building.ms compiling.ms documentation.ms testing.ms install.ms a30 2 PART3 = epilogue.ms d32 1 a32 1 ldflags.ms glossary.ms bibliography.ms d36 1 a36 1 SOURCES = ${PREFACE} ${PART1} ${PART2} ${PART3} ${APPENDICES} d40 1 a40 1 tidycontents.el tidyindex.el chapters.ms makebookmakefile fxlist d45 5 a49 1 include bookmakefile d51 3 a53 1 bookmakefile: Makefile makebookmakefile a55 9 # The default target: if any target is out of date, first remake Xref (which removes all output files), # then make all. ### book: Xref ### make all ### @@echo Total: `grep %%Pages *.ps|sed 's/:/ /g; s/%%Pages//'|awk '{print $$2}'|add` pages ### ### Book: ${ALL-SOURCES} ### time doformat ${SOURCES} | tee format.log d63 2 a64 2 sed -f /opt/bin/gcleanup.sed | /opt/bin/gpic | /opt/bin/gtbl | \ groff -r$$$$ -mgs -mpic /opt/lib/groff/tmac/tmac.Gbignuts.G - \ d84 2 a85 2 rm -f $$filename; \ ln $@@ $$filename; \ d92 3 a94 1 Xref.new: d96 1 a96 2 if [ ! -f Xref -o ! -f Book.toc ]; then touch Xref; exit 0; fi # just create if we don't have any content echo >Xref.new "\.\\\" Cross-references generated by $$0 `date`" d98 2 a99 3 ls -l Xref.new grep PAGENO Book.Toc|sed 's/>/tmp/double-defines if [ -s /tmp/double-defines ]; then \ d107 5 a111 4 tail -n +2 Xref.new >tmp-Xref.new tail -n +2 Xref.old >tmp-Xref.old ls -l tmp-Xref.new tmp-Xref.old cmp tmp-Xref.old tmp-Xref.new; \ a116 44 preface.ps:: Xref echo +++ Formatting Preface to Chapter/00-preface.ps @@(echo ".FILE preface.ms"; echo ".af PN i"; gsoelim preface.ms) | \ sed -f /opt/bin/gcleanup.sed | /opt/bin/gpic | /opt/bin/gtbl | \ groff -r$$$$ -mgs -mpic /opt/lib/groff/tmac/tmac.Gbignuts.G - \ >Chapter/00-preface.ps 2>Toc/preface ### buch: ${ALL-SOURCES} ### make all Xref.new all ### ### time doformat.new ${SOURCES:.ms=.ps} | tee format.log ### ### # all: remake any out-of-date targets, but accept an out-of-date Xref ### all: ${CHAPTERS} mkindex ### mkindex ### ### # Create Xref file. Since a change in this file requires us to reformat *everything*, ### # only keep the new file if it differs from the old one. ### Xref: ${CHAPTERS} ${SOURCES:.ms=.toc} ### if [ -f Xref ]; then \ ### mv Xref Xref.old; \ ### else \ ### touch Xref.old; \ ### fi ### mkindex ### @@tail -n +2 Xref >tmp-Xref.new ### @@tail -n +2 Xref.old >tmp-Xref.old ### @@echo +++ Comparing new cross-reference list ### @@(ls -l tmp-Xref.new tmp-Xref.old; \ ### cmp tmp-Xref.new tmp-Xref.old; \ ### if [ $$? -eq 0 ]; then \ ### echo +++ Cross-reference list unchanged; \ ### mv Xref.old Xref; \ ### else \ ### echo +++ Cross-reference list changed - must rebuild package; \ ### rm Xref.old; \ ### /usr/bin/touch -t 7001010000 ${CHAPTERS} ${CHAPTERS:.ps=.toc}; \ ### fi) ### rm tmp-Xref.new tmp-Xref.old ### ### xref: ${CHAPTERS} mkindex ### mkindex a121 16 ### # PostScript output with small Nutshell macros ### .ms.ps: ### ${PIC} $< | ${TBL} | ${TROFF} -Tps -rv8 -rz6 -rW4i -m${MACRO} >temp-ps 2>$*.toc ### mv temp-ps $*.ps ### @@-grep -v "><" $*.toc || exit 0 ### @@-grep %%Pages $*.ps |awk '{print $$2 " pages"}' ### ### # PostScript output with big Nutshell macros ### .ms.PS: ### -(echo ".FILE $<"; echo ".pn 1"; gsoelim $<) | sed -f /opt/bin/gcleanup.sed | /opt/bin/gpic | /opt/bin/gtbl | \ ### groff -r$$$$ -mgs -mpic /opt/lib/groff/tmac/tmac.Gbignuts.G - \ ### >temp-ps 2>$*.Toc ### mv temp-ps $*.PS ### @@-grep -v "><" $*.Toc || exit 0 ### @@-grep %%Pages $*.PS |awk '{print $$2 " pages"}' d145 4 a148 2 ${ALL-SOURCES}: co -M -q $@@@ 2.4 log @Mods to rebuild correct version of book @ text @d4 1 a4 1 # $Id: Makefile,v 2.3 1995/01/23 09:33:33 grog Exp grog $ d7 3 d46 1 a46 1 tidycontents.el tidyindex.el chapters.ms makebookmakefile d192 5 a196 1 rm -f Contents.* Index.* *.Toc Chapter/* *.log @ 2.3 log @Minor mods @ text @d4 1 a4 1 # $Id: Makefile,v 2.2 1995/01/23 08:16:47 grog Exp grog $ d7 3 d27 1 a27 1 building.ms documentation.ms testing.ms install.ms d42 2 a43 1 ALL-SOURCES = ${SOURCES} global.ms totidy mkindex doformat Makefile tidycontents.el tidyindex.el chapters.ms d48 5 d55 24 a78 16 book: Xref make all @@echo Total: `grep %%Pages *.ps|sed 's/:/ /g; s/%%Pages//'|awk '{print $$2}'|add` pages Book: ${ALL-SOURCES} time doformat ${SOURCES} | tee format.log # all: remake any out-of-date targets, but accept an out-of-date Xref all: ${CHAPTERS} mkindex mkindex # Create Xref file. Since a change in this file requires us to reformat *everything*, # only keep the new file if it differs from the old one. Xref: ${CHAPTERS} ${SOURCES:.ms=.toc} if [ -f Xref ]; then \ mv Xref Xref.old; \ d80 40 a119 1 touch Xref.old; \ a120 15 mkindex @@tail -n +2 Xref >tmp-Xref.new @@tail -n +2 Xref.old >tmp-Xref.old @@echo +++ Comparing new cross-reference list @@(ls -l tmp-Xref.new tmp-Xref.old; \ cmp tmp-Xref.new tmp-Xref.old; \ if [ $$? -eq 0 ]; then \ echo +++ Cross-reference list unchanged; \ mv Xref.old Xref; \ else \ echo +++ Cross-reference list changed - must rebuild package; \ rm Xref.old; \ /usr/bin/touch -t 7001010000 ${CHAPTERS} ${CHAPTERS:.ps=.toc}; \ fi) rm tmp-Xref.new tmp-Xref.old d122 43 a164 2 xref: ${CHAPTERS} mkindex mkindex d167 1 a167 1 ${CHAPTERS}: global.ms d171 15 a185 15 # PostScript output with small Nutshell macros .ms.ps: ${PIC} $< | ${TBL} | ${TROFF} -Tps -rv8 -rz6 -rW4i -m${MACRO} >temp-ps 2>$*.toc mv temp-ps $*.ps @@-grep -v "><" $*.toc || exit 0 @@-grep %%Pages $*.ps |awk '{print $$2 " pages"}' # PostScript output with big Nutshell macros .ms.PS: -(echo ".FILE $<"; echo ".pn 1"; gsoelim $<) | sed -f /opt/bin/gcleanup.sed | /opt/bin/gpic | /opt/bin/gtbl | \ groff -r$$$$ -mgs -mpic /opt/lib/groff/tmac/tmac.Gbignuts.G - \ >temp-ps 2>$*.Toc mv temp-ps $*.PS @@-grep -v "><" $*.Toc || exit 0 @@-grep %%Pages $*.PS |awk '{print $$2 " pages"}' a204 1 @ 2.2 log @Minor mods @ text @d4 1 a4 1 # $Id: Makefile,v 2.1 1995/01/09 13:30:32 grog Exp grog $ d7 3 d24 1 a24 1 make.ms compiler.ms documentation.ms testing.ms install.ms d27 1 a27 1 terminal.ms headers.ms time.ms library.ms obj.ms @ 2.1 log @Reworked for shortened book format @ text @d4 1 a4 1 # $Id: Makefile,v 1.28 1994/12/23 16:30:16 grog Exp grog $ d7 3 d20 2 a21 1 PART1 = intro.ms case-study-intro.ms care-and-feeding.ms d24 1 a24 1 ipc.ms terminal.ms headers.ms time.ms library.ms d26 1 a26 2 PART3 = part3.ms config.ms make.ms compiler.ms obj.ms \ documentation.ms testing.ms install.ms epilogue.ms d95 1 a95 1 -(echo ".FILE $<"; echo ".pn 123"; gsoelim $<) | sed -f /opt/bin/gcleanup.sed | /opt/bin/gpic | /opt/bin/gtbl | \ d100 1 a100 1 @@-grep %%Pages $*.ps |awk '{print $$2 " pages"}' @ 2.0 log @checked in with -k by grog at 1995/01/09 13:22:41 @ text @d7 2 a8 50 # Revision 1.28 1994/12/23 16:30:16 grog # Minor mods, add target to build complete bignuts book # # Revision 1.27 1994/12/19 09:39:31 grog # minor mods # # Revision 1.26 1994/12/13 17:09:19 grog # Minor mods # # Revision 1.24 1994/11/25 15:44:35 grog # Minor mods # # Revision 1.23 1994/11/20 16:04:36 grog # Minor mods # # Revision 1.22 1994/11/09 14:33:14 grog # Minor mods # # Revision 1.21 1994/09/04 17:32:13 grog # Minor mods # # Revision 1.20 1994/08/25 17:13:13 grog # Minor mods: change source file names to .ms, change .ms.ps rule # to show any error messages. # # Revision 1.7 1994/08/06 11:16:23 grog # Mods for chapter restructuring # # Revision 1.6 1994/08/04 13:55:41 grog # Minor changes # # Revision 1.5 1994/07/31 13:29:56 grog # Add variable MACRO to point to the correct macros for groff to use # # Revision 1.4 1994/07/13 16:53:31 grog # minor mods # # Revision 1.3 1994/05/11 17:54:01 grog # Fix clean target # # Revision 1.2 1994/05/11 17:53:16 grog # Remove original targets, add proper all: and clean: targets # # Revision 1.1 1994/05/11 17:49:53 grog # Initial revision # CFLAGS=-g LFLAGS=-g CC=gcc d17 1 a17 2 PART1 = intro.ms part1.ms getting-sources.ms archive-media.ms \ unpacking.ms care-and-feeding.ms d20 1 a20 2 terminal.ms headers.ms time.ms library.ms # ipc.ms terminal.ms headers.ms time.ms library.ms d22 1 a22 2 # PART3 = part3.ms config.ms imake.ms make.ms tools.ms compiler.ms obj.ms PART3 = part3.ms config.ms imake.ms make.ms compiler.ms obj.ms \ d25 2 a26 1 CASE-STUDIES = case-study-news.ps # case-study-make-3.68.ps a27 4 # APPENDICES = toolsref.ms typesref.ms compflags.ms asflags.ms APPENDICES = typesref.ms compflags.ms asflags.ms \ ldflags.ms x11ref.ms appcdrom.ms glossary.ms \ bibliography.ms # funcref.ms d29 2 a30 1 SOURCES = ${PREFACE} ${PART1} ${PART2} ${PART3} ${PART4} d32 2 a33 2 CHAPTER-SOURCES = ${SOURCES} case-study-news.ms ${APPENDICES} ALL-SOURCES = ${CHAPTER-SOURCES} global.ms totidy mkindex doformat Makefile tidycontents.el tidyindex.el chapters.ms d35 2 a36 1 CHAPTERS = ${CHAPTER-SOURCES:.ms=.ps} d45 1 a45 1 time doformat ${CHAPTER-SOURCES} | tee format.log d53 1 a53 1 Xref: ${CHAPTERS} ${CHAPTER-SOURCES:.ms=.toc} d116 1 a116 1 tar cf - ${ALL-SOURCES} ${CHAPTER-SOURCES:.ms=.ps} | gzip >book.tar.gz @