Blame


1 058b0118 2005-01-03 devnull .TH 9C 1
2 058b0118 2005-01-03 devnull .SH NAME
3 058b0118 2005-01-03 devnull 9c, 9a, 9l, 9ar \- C compiler, assembler, linker, archiver
4 058b0118 2005-01-03 devnull .SH SYNOPSIS
5 058b0118 2005-01-03 devnull .B 9c
6 c8b6342d 2005-01-13 devnull [
7 c8b6342d 2005-01-13 devnull .B -I
8 c8b6342d 2005-01-13 devnull .I path
9 c8b6342d 2005-01-13 devnull ]
10 c8b6342d 2005-01-13 devnull [
11 c8b6342d 2005-01-13 devnull .B -D
12 c8b6342d 2005-01-13 devnull .I name
13 c8b6342d 2005-01-13 devnull ]
14 058b0118 2005-01-03 devnull .I file
15 058b0118 2005-01-03 devnull \&...
16 058b0118 2005-01-03 devnull .PP
17 058b0118 2005-01-03 devnull .B 9a
18 058b0118 2005-01-03 devnull .I file
19 058b0118 2005-01-03 devnull \&...
20 058b0118 2005-01-03 devnull .PP
21 058b0118 2005-01-03 devnull .B 9l
22 058b0118 2005-01-03 devnull [
23 058b0118 2005-01-03 devnull .I -o
24 058b0118 2005-01-03 devnull .I target
25 058b0118 2005-01-03 devnull ]
26 058b0118 2005-01-03 devnull .I object
27 058b0118 2005-01-03 devnull \&...
28 058b0118 2005-01-03 devnull [
29 058b0118 2005-01-03 devnull .I library
30 058b0118 2005-01-03 devnull \&...
31 058b0118 2005-01-03 devnull ]
32 058b0118 2005-01-03 devnull [
33 058b0118 2005-01-03 devnull .BI -L path
34 058b0118 2005-01-03 devnull \&...
35 058b0118 2005-01-03 devnull ]
36 058b0118 2005-01-03 devnull [
37 c8b6342d 2005-01-13 devnull .BI -l name
38 058b0118 2005-01-03 devnull \&...
39 058b0118 2005-01-03 devnull ]
40 058b0118 2005-01-03 devnull .PP
41 058b0118 2005-01-03 devnull .B 9ar
42 058b0118 2005-01-03 devnull .I key
43 058b0118 2005-01-03 devnull [
44 058b0118 2005-01-03 devnull .I posname
45 058b0118 2005-01-03 devnull ]
46 058b0118 2005-01-03 devnull .I afile
47 058b0118 2005-01-03 devnull [
48 058b0118 2005-01-03 devnull .I file
49 058b0118 2005-01-03 devnull \&...
50 058b0118 2005-01-03 devnull ]
51 058b0118 2005-01-03 devnull .SH DESCRIPTION
52 058b0118 2005-01-03 devnull These programs are shell scripts that invoke the appropriate standard tools
53 058b0118 2005-01-03 devnull for the current operating system and architecture.
54 058b0118 2005-01-03 devnull One can use them to write portable recipes for mkfiles.
55 058b0118 2005-01-03 devnull .PP
56 058b0118 2005-01-03 devnull .I 9c
57 058b0118 2005-01-03 devnull compiles the named C
58 058b0118 2005-01-03 devnull .I files
59 058b0118 2005-01-03 devnull into object files for the current system.
60 c8b6342d 2005-01-13 devnull The system C compiler is invoked with warnings enabled.
61 c8b6342d 2005-01-13 devnull The
62 c8b6342d 2005-01-13 devnull .B -I
63 c8b6342d 2005-01-13 devnull option adds
64 c8b6342d 2005-01-13 devnull .I path
65 c8b6342d 2005-01-13 devnull to the include path,
66 c8b6342d 2005-01-13 devnull and the
67 c8b6342d 2005-01-13 devnull .B -D
68 c8b6342d 2005-01-13 devnull option defines
69 c8b6342d 2005-01-13 devnull .I name
70 c8b6342d 2005-01-13 devnull in the C preprocessor.
71 c8b6342d 2005-01-13 devnull .I 9c
72 c8b6342d 2005-01-13 devnull always
73 c8b6342d 2005-01-13 devnull defines the symbol
74 058b0118 2005-01-03 devnull .B PLAN9PORT
75 c8b6342d 2005-01-13 devnull defined in the C preprocessor and adds
76 058b0118 2005-01-03 devnull .B $PLAN9/include
77 c8b6342d 2005-01-13 devnull to the include path.
78 058b0118 2005-01-03 devnull .PP
79 058b0118 2005-01-03 devnull .I 9c
80 058b0118 2005-01-03 devnull also defines
81 058b0118 2005-01-03 devnull .B __sun__
82 cb8f7357 2020-01-20 rsc on SunOS systems.
83 058b0118 2005-01-03 devnull .PP
84 058b0118 2005-01-03 devnull .I 9a
85 058b0118 2005-01-03 devnull assembles the named files into object files for the current system.
86 058b0118 2005-01-03 devnull Unlike some system assemblers, it does
87 058b0118 2005-01-03 devnull .I not
88 058b0118 2005-01-03 devnull promise to run the C preprocessor on the source files.
89 058b0118 2005-01-03 devnull .PP
90 058b0118 2005-01-03 devnull .I 9l
91 058b0118 2005-01-03 devnull links the named object files and libraries to create the target executable.
92 058b0118 2005-01-03 devnull Each
93 058b0118 2005-01-03 devnull .B -l
94 058b0118 2005-01-03 devnull option specifies that a library named
95 c8b6342d 2005-01-13 devnull .BI lib name .a
96 058b0118 2005-01-03 devnull be found and linked.
97 058b0118 2005-01-03 devnull The
98 058b0118 2005-01-03 devnull .B -L
99 058b0118 2005-01-03 devnull option adds directories to the library search path.
100 058b0118 2005-01-03 devnull .I 9l
101 058b0118 2005-01-03 devnull invokes the system linker with
102 058b0118 2005-01-03 devnull .B $PLAN9/lib
103 058b0118 2005-01-03 devnull already on the library search path.
104 058b0118 2005-01-03 devnull .PP
105 c8b6342d 2005-01-13 devnull .I 9l
106 c8b6342d 2005-01-13 devnull searches the named objects and libraries for symbols of the form
107 c8b6342d 2005-01-13 devnull .BI __p9l_autolib_ name \fR,
108 c8b6342d 2005-01-13 devnull which it takes as indication that it should link
109 c8b6342d 2005-01-13 devnull .BI $PLAN9/lib/lib name .a
110 c8b6342d 2005-01-13 devnull as well.
111 c8b6342d 2005-01-13 devnull It also examines such libraries to find their own dependencies.
112 c8b6342d 2005-01-13 devnull A single
113 c8b6342d 2005-01-13 devnull .B -l
114 c8b6342d 2005-01-13 devnull option at the beginning of the command line disables this behavior.
115 c8b6342d 2005-01-13 devnull The symbol
116 c8b6342d 2005-01-13 devnull .BI __p9l_autolib_ name
117 c8b6342d 2005-01-13 devnull is added to an object file by the macro
118 c8b6342d 2005-01-13 devnull .B AUTOLIB( name )\fR,
119 c8b6342d 2005-01-13 devnull defined in
120 c8b6342d 2005-01-13 devnull .B <u.h>.
121 c8b6342d 2005-01-13 devnull Header files associated with libraries contain
122 c8b6342d 2005-01-13 devnull .B AUTOLIB
123 c8b6342d 2005-01-13 devnull annotations; ordinary programs need not use them.
124 c8b6342d 2005-01-13 devnull Due to shortcomings in the implementation, a source file may not
125 c8b6342d 2005-01-13 devnull contain the same
126 c8b6342d 2005-01-13 devnull .B AUTOLIB
127 c8b6342d 2005-01-13 devnull statement multiple times.
128 c8b6342d 2005-01-13 devnull .PP
129 058b0118 2005-01-03 devnull .I 9ar
130 058b0118 2005-01-03 devnull maintains object file archives called libraries.
131 058b0118 2005-01-03 devnull The exact set of valid command keys varies from system to system,
132 058b0118 2005-01-03 devnull but
133 058b0118 2005-01-03 devnull .I 9ar
134 058b0118 2005-01-03 devnull always provides the following key characters:
135 058b0118 2005-01-03 devnull .TP
136 058b0118 2005-01-03 devnull .B d
137 cb8f7357 2020-01-20 rsc Delete
138 cb8f7357 2020-01-20 rsc .I files
139 058b0118 2005-01-03 devnull from the archive file.
140 058b0118 2005-01-03 devnull .TP
141 058b0118 2005-01-03 devnull .B r
142 058b0118 2005-01-03 devnull Replace
143 cb8f7357 2020-01-20 rsc .I files
144 058b0118 2005-01-03 devnull in the archive file, or add them if missing.
145 058b0118 2005-01-03 devnull .TP
146 058b0118 2005-01-03 devnull .B t
147 058b0118 2005-01-03 devnull List a table of contents of the archive.
148 058b0118 2005-01-03 devnull If names are given, only those files are listed.
149 058b0118 2005-01-03 devnull .TP
150 058b0118 2005-01-03 devnull .B x
151 058b0118 2005-01-03 devnull Extract the named files.
152 058b0118 2005-01-03 devnull If no names are given, all files in the archive are
153 058b0118 2005-01-03 devnull extracted.
154 058b0118 2005-01-03 devnull In neither case does
155 058b0118 2005-01-03 devnull .B x
156 058b0118 2005-01-03 devnull alter the archive file.
157 058b0118 2005-01-03 devnull .TP
158 058b0118 2005-01-03 devnull .B v
159 058b0118 2005-01-03 devnull Verbose.
160 058b0118 2005-01-03 devnull Give a file-by-file
161 058b0118 2005-01-03 devnull description of the making of a
162 058b0118 2005-01-03 devnull new archive file from the old archive and the constituent files.
163 058b0118 2005-01-03 devnull With
164 058b0118 2005-01-03 devnull .BR t ,
165 058b0118 2005-01-03 devnull give a long listing of all information about the files,
166 058b0118 2005-01-03 devnull somewhat like a listing by
167 058b0118 2005-01-03 devnull .IR ls (1),
168 058b0118 2005-01-03 devnull showing
169 058b0118 2005-01-03 devnull .br
170 058b0118 2005-01-03 devnull .ns
171 058b0118 2005-01-03 devnull .IP
172 058b0118 2005-01-03 devnull .B
173 058b0118 2005-01-03 devnull mode uid/gid size date name
174 058b0118 2005-01-03 devnull .TP
175 058b0118 2005-01-03 devnull .B c
176 058b0118 2005-01-03 devnull Create.
177 058b0118 2005-01-03 devnull Normally
178 058b0118 2005-01-03 devnull .I 9ar
179 058b0118 2005-01-03 devnull will create a new archive when
180 058b0118 2005-01-03 devnull .I afile
181 058b0118 2005-01-03 devnull does not exist, and give a warning.
182 cb8f7357 2020-01-20 rsc Option
183 058b0118 2005-01-03 devnull .B c
184 058b0118 2005-01-03 devnull discards any old contents and suppresses the warning.
185 058b0118 2005-01-03 devnull .PD
186 058b0118 2005-01-03 devnull .PP
187 058b0118 2005-01-03 devnull When a
188 058b0118 2005-01-03 devnull .BR d ,
189 058b0118 2005-01-03 devnull .BR r ,
190 058b0118 2005-01-03 devnull or
191 058b0118 2005-01-03 devnull .BR m
192 058b0118 2005-01-03 devnull .I key
193 058b0118 2005-01-03 devnull is specified,
194 058b0118 2005-01-03 devnull .I 9ar
195 058b0118 2005-01-03 devnull inserts a table of contents, required by the linker, at
196 058b0118 2005-01-03 devnull the front of the library.
197 058b0118 2005-01-03 devnull The table of contents is
198 058b0118 2005-01-03 devnull rebuilt whenever the archive is modified.
199 c8b6342d 2005-01-13 devnull .SH EXAMPLES
200 058b0118 2005-01-03 devnull .TP
201 058b0118 2005-01-03 devnull .L
202 058b0118 2005-01-03 devnull 9c file1.c file2.c file3.c
203 058b0118 2005-01-03 devnull Compile three C source files.
204 058b0118 2005-01-03 devnull .TP
205 058b0118 2005-01-03 devnull .L
206 058b0118 2005-01-03 devnull 9a file4.s
207 058b0118 2005-01-03 devnull Assemble one assembler source file.
208 058b0118 2005-01-03 devnull .TP
209 058b0118 2005-01-03 devnull .L
210 058b0118 2005-01-03 devnull 9ar rvc lib.a file[12].o
211 058b0118 2005-01-03 devnull Archive the first two object files into a library.
212 c8b6342d 2005-01-13 devnull .TP
213 058b0118 2005-01-03 devnull .L
214 058b0118 2005-01-03 devnull 9l -o prog file3.o file4.o lib.a
215 058b0118 2005-01-03 devnull Link the final two object files and any necessary objects from the library
216 058b0118 2005-01-03 devnull into an executable.
217 058b0118 2005-01-03 devnull .SH SOURCE
218 c3674de4 2005-01-11 devnull .B \*9/bin