man pages: Split out the common preamble and insert it at build time.
[sod] / src / sod.1.in
CommitLineData
9ed8eb2a
MW
1.\" -*-nroff-*-
2.\"
3.\" The Sod translator
4.\"
5.\" (c) 2015 Straylight/Edgeware
6.\"
7.
8.\"----- Licensing notice ---------------------------------------------------
9.\"
e0808c47 10.\" This file is part of the Sensible Object Design, an object system for C.
9ed8eb2a
MW
11.\"
12.\" SOD is free software; you can redistribute it and/or modify
13.\" it under the terms of the GNU General Public License as published by
14.\" the Free Software Foundation; either version 2 of the License, or
15.\" (at your option) any later version.
16.\"
17.\" SOD is distributed in the hope that it will be useful,
18.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
19.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20.\" GNU General Public License for more details.
21.\"
22.\" You should have received a copy of the GNU General Public License
23.\" along with SOD; if not, write to the Free Software Foundation,
24.\" Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25.
6bed6ea3
MW
26.\"--------------------------------------------------------------------------
27.so ../common/defs.man \" @@@PRE@@@
9ed8eb2a
MW
28.
29.\"--------------------------------------------------------------------------
30.TH sod 1 "11 October 2015" "Straylight/Edgeware" "Sensible Object Design"
31.
32.SH NAME
33sod \- Sensible Object Design translator
34.
35.\"--------------------------------------------------------------------------
36.SH SYNOPSIS
37.B sod
38.RB [ \-p ]
39.RB [ \-\-builtins ]
40.RB [ \-d
41.IR dir ]
42.RB [ \-I
43.IR dir ]
44.RB [ \-t
45.IR out-type ]
46.IR sources ...
47.
48.\"--------------------------------------------------------------------------
49.SH DESCRIPTION
50.
51The
52.B sod
53program reads input files describing Sod modules,
54containing class definitions and other items,
55and generates output files,
56such as C source and header files.
57.
58.SS Command line
59The following command-line options are recognized.
60.TP
61.B "\-h, \-\-help"
62Write command-line help text to standard output,
63and exit successfully.
64.TP
65.B "\-V, \-\-version"
66Write Sod's version number to standard output,
67and exit successfully.
68.TP
69.B "\-u, \-\-usage"
70Write a brief usage message to standard output,
71and exit successfully.
72.TP
ba8bae5f
MW
73.B "\-\-backtrace"
74Generate a Lisp stack backtrace if an error is encountered.
75This is useful when debugging,
76if
77.B sod
78reports unusual errors, or
79is complaining unjustifiably about something.
80.TP
9ed8eb2a
MW
81.B "\-\-builtins"
82Generate output for to the built-in module,
83which defines the root classes
84.B SodObject
85and
86.BR SodClass .
87For the purpose of naming output files,
88the built-in module is named
89.BR sod-base .
90.TP
91.BI "\-I, \-\-include=" dir
92Look for imported modules and extension files in directory
93.IR dir .
94This option may be repeated:
95directories are searched in the order they were named.
96.TP
97.BI "\-d, \-\-directory=" dir
98Write output files to directory
99.IR dir ,
100instead of the current directory.
101.TP
102.B "\-p, \-\-stdout"
103Write output to standard output,
104instead of to files.
105.TP
106.BI "\-t, \-\-type=" out-type
107Produce output of type
108.IR out-type .
109Output types can be defined by extensions.
110The built-in output types are described below.
111.PP
112Each
113.I source
114file named on the command-line
115is read and parsed as a Sod module:
116see
117.BR sod-module (5)
118for the built-in syntax.
119An output file is written for each module read,
120and the built-in module if the
121.B \-\-builtins
122option was given,
123and for each output type requested using the
124.B \-t
125option.
126At least one output type must be provided.
127.
128.SS Output types
129If a module is read from a file named
130.IB name . ext
131where
132.I ext
133doesn't contain a dot
134.RB (` . '),
135or if the file has a simple
136.I name
137which doesn't contain a dot
138(except possibly an initial one),
139then the module's name is
140.IR name .
141It is conventional for module files to be named
142.IB name .sod \fR.
143Output file names are determined by the module name,
144the output type,
145and the output directory
146.I dir
147specified by the
148.B \-d
149option.
150.PP
151The following output types are defined.
152.TP
153.B c
154Write C source,
155suitable for standalone compilation,
156defining the necessary direct and effective method functions
157and static tables
158for the classes defined in the module.
159The output file is named
160.IB dir / name .c \fR.
161.TP
162.B h
163Write a C header file,
164suitable for inclusion using
165.BR #include ,
166declaring the necessary data structures and functions
167for the classes defined in the module.
168The output file is named
169.IB dir / name .h \fR.
170.
171.\"--------------------------------------------------------------------------
172.SH SEE ALSO
173.BR sod (3),
174.BR sod-structs (3),
175.BR sod-module (5).
176.
177.\"--------------------------------------------------------------------------
178.SH AUTHOR
179Mark Wooding, <mdw@distorted.org.uk>
180.
181.\"----- That's all, folks --------------------------------------------------