/* * fhist - file history and comparison tools * Copyright (C) 1998, 2001, 2004 Peter Miller; * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * * MANIFEST: how to cook documents */ source_files = [source_files] etc/version.so [fromto lib/%1/readme/main.%2 lib/%1/readme/new.so [match_mask lib/%1/readme/main.%2 [source_files]] ] [fromto lib/%1/reference/main.%2 lib/%1/reference/ref-index.so [match_mask lib/%1/reference/main.%2 [source_files]] ] [fromto lib/%1/reference/main.%2 lib/%1/reference/ref-parts.so [match_mask lib/%1/reference/main.%2 [source_files]] ]; etc/version.so: set ['if' [or [not [defined baseline] ] [not [exists bl/etc/version.so ] ] ] 'then' shallow] { echo \".ds V) [version]\" > [target]; echo \".ds v) [version_short]\" >> etc/version.so; aegis -list version -p [project] -c [change] | gawk -F'\'"\'' "'/previous/{print $2}'" | gawk -F. "'{print \".ds w) \"$1\".\"$2}'" >> [target]; echo \".ds Y) [copyright_years]\" >> [target]; } lib/%/readme/new.so: : etc/so.sh [match_mask lib/%/readme/new.%%.so [source_files]] set ['if' [not [defined baseline]] 'then' shallow] { sh [resolve etc/so.sh] -r [fromto lib/%/readme/new.%%.so new.%%.so [match_mask lib/%/readme/new.%%.so [source_files]] ] > [target]; } /* Sigh. Must be before the next recipe, and before the generic .d's. */ cascade lib/en/reference/main.man = lib/en/reference/ref-index.so lib/en/reference/ref-parts.so; lib/%/reference/ref-index.so: [match_mask lib/%/man%%1/%%2.%%1 [source_files]] etc/ptx1.awk etc/ptx.ignore etc/ptx2.awk set no-cascade { [awk] -f [resolve etc/ptx1.awk] [resolve [match_mask lib/%/man%%1/%%2.%%1 [source_files]]] | ptx -O -r -w1000 -i[resolve etc/ptx.ignore] | sort -t'\'"\'' -f -d +5 -6 +3 -4 | [awk] -F'\'"\'' -f [resolve etc/ptx2.awk] > [target]; } lib/%/reference/ref-parts.so: [match_mask lib/%/man%%1/%%2.%%1 [source_files]] etc/ptx.sh set no-cascade { sh -f [resolve etc/ptx.sh] [match_mask lib/%/man%%1/%%2.%%1 [source_files]] > [target]; } /* * formatting documents and manual entries */ doc.targets: cat special; /* * manual entries */ cat = [fromto lib/%3/man%1/%2.%1 lib/%3/cat%1/%2.%1 [match_mask lib/%3/man%1/%2.%1 [source_files]] ]; cat: [cat]; lib/%3/cat%1/%2.%1: lib/%3/man%1/%2.%1 set mkdir unlink { roffpp [sort [prepost "-I" "/etc" [search_list]] [prepost "-I" "/lib/%3/man%1" [search_list]] ] [resolve lib/%3/man%1/%2.%1] | groff -Tascii -P-ch -t -man > [target]; } lib/%3/man%1/%2.%1.d: lib/%3/man%1/%2.%1 set nocascade { c_incl -nc -ns -eia -r -nrec [sort [stringset [cc_include_flags] [prepost "-I" "/etc" [search_list]] [prepost "-I" "/lib/%3/man%1" [search_list]] ] ] -prefix "'cascade lib/%3/man%1/%2.%1 ='" -suffix "';'" [resolve lib/%3/man%1/%2.%1] [prepost "-rlp=" "" [search_list]] -o [target]; } %0%.so.d: %0%.so set nocascade { c_incl -nc -ns -eia -r -nrec [sort [stringset [cc_include_flags] [prepost "-I" "/etc" [search_list]] [prepost "-I" /[dirname %0%.so] [search_list]] ] ] -prefix "'cascade %0%.so ='" -suffix "';'" [resolve %0%.so] [prepost "-rlp=" "" [search_list]] -o [target]; } man-dep-files = [addsuffix .d [match_mask lib/%3/man%1/%2.%1 [source_files]]] [addsuffix .d [match_mask %0%.so [source_files]]] ; #include-cooked-nowarn [man-dep-files] /* * specials */ special = [fromto lib/%1/%2/main.man lib/%1/%2.pdf [match_mask lib/%1/%2/main.man [source_files]] ]; special: [special]; lib/%1/%2.pdf: lib/%1/%2/main.man { roffpp [sort [stringset [cc_include_flags] [prepost "-I" /etc [search_list]] [prepost "-I" /lib/%1/%2 [search_list]] [prepost "-I" /lib/%1/man1 [search_list]] [prepost "-I" /lib/%1/readme [search_list]] ] ] [resolve lib/%1/%2/main.man] > lib/%1/%2.groff; groff -t -p -man lib/%1/%2.groff > lib/%1/%2.ps; rm lib/%1/%2.groff set silent; ps2pdf lib/%1/%2.ps [target]; rm lib/%1/%2.ps set silent; } lib/%1/%2.txt: lib/%1/%2/main.man { roffpp [sort [stringset [cc_include_flags] [prepost "-I" /etc [search_list]] [prepost "-I" /lib/%1/%2 [search_list]] [prepost "-I" /lib/%1/man1 [search_list]] [prepost "-I" /lib/%1/readme [search_list]] ] ] [resolve lib/%1/%2/main.man] > lib/%1/%2.groff; groff -Tascii -P-bchu -t -p -man lib/%1/%2.groff > [target]; rm lib/%1/%2.groff set silent; } lib/%1/%2/main.man.d: lib/%1/%2/main.man set nocascade { c_incl -nc -ns -eia -r -nrec [sort [stringset [cc_include_flags] [prepost "-I" /etc [search_list]] [prepost "-I" /lib/%1/%2 [search_list]] [prepost "-I" /lib/%1/man1 [search_list]] [prepost "-I" /lib/%1/readme [search_list]] ] ] -prefix "'cascade lib/%1/%2/main.man ='" -suffix "';'" [resolve lib/%1/%2/main.man] [prepost "-rlp=" "" [search_list]] -o [target]; } etc-dep-files = [addsuffix .d [match_mask %0%.man [source_files]]] ; #include-cooked-nowarn [etc-dep-files] README: lib/en/readme.txt etc/ssp.awk { awk -f [resolve etc/ssp.awk lib/en/readme.txt] > [target]; } BUILDING: lib/en/building.txt { cp [resolve [need]] [target]; } etc/%.txt: etc/%.man etc/ssp.awk { roffpp [prepost "-I" /etc [search_list]] [resolve etc/%.man] > etc/%.groff; groff -Tascii -P-bcu -t -p -man etc/%.groff | awk -f [resolve etc/ssp.awk] > [target]; rm etc/%.groff set silent; } etc/%.man.d: etc/%.man set nocascade { c_incl -nc -ns -eia -r -nrec [prepost "-I" "/etc" [search_list]] -prefix "'cascade etc/%.man ='" -suffix "';'" [resolve etc/%.man] [prepost "-rlp=" "" [search_list]] -o [target]; } all += etc/release.txt; /* * Catch 22: you need to build these includes, in order to discover that * you need to build these includes. Sigh. */ cascade lib/en/man1/z_cr.so = etc/version.so; cascade lib/en/readme/main.man = lib/en/readme/new.so; cascade etc/release.man = etc/version.so;