1/*
2 * NAME
3 *      text - process text
4 *
5 * DESCRIPTION
6 *      This cookbook is used to process text documents.
7 *
8 *      Include file dependencies are automatically detected.
9 *      The requirements for various preprocessors are automatically detected
10 *      (eg eqn, tbl, pic, graf).
11 *
12 * RECIPES
13 *      %.ps: %.t       PostScript for generic *roff source
14 *      %: %.t          straight text from *roff source
15 *
16 * VARIABLES
17 *      text_incl       The text_incl command (finds include dependencies).
18 *                      Not altered if already set.
19 *      text_roff       The text_roff command (finds preprocessor needs).
20 *                      Not altered if already set.
21 *      roff_flags      Arguments passed to text_roff,
22 *                      and indirectly to the *roff program.
23 *                      Not altered if already set.
24 *                      Defaults to empty.
25 * Copyright (C) 2007 Peter Miller
26 */
27
28#pragma once
29
30if [not [defined c_incl]] then
31        c_incl = [find_command c_incl];
32if [not [defined text_roff]] then
33        text_roff = groff -Tascii;
34if [not [defined ps_roff]] then
35        text_roff = groff;
36if [not [defined roff_flags]] then
37        roff_flags = ;
38
39%.ps: %.t
40{
41        [ps_roff] -e [roff_flags] %.t > %.ps;
42}
43
44%.doc: %.t
45{
46        [text_roff] -n [roff_flags] %.t > %.doc;
47}
48
49#if [c_incl]
50
51%.t.d: %.t
52{
53        [c_incl] -r -ns -nc -nrec
54                [addprefix "-I" [search_list]]
55                --prefix\="'cascade %.t ='"
56                --suffix\="';'"
57                [resolve %.t]
58                -o [target];
59}
60
61%.so.d: %.so
62{
63        [c_incl] -r -ns -nc -nrec
64                [addprefix "-I" [search_list]]
65                --prefix\="'cascade %.so ='"
66                --suffix\="';'"
67                [resolve %.so]
68                -o [target];
69}
70
71#include-cooked [addprefix ".d" [glob "*.t" "*.so"]]
72
73#endif
74