1 .\" $NetBSD: genassym.1,v 1.5 2010/04/13 09:01:10 jruoho Exp $
3 .\" Copyright (c) 1997 Matthias Pfaller.
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
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.
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.
31 .Nd emit an assym.h file
36 .Ar C compiler invocation
39 is a shell script normally used during the kernel build process to
40 create an assym.h file.
41 This file defines a number of cpp constants derived from the configuration
44 reads from stdin. The generated file is used by kernel sources
45 written in assembler to gain access to information (e.g. structure
46 offsets and sizes) normally only known to the C compiler.
50 are usually of the form
51 .Ar ${CC} ${CFLAGS} ${CPPFLAGS}
54 is the C compiler used to compile the kernel, while
58 are flag arguments to the C compiler. The script creates a C source file
59 from its input. Then the C compiler is called according to the script's
60 arguments to compile this file.
64 instructs the C compiler to create an assembler source from the constructed
65 C source. The resulting file is then processed to extract the information
66 needed to create the assym.h file. The
70 to create slightly different code, generate an executable from this code
71 and run it. In both cases the assym.h file is written to stdout.
78 Either self-explanatory, or generated by one of the programs
79 called from the script.
90 .Pa /usr/src/sys/kern .
91 It became a userland utility in