xref: /netbsd/usr.bin/genassym/genassym.1 (revision 6550d01e)
1.\"	$NetBSD: genassym.1,v 1.5 2010/04/13 09:01:10 jruoho Exp $
2.\"
3.\" Copyright (c) 1997 Matthias Pfaller.
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25.\"
26.Dd April 13, 2010
27.Dt GENASSYM 1
28.Os
29.Sh NAME
30.Nm genassym
31.Nd emit an assym.h file
32.Sh SYNOPSIS
33.Nm genassym
34.Op Fl c
35.Op Fl f
36.Ar C compiler invocation
37.Sh DESCRIPTION
38.Nm
39is a shell script normally used during the kernel build process to
40create an assym.h file.
41This file defines a number of cpp constants derived from the configuration
42information
43.Nm
44reads from stdin. The generated file is used by kernel sources
45written in assembler to gain access to information (e.g. structure
46offsets and sizes) normally only known to the C compiler.
47.Pp
48Arguments to
49.Nm
50are usually of the form
51.Ar ${CC} ${CFLAGS} ${CPPFLAGS}
52where
53.Ar ${CC}
54is the C compiler used to compile the kernel, while
55.Ar ${CFLAGS}
56and
57.Ar ${CPPFLAGS}
58are flag arguments to the C compiler. The script creates a C source file
59from its input. Then the C compiler is called according to the script's
60arguments to compile this file.
61.Pp
62Normally
63.Nm
64instructs the C compiler to create an assembler source from the constructed
65C source. The resulting file is then processed to extract the information
66needed to create the assym.h file. The
67.Fl c
68flag instructs
69.Nm
70to create slightly different code, generate an executable from this code
71and run it. In both cases the assym.h file is written to stdout.
72The
73.Fl f
74flag instructs
75.Nm
76to create forth code.
77.Sh DIAGNOSTICS
78Either self-explanatory, or generated by one of the programs
79called from the script.
80.Sh SEE ALSO
81.Xr genassym.cf 5
82.Sh HISTORY
83The
84.Nm
85command appeared in
86.Nx 1.3
87as
88.Dq genassym.sh
89in
90.Pa /usr/src/sys/kern .
91It became a userland utility in
92.Nx 4.0 .
93