Sun Oct 5 20:17:16 2008 UTC ()
Document TOOL_SED, which has been defined in bsd.sys.mk for more than
two years.


(apb)
diff -r1.227 -r1.228 src/share/mk/bsd.README

cvs diff -r1.227 -r1.228 src/share/mk/bsd.README (switch to unified diff)

--- src/share/mk/bsd.README 2008/10/02 17:54:53 1.227
+++ src/share/mk/bsd.README 2008/10/05 20:17:16 1.228
@@ -1,1557 +1,1559 @@ @@ -1,1557 +1,1559 @@
1# $NetBSD: bsd.README,v 1.227 2008/10/02 17:54:53 joerg Exp $ 1# $NetBSD: bsd.README,v 1.228 2008/10/05 20:17:16 apb Exp $
2# @(#)bsd.README 8.2 (Berkeley) 4/2/94 2# @(#)bsd.README 8.2 (Berkeley) 4/2/94
3 3
4This is the README file for the make "include" files for the NetBSD 4This is the README file for the make "include" files for the NetBSD
5source tree. The files are installed in /usr/share/mk, and are, 5source tree. The files are installed in /usr/share/mk, and are,
6by convention, named with the suffix ".mk". 6by convention, named with the suffix ".mk".
7 7
8Note, this file is not intended to replace reading through the .mk 8Note, this file is not intended to replace reading through the .mk
9files for anything tricky. 9files for anything tricky.
10 10
11=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 11=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
12 12
13RANDOM THINGS WORTH KNOWING: 13RANDOM THINGS WORTH KNOWING:
14 14
15The files are simply C-style #include files, and pretty much behave like 15The files are simply C-style #include files, and pretty much behave like
16you'd expect. The syntax is slightly different in that a single '.' is 16you'd expect. The syntax is slightly different in that a single '.' is
17used instead of the hash mark, i.e. ".include <bsd.prog.mk>". 17used instead of the hash mark, i.e. ".include <bsd.prog.mk>".
18 18
19One difference that will save you lots of debugging time is that inclusion 19One difference that will save you lots of debugging time is that inclusion
20of the file is normally done at the *end* of the Makefile. The reason for 20of the file is normally done at the *end* of the Makefile. The reason for
21this is because .mk files often modify variables and behavior based on the 21this is because .mk files often modify variables and behavior based on the
22values of variables set in the Makefile. To make this work, remember that 22values of variables set in the Makefile. To make this work, remember that
23the FIRST target found is the target that is used, i.e. if the Makefile has: 23the FIRST target found is the target that is used, i.e. if the Makefile has:
24 24
25 a: 25 a:
26 echo a 26 echo a
27 a: 27 a:
28 echo a number two 28 echo a number two
29 29
30the command "make a" will echo "a". To make things confusing, the SECOND 30the command "make a" will echo "a". To make things confusing, the SECOND
31variable assignment is the overriding one, i.e. if the Makefile has: 31variable assignment is the overriding one, i.e. if the Makefile has:
32 32
33 a= foo 33 a= foo
34 a= bar 34 a= bar
35 35
36 b: 36 b:
37 echo ${a} 37 echo ${a}
38 38
39the command "make b" will echo "bar". This is for compatibility with the 39the command "make b" will echo "bar". This is for compatibility with the
40way the V7 make behaved. 40way the V7 make behaved.
41 41
42It's fairly difficult to make the BSD .mk files work when you're building 42It's fairly difficult to make the BSD .mk files work when you're building
43multiple programs in a single directory. It's a lot easier to split up the 43multiple programs in a single directory. It's a lot easier to split up the
44programs than to deal with the problem. Most of the agony comes from making 44programs than to deal with the problem. Most of the agony comes from making
45the "obj" directory stuff work right, not because we switched to a new version 45the "obj" directory stuff work right, not because we switched to a new version
46of make. So, don't get mad at us, figure out a better way to handle multiple 46of make. So, don't get mad at us, figure out a better way to handle multiple
47architectures so we can quit using the symbolic link stuff. (Imake doesn't 47architectures so we can quit using the symbolic link stuff. (Imake doesn't
48count.) 48count.)
49 49
50The file .depend in the source directory is expected to contain dependencies 50The file .depend in the source directory is expected to contain dependencies
51for the source files. This file is read automatically by make after reading 51for the source files. This file is read automatically by make after reading
52the Makefile. 52the Makefile.
53 53
54The variable DESTDIR works as before. It's not set anywhere but will change 54The variable DESTDIR works as before. It's not set anywhere but will change
55the tree where the file gets installed. 55the tree where the file gets installed.
56 56
57The profiled libraries are no longer built in a different directory than 57The profiled libraries are no longer built in a different directory than
58the regular libraries. A new suffix, ".po", is used to denote a profiled 58the regular libraries. A new suffix, ".po", is used to denote a profiled
59object, and ".so" denotes a shared (position-independent) object. 59object, and ".so" denotes a shared (position-independent) object.
60 60
61There are various make variables used during the build. 61There are various make variables used during the build.
62 62
63Many variables support a (case sensitive) value of "no" or "yes", 63Many variables support a (case sensitive) value of "no" or "yes",
64and are tested with ${VAR} == "no" and ${VAR} != "no" . 64and are tested with ${VAR} == "no" and ${VAR} != "no" .
65 65
66 66
67The basic rule for the variable naming scheme is as follows: 67The basic rule for the variable naming scheme is as follows:
68 68
69MKxxx Can be set to "no" to disable functionality, or 69MKxxx Can be set to "no" to disable functionality, or
70 "yes" to enable it. 70 "yes" to enable it.
71 Usually defaults to "yes", although some variables 71 Usually defaults to "yes", although some variables
72 default to "no". 72 default to "no".
73 Due to make(1) implementation issues, if a temporary 73 Due to make(1) implementation issues, if a temporary
74 command-line override of a mk.conf(5) or <bsd.own.mk> 74 command-line override of a mk.conf(5) or <bsd.own.mk>
75 setting is required whilst still honoring a particular 75 setting is required whilst still honoring a particular
76 Makefile's setting of MKxxx, use 76 Makefile's setting of MKxxx, use
77 env MKxxx=value make 77 env MKxxx=value make
78 instead of 78 instead of
79 make MKxxx=value 79 make MKxxx=value
80 80
81NOxxx If defined, disables a feature. 81NOxxx If defined, disables a feature.
82 Not intended for users. 82 Not intended for users.
83 This is to allow Makefiles to disable functionality 83 This is to allow Makefiles to disable functionality
84 that they don't support (such as missing man pages). 84 that they don't support (such as missing man pages).
85 NOxxx variables must be defined before <bsd.own.mk> 85 NOxxx variables must be defined before <bsd.own.mk>
86 is included. 86 is included.
87 87
88The following variables that control how things are made/installed that 88The following variables that control how things are made/installed that
89are not set by default. These should not be set by Makefiles; they're for 89are not set by default. These should not be set by Makefiles; they're for
90the user to define in MAKECONF (see <bsd.own.mk>, below, or mk.conf(5)) 90the user to define in MAKECONF (see <bsd.own.mk>, below, or mk.conf(5))
91or on the make(1) command line: 91or on the make(1) command line:
92 92
93BUILD If defined, 'make install' checks that the targets in the 93BUILD If defined, 'make install' checks that the targets in the
94 source directories are up-to-date and remakes them if they 94 source directories are up-to-date and remakes them if they
95 are out of date, instead of blindly trying to install 95 are out of date, instead of blindly trying to install
96 out of date or non-existent targets. 96 out of date or non-existent targets.
97 97
98MAKEVERBOSE Control how "verbose" the standard make(1) rules are. 98MAKEVERBOSE Control how "verbose" the standard make(1) rules are.
99 Default: 2 99 Default: 2
100 Supported values: 100 Supported values:
101 0 Minimal output ("quiet") 101 0 Minimal output ("quiet")
102 1 Describe what is occurring 102 1 Describe what is occurring
103 2 Describe what is occurring and echo the actual command 103 2 Describe what is occurring and echo the actual command
104 104
105 105
106MKATF If "no", don't build libatf-c, libatf-c++ libraries associated 106MKATF If "no", don't build libatf-c, libatf-c++ libraries associated
107 with the Automated Testing Framework (ATF). 107 with the Automated Testing Framework (ATF).
108 Default: yes 108 Default: yes
109 109
110MKBFD If "no", don't build libbfd, libiberty, or any of the things 110MKBFD If "no", don't build libbfd, libiberty, or any of the things
111 that depend on them (binutils/gas/ld, gdb, dbsym, mdsetimage). 111 that depend on them (binutils/gas/ld, gdb, dbsym, mdsetimage).
112 Default: yes 112 Default: yes
113 113
114MKCATPAGES If "no", don't build or install the catman pages. 114MKCATPAGES If "no", don't build or install the catman pages.
115 Default: yes 115 Default: yes
116 116
117MKCOMPLEX If "no", don't build libm support for <complex.h> 117MKCOMPLEX If "no", don't build libm support for <complex.h>
118 Default: yes 118 Default: yes
119 119
120MKCRYPTO If "no", no cryptography support will be built into the system, 120MKCRYPTO If "no", no cryptography support will be built into the system,
121 and also acts as "MKKERBEROS=no". 121 and also acts as "MKKERBEROS=no".
122 Default: yes 122 Default: yes
123 123
124MKCRYPTO_IDEA If not "no", IDEA support will be built into libcrypto_idea.a. 124MKCRYPTO_IDEA If not "no", IDEA support will be built into libcrypto_idea.a.
125 Default: no 125 Default: no
126 126
127MKCRYPTO_MDC2 If not "no", MDC2 support will be built into libcrypto_mdc2.a 127MKCRYPTO_MDC2 If not "no", MDC2 support will be built into libcrypto_mdc2.a
128 Default: no 128 Default: no
129 129
130MKCRYPTO_RC5 If not "no", RC5 support will be built into libcrypto_rc5.a. 130MKCRYPTO_RC5 If not "no", RC5 support will be built into libcrypto_rc5.a.
131 Default: no 131 Default: no
132 132
133MKCVS If "no", don't build or install cvs(1). 133MKCVS If "no", don't build or install cvs(1).
134 Default: yes 134 Default: yes
135 135
136MKDEBUG If "no", don't build and install separate debugging symbols 136MKDEBUG If "no", don't build and install separate debugging symbols
137 into /usr/libdata/debug. 137 into /usr/libdata/debug.
138 Default: no 138 Default: no
139 139
140MKDEBUGLIB Build *_g.a debugging libraries, which are compiled 140MKDEBUGLIB Build *_g.a debugging libraries, which are compiled
141 with -DDEBUG. 141 with -DDEBUG.
142 Default: no 142 Default: no
143 143
144MKDOC If "no", don't build or install the documentation. 144MKDOC If "no", don't build or install the documentation.
145 Default: yes 145 Default: yes
146 146
147MKDYNAMICROOT If "no", build programs in /bin and /sbin statically, 147MKDYNAMICROOT If "no", build programs in /bin and /sbin statically,
148 don't install certain libraries in /lib, and don't 148 don't install certain libraries in /lib, and don't
149 install the shared linker into /libexec. 149 install the shared linker into /libexec.
150 Default: yes 150 Default: yes
151 151
152MKGCC If "no", don't build gcc(1) or any of the GCC-related 152MKGCC If "no", don't build gcc(1) or any of the GCC-related
153 libraries (libgcc, libobjc, libstdc++). 153 libraries (libgcc, libobjc, libstdc++).
154 Default: yes 154 Default: yes
155 155
156MKGCCCMDS If "no", don't build gcc(1), but do build the GCC-related 156MKGCCCMDS If "no", don't build gcc(1), but do build the GCC-related
157 libraries (libgcc, libobjc, libstdc++). 157 libraries (libgcc, libobjc, libstdc++).
158 Default: yes 158 Default: yes
159 159
160MKGDB If "no", don't build gdb(1). 160MKGDB If "no", don't build gdb(1).
161 Default: yes 161 Default: yes
162 162
163MKHESIOD If "no", disables building of Hesiod infrastructure 163MKHESIOD If "no", disables building of Hesiod infrastructure
164 (libraries and support programs). 164 (libraries and support programs).
165 Default: yes 165 Default: yes
166 166
167MKHOSTOBJ If not "no", for programs intended to be run on the compile 167MKHOSTOBJ If not "no", for programs intended to be run on the compile
168 host, the name, release, and architecture of the host 168 host, the name, release, and architecture of the host
169 operating system will be suffixed to the name of the object 169 operating system will be suffixed to the name of the object
170 directory created by "make obj". 170 directory created by "make obj".
171 Default: no 171 Default: no
172 172
173MKHTML If "no", don't build or install the HTML man pages. 173MKHTML If "no", don't build or install the HTML man pages.
174 Default: yes 174 Default: yes
175 175
176MKIEEEFP If "no", don't add code for IEEE754/IEC60559 conformance. 176MKIEEEFP If "no", don't add code for IEEE754/IEC60559 conformance.
177 Has no effect on most platforms. 177 Has no effect on most platforms.
178 Default: yes 178 Default: yes
179 179
180MKSTRIPIDENT Strip the RCS IDs from program binaries and shared libraries. 180MKSTRIPIDENT Strip the RCS IDs from program binaries and shared libraries.
181 Default: no 181 Default: no
182 182
183MKINET6 If "no", disables building of INET6 (IPv6) infrastructure 183MKINET6 If "no", disables building of INET6 (IPv6) infrastructure
184 (libraries and support programs). 184 (libraries and support programs).
185 Default: yes 185 Default: yes
186 186
187MKINFO If "no", don't build or install Info documentation from 187MKINFO If "no", don't build or install Info documentation from
188 Texinfo source files. 188 Texinfo source files.
189 Default: yes 189 Default: yes
190 190
191MKIPFILTER If "no", don't build or install the IP Filter programs and LKM. 191MKIPFILTER If "no", don't build or install the IP Filter programs and LKM.
192 Default: yes 192 Default: yes
193 193
194MKISCSI If "no", don't build or install iSCSI library or applications 194MKISCSI If "no", don't build or install iSCSI library or applications
195 (depends on libpthread.) 195 (depends on libpthread.)
196 Default: yes 196 Default: yes
197 197
198MKKERBEROS If "no", disables building of Kerberos v5 198MKKERBEROS If "no", disables building of Kerberos v5
199 infrastructure (libraries and support programs). 199 infrastructure (libraries and support programs).
200 Default: yes 200 Default: yes
201 201
202MKLDAP If "no", disables building of LDAP infrastructure 202MKLDAP If "no", disables building of LDAP infrastructure
203 (libraries and support programs). 203 (libraries and support programs).
204 Default: yes 204 Default: yes
205 205
206MKLINKLIB If "no", act as "MKLINT=no MKPICINSTALL=no MKPROFILE=no". 206MKLINKLIB If "no", act as "MKLINT=no MKPICINSTALL=no MKPROFILE=no".
207 Also: 207 Also:
208 - don't install the .a libraries 208 - don't install the .a libraries
209 - don't install _pic.a libraries on PIC systems 209 - don't install _pic.a libraries on PIC systems
210 - don't build .a libraries on PIC systems 210 - don't build .a libraries on PIC systems
211 - don't install the .so symlink on ELF systems 211 - don't install the .so symlink on ELF systems
212 I.e, only install the shared library (and the .so.major 212 I.e, only install the shared library (and the .so.major
213 symlink on ELF). 213 symlink on ELF).
214 Default: yes 214 Default: yes
215 215
216MKLINT If "no", don't build or install the lint libraries. 216MKLINT If "no", don't build or install the lint libraries.
217 Default: yes 217 Default: yes
218 218
219MKMAN If "no", don't build or install the man or catman pages, 219MKMAN If "no", don't build or install the man or catman pages,
220 and also acts as "MKCATPAGES=no MKHTML=no". 220 and also acts as "MKCATPAGES=no MKHTML=no".
221 Default: yes 221 Default: yes
222 222
223MKMANZ If not "no", compress manual pages at installation time. 223MKMANZ If not "no", compress manual pages at installation time.
224 Default: no 224 Default: no
225 225
226MKMODULAR If "no", don't build the versions of modload(8), modstat(8) 226MKMODULAR If "no", don't build the versions of modload(8), modstat(8)
227 and modunload(8) that use the new modules framework present 227 and modunload(8) that use the new modules framework present
228 in the kernel (enabled separately using 'options MODULAR' 228 in the kernel (enabled separately using 'options MODULAR'
229 int the configuration file). Also don't build any other 229 int the configuration file). Also don't build any other
230 stuff that may rely on this support, such as tests or kernel 230 stuff that may rely on this support, such as tests or kernel
231 modules. 231 modules.
232 Note: This flag will disappear when the new modules framework 232 Note: This flag will disappear when the new modules framework
233 is complete enough to replace the old LKM, effectively 233 is complete enough to replace the old LKM, effectively
234 switching it to "yes" by default. 234 switching it to "yes" by default.
235 Default: no 235 Default: no
236 236
237MKNLS If "no", don't build or install the NLS files and locale 237MKNLS If "no", don't build or install the NLS files and locale
238 definition files. 238 definition files.
239 Default: yes 239 Default: yes
240 240
241MKOBJ If "no", don't enable the rule which creates objdirs, 241MKOBJ If "no", don't enable the rule which creates objdirs,
242 and also acts as "MKOBJDIRS=no". 242 and also acts as "MKOBJDIRS=no".
243 Default: yes 243 Default: yes
244 244
245MKOBJDIRS If "no", don't create objdirs during a "make build". 245MKOBJDIRS If "no", don't create objdirs during a "make build".
246 Default: no 246 Default: no
247 247
248MKPAM If "no", disables building of PAM authentication 248MKPAM If "no", disables building of PAM authentication
249 infrastructure (libraries and support programs). 249 infrastructure (libraries and support programs).
250 Default: yes 250 Default: yes
251 251
252MKPCC If "no", don't build pcc(1) or any of the PCC-related 252MKPCC If "no", don't build pcc(1) or any of the PCC-related
253 libraries (libpcc, libpccsoftfloat). 253 libraries (libpcc, libpccsoftfloat).
254 Default: no 254 Default: no
255 255
256MKPCCCMDS If "no", don't build pcc(1), but do build the PCC-related 256MKPCCCMDS If "no", don't build pcc(1), but do build the PCC-related
257 libraries (libpcc, libpccsoftfloat). 257 libraries (libpcc, libpccsoftfloat).
258 Default: no 258 Default: no
259 259
260MKPF If "no", don't build or install the pf programs and LKM. 260MKPF If "no", don't build or install the pf programs and LKM.
261 Default: yes 261 Default: yes
262 262
263MKPIC If "no", don't build or install shared libraries, and 263MKPIC If "no", don't build or install shared libraries, and
264 also acts as "MKPICLIB=no" 264 also acts as "MKPICLIB=no"
265 Default: yes (for MACHINE_ARCHs that support it)  265 Default: yes (for MACHINE_ARCHs that support it)
266 266
267MKPICINSTALL If "no", don't install the *_pic.a libraries. 267MKPICINSTALL If "no", don't install the *_pic.a libraries.
268 Default: yes 268 Default: yes
269 269
270MKPICLIB If "no", don't build *_pic.a libraries, and build the 270MKPICLIB If "no", don't build *_pic.a libraries, and build the
271 shared object libraries from the .a libraries. 271 shared object libraries from the .a libraries.
272 A symlink is installed in ${DESTDIR}/usr/lib for the 272 A symlink is installed in ${DESTDIR}/usr/lib for the
273 _pic.a library pointing to the .a library. 273 _pic.a library pointing to the .a library.
274 Default: yes 274 Default: yes
275 275
276MKPIE If "no", create regular executables. Otherwise create 276MKPIE If "no", create regular executables. Otherwise create
277 PIE (Position Independent Executables). 277 PIE (Position Independent Executables).
278 Default: no 278 Default: no
279 279
280MKPOSTFIX If "no", don't build or install postfix(1). 280MKPOSTFIX If "no", don't build or install postfix(1).
281 Default: yes 281 Default: yes
282 282
283MKPROFILE If "no", don't build or install the profiling (*_p.a) libraries. 283MKPROFILE If "no", don't build or install the profiling (*_p.a) libraries.
284 Default: yes 284 Default: yes
285 285
286MKPUFFS If "no", don't build librefuse (lib/librefuse) or 286MKPUFFS If "no", don't build librefuse (lib/librefuse) or
287 puffs applications (usr.sbin/puffs). NOTE: libpuffs 287 puffs applications (usr.sbin/puffs). NOTE: libpuffs
288 is always built due to historic reasons. This flag will 288 is always built due to historic reasons. This flag will
289 disappear once puffs is no longer considered experimental, 289 disappear once puffs is no longer considered experimental,
290 i.e. it will effectively default to "yes". 290 i.e. it will effectively default to "yes".
291 Default: no 291 Default: no
292 292
293MKSHARE If "no", act as "MKCATPAGES=no MKDOC=no MKHTML=no MKINFO=no 293MKSHARE If "no", act as "MKCATPAGES=no MKDOC=no MKHTML=no MKINFO=no
294 MKMAN=no MKNLS=no". 294 MKMAN=no MKNLS=no".
295 I.e, don't build catman pages, documentation, Info 295 I.e, don't build catman pages, documentation, Info
296 documentation, man pages, NLS files, ... 296 documentation, man pages, NLS files, ...
297 Default: yes 297 Default: yes
298 298
299MKSKEY If "no", disables building of S/key authentication 299MKSKEY If "no", disables building of S/key authentication
300 infrastructure (libraries and support programs). 300 infrastructure (libraries and support programs).
301 Default: yes 301 Default: yes
302 302
303MKSOFTFLOAT If not "no", build with options to enable the compiler to 303MKSOFTFLOAT If not "no", build with options to enable the compiler to
304 generate output containing library calls for floating 304 generate output containing library calls for floating
305 point and possibly soft-float library support. 305 point and possibly soft-float library support.
306 Default: no 306 Default: no
307 307
308MKSTATICLIB If "no", don't build or install the normal static (*.a) 308MKSTATICLIB If "no", don't build or install the normal static (*.a)
309 libraries. 309 libraries.
310 Default: yes 310 Default: yes
311 311
312MKUNPRIVED If not "no", don't set the owner/group/mode when installing 312MKUNPRIVED If not "no", don't set the owner/group/mode when installing
313 files or directories, and keep a metadata log of what 313 files or directories, and keep a metadata log of what
314 the owner/group/mode should be. This allows a 314 the owner/group/mode should be. This allows a
315 non-root "make install". 315 non-root "make install".
316 Default: no 316 Default: no
317 317
318MKUPDATE If not "no", 'make install' only installs targets that are 318MKUPDATE If not "no", 'make install' only installs targets that are
319 more recently modified in the source directories that their 319 more recently modified in the source directories that their
320 installed counterparts. 320 installed counterparts.
321 Default: no 321 Default: no
322 322
323MKX11 If not "no", 'make build' also descends into src/x11 323MKX11 If not "no", 'make build' also descends into src/x11
324 to cross-build X11R6 and automatically enables creation 324 to cross-build X11R6 and automatically enables creation
325 of X sets. 325 of X sets.
326 Mutually exclusive to MKXORG!=no 326 Mutually exclusive to MKXORG!=no
327 Default: no 327 Default: no
328 328
329MKXORG If not "no", 'make build' also descends into 329MKXORG If not "no", 'make build' also descends into
330 src/external/mit/xorg to cross-build X11R7 (modular Xorg) 330 src/external/mit/xorg to cross-build X11R7 (modular Xorg)
331 and automatically enables creation of X sets. 331 and automatically enables creation of X sets.
332 Mutually exclusive to MKX11!=no 332 Mutually exclusive to MKX11!=no
333 Default: no 333 Default: no
334 334
335MKYP If "no", disables building of YP (NIS) 335MKYP If "no", disables building of YP (NIS)
336 infrastructure (libraries and support programs). 336 infrastructure (libraries and support programs).
337 Default: yes 337 Default: yes
338 338
339USE_HESIOD If "no", disables building Hesiod support into 339USE_HESIOD If "no", disables building Hesiod support into
340 various system utilities/libraries that support it. 340 various system utilities/libraries that support it.
341 If ${MKHESIOD} is "no", USE_HESIOD will also be 341 If ${MKHESIOD} is "no", USE_HESIOD will also be
342 forced to "no". 342 forced to "no".
343 343
344USE_INET6 If "no", disables building INET6 (IPv6) support into 344USE_INET6 If "no", disables building INET6 (IPv6) support into
345 various system utilities/libraries that support it. 345 various system utilities/libraries that support it.
346 If ${MKINET6} is "no", USE_INET6 will also be 346 If ${MKINET6} is "no", USE_INET6 will also be
347 forced to "no". 347 forced to "no".
348 348
349USE_JEMALLOC If "no", disables building the "jemalloc" allocator 349USE_JEMALLOC If "no", disables building the "jemalloc" allocator
350 designed for improved performance with threaded 350 designed for improved performance with threaded
351 applications. The "phkmalloc" allocator as used up 351 applications. The "phkmalloc" allocator as used up
352 before NetBSD-5.0 will be substituted. 352 before NetBSD-5.0 will be substituted.
353 353
354USE_KERBEROS If "no", disables building Kerberos v5 354USE_KERBEROS If "no", disables building Kerberos v5
355 support into various system utilities/libraries that 355 support into various system utilities/libraries that
356 support it. If ${MKKERBEROS} is "no", USE_KERBEROS 356 support it. If ${MKKERBEROS} is "no", USE_KERBEROS
357 will also be forced to "no". 357 will also be forced to "no".
358 358
359USE_LDAP If "no", disables building LDAP support into various 359USE_LDAP If "no", disables building LDAP support into various
360 system utilities/libraries that support it. 360 system utilities/libraries that support it.
361 If ${MKLDAP} is "no", USE_LDAP will also be forced to "no". 361 If ${MKLDAP} is "no", USE_LDAP will also be forced to "no".
362 362
363USE_PAM If "no", disables building PAM authentication support 363USE_PAM If "no", disables building PAM authentication support
364 into various system utilities/libraries that support it. 364 into various system utilities/libraries that support it.
365 If ${MKPAM} is "no", USE_PAM will also be forced to "no". 365 If ${MKPAM} is "no", USE_PAM will also be forced to "no".
366 366
367USE_SKEY If "no", disables building S/key authentication 367USE_SKEY If "no", disables building S/key authentication
368 support into various system utilities/libraries that 368 support into various system utilities/libraries that
369 support it. If ${MKSKEY} is "no", USE_SKEY will 369 support it. If ${MKSKEY} is "no", USE_SKEY will
370 also be forced to "no". 370 also be forced to "no".
371 Default: no 371 Default: no
372 372
373USE_SSP If "no", disables GCC stack protection code, which 373USE_SSP If "no", disables GCC stack protection code, which
374 detects stack overflows and aborts the program. This 374 detects stack overflows and aborts the program. This
375 imposes some performance penalty. 375 imposes some performance penalty.
376 Default: no 376 Default: no
377 377
378USE_YP If "no", disables building YP (NIS) support into 378USE_YP If "no", disables building YP (NIS) support into
379 various system utilities/libraries that support it. 379 various system utilities/libraries that support it.
380 If ${MKYP} is "no", USE_YP will also be forced to "no". 380 If ${MKYP} is "no", USE_YP will also be forced to "no".
381 381
382COPTS.lib<lib> 382COPTS.lib<lib>
383OBJCOPTS.lib<lib> 383OBJCOPTS.lib<lib>
384LDADD.lib<lib> 384LDADD.lib<lib>
385CPPFLAGS.lib<lib> 385CPPFLAGS.lib<lib>
386CXXFLAGS.lib<lib> 386CXXFLAGS.lib<lib>
387COPTS.<prog> 387COPTS.<prog>
388OBJCCOPTS.<prog> 388OBJCCOPTS.<prog>
389LDADD.<prog> 389LDADD.<prog>
390CPPFLAGS.<prog> 390CPPFLAGS.<prog>
391CXXFLAGS.<prog> These provide a way to specify additions to the associated 391CXXFLAGS.<prog> These provide a way to specify additions to the associated
392 variables in a way that applies only to a particular library 392 variables in a way that applies only to a particular library
393 or program. <lib> corresponds to the LIB variable set in 393 or program. <lib> corresponds to the LIB variable set in
394 the library's makefile. <prog> corresponds to either PROG 394 the library's makefile. <prog> corresponds to either PROG
395 or PROG_CXX (if set). For example, if COPTS.libcrypto is 395 or PROG_CXX (if set). For example, if COPTS.libcrypto is
396 set to "-g", "-g" will be added to COPTS only when compiling 396 set to "-g", "-g" will be added to COPTS only when compiling
397 the crypto library. 397 the crypto library.
398 398
399=-=-=-=-= sys.mk =-=-=-=-= 399=-=-=-=-= sys.mk =-=-=-=-=
400 400
401The include file <sys.mk> has the default rules for all makes, in the BSD 401The include file <sys.mk> has the default rules for all makes, in the BSD
402environment or otherwise. You probably don't want to touch this file. 402environment or otherwise. You probably don't want to touch this file.
403 403
404=-=-=-=-= bsd.own.mk =-=-=-=-= 404=-=-=-=-= bsd.own.mk =-=-=-=-=
405 405
406The include file <bsd.own.mk> contains source tree configuration parameters, 406The include file <bsd.own.mk> contains source tree configuration parameters,
407such as the owners, groups, etc. for both manual pages and binaries, and 407such as the owners, groups, etc. for both manual pages and binaries, and
408a few global "feature configuration" parameters. 408a few global "feature configuration" parameters.
409 409
410It has no targets. 410It has no targets.
411 411
412To get system-specific configuration parameters, <bsd.own.mk> will try to 412To get system-specific configuration parameters, <bsd.own.mk> will try to
413include the file specified by the "MAKECONF" variable. If MAKECONF is not 413include the file specified by the "MAKECONF" variable. If MAKECONF is not
414set, or no such file exists, the system make configuration file, /etc/mk.conf 414set, or no such file exists, the system make configuration file, /etc/mk.conf
415is included. These files may define any of the variables described below. 415is included. These files may define any of the variables described below.
416 416
417<bsd.own.mk> sets the following variables, if they are not already defined 417<bsd.own.mk> sets the following variables, if they are not already defined
418(defaults are in brackets): 418(defaults are in brackets):
419 419
420NETBSDSRCDIR Top of the NetBSD source tree. 420NETBSDSRCDIR Top of the NetBSD source tree.
421 If _SRC_TOP_ != "", that will be used as the default, 421 If _SRC_TOP_ != "", that will be used as the default,
422 otherwise BSDSRCDIR will be used as the default. 422 otherwise BSDSRCDIR will be used as the default.
423 Various makefiles within the NetBSD source tree will 423 Various makefiles within the NetBSD source tree will
424 use this to reference the top level of the source tree. 424 use this to reference the top level of the source tree.
425 425
426_SRC_TOP_ Top of the system source tree, as determined by <bsd.own.mk> 426_SRC_TOP_ Top of the system source tree, as determined by <bsd.own.mk>
427 based on the presence of tools/ and build.sh. This variable 427 based on the presence of tools/ and build.sh. This variable
428 is "internal" to <bsd.own.mk>, although its value is only 428 is "internal" to <bsd.own.mk>, although its value is only
429 determined once and then propagated to all sub-makes. 429 determined once and then propagated to all sub-makes.
430 430
431BSDSRCDIR The real path to the system sources, so that 'make obj' 431BSDSRCDIR The real path to the system sources, so that 'make obj'
432 will work correctly. [/usr/src] 432 will work correctly. [/usr/src]
433 433
434BSDOBJDIR The real path to the system 'obj' tree, so that 'make obj' 434BSDOBJDIR The real path to the system 'obj' tree, so that 'make obj'
435 will work correctly. [/usr/obj] 435 will work correctly. [/usr/obj]
436 436
437BINGRP Binary group. [wheel] 437BINGRP Binary group. [wheel]
438 438
439BINOWN Binary owner. [root] 439BINOWN Binary owner. [root]
440 440
441BINMODE Binary mode. [555] 441BINMODE Binary mode. [555]
442 442
443NONBINMODE Mode for non-executable files. [444] 443NONBINMODE Mode for non-executable files. [444]
444 444
445MANDIR Base path for manual installation. [/usr/share/man/cat] 445MANDIR Base path for manual installation. [/usr/share/man/cat]
446 446
447MANGRP Manual group. [wheel] 447MANGRP Manual group. [wheel]
448 448
449MANOWN Manual owner. [root] 449MANOWN Manual owner. [root]
450 450
451MANMODE Manual mode. [${NONBINMODE}] 451MANMODE Manual mode. [${NONBINMODE}]
452 452
453MANINSTALL Manual installation type. Space separated list: 453MANINSTALL Manual installation type. Space separated list:
454 catinstall, htmlinstall, maninstall 454 catinstall, htmlinstall, maninstall
455 [catinstall maninstall htmlinstall] 455 [catinstall maninstall htmlinstall]
456 456
457LDSTATIC Control program linking; if set blank, link everything 457LDSTATIC Control program linking; if set blank, link everything
458 dynamically. If set to "-static", link everything statically. 458 dynamically. If set to "-static", link everything statically.
459 If not set, programs link according to their makefile. 459 If not set, programs link according to their makefile.
460 460
461LIBDIR Base path for library installation. [/usr/lib] 461LIBDIR Base path for library installation. [/usr/lib]
462 462
463LINTLIBDIR Base path for lint(1) library installation. [/usr/libdata/lint] 463LINTLIBDIR Base path for lint(1) library installation. [/usr/libdata/lint]
464 464
465LIBGRP Library group. [${BINGRP}] 465LIBGRP Library group. [${BINGRP}]
466 466
467LIBOWN Library owner. [${BINOWN}] 467LIBOWN Library owner. [${BINOWN}]
468 468
469LIBMODE Library mode. [${NONBINMODE}] 469LIBMODE Library mode. [${NONBINMODE}]
470 470
471DOCDIR Base path for system documentation (e.g. PSD, USD, etc.) 471DOCDIR Base path for system documentation (e.g. PSD, USD, etc.)
472 installation. [/usr/share/doc] 472 installation. [/usr/share/doc]
473 473
474HTMLDOCDIR Base path for html system documentation installation. 474HTMLDOCDIR Base path for html system documentation installation.
475 [/usr/share/doc/html] 475 [/usr/share/doc/html]
476 476
477DOCGRP Documentation group. [wheel] 477DOCGRP Documentation group. [wheel]
478 478
479DOCOWN Documentation owner. [root] 479DOCOWN Documentation owner. [root]
480 480
481DOCMODE Documentation mode. [${NONBINMODE}] 481DOCMODE Documentation mode. [${NONBINMODE}]
482 482
483NLSDIR Base path for Native Language Support files installation. 483NLSDIR Base path for Native Language Support files installation.
484 [/usr/share/nls] 484 [/usr/share/nls]
485 485
486NLSGRP Native Language Support files group. [wheel] 486NLSGRP Native Language Support files group. [wheel]
487 487
488NLSOWN Native Language Support files owner. [root] 488NLSOWN Native Language Support files owner. [root]
489 489
490NLSMODE Native Language Support files mode. [${NONBINMODE}] 490NLSMODE Native Language Support files mode. [${NONBINMODE}]
491 491
492X11SRCDIR The path to the xsrc tree. [/usr/xsrc] 492X11SRCDIR The path to the xsrc tree. [/usr/xsrc]
493 493
494X11SRCDIR.xc The path to the (old) X11 xc src tree. [${X11SRCDIR}/xfree/xc] 494X11SRCDIR.xc The path to the (old) X11 xc src tree. [${X11SRCDIR}/xfree/xc]
495 495
496X11SRCDIR.local The path to the local X11 src tree. [${X11SRCDIR}/local] 496X11SRCDIR.local The path to the local X11 src tree. [${X11SRCDIR}/local]
497 497
498X11SRCDIR.lib<package> 498X11SRCDIR.lib<package>
499X11SRCDIR.<package> 499X11SRCDIR.<package>
500 The path to the xorg src tree for the specificed package>. 500 The path to the xorg src tree for the specificed package>.
501 [${X11SRCDIR}/external/mit/xorg/<package>/dist] 501 [${X11SRCDIR}/external/mit/xorg/<package>/dist]
502 502
503X11ROOTDIR Root directory of the X11 installation. [/usr/X11R6 or 503X11ROOTDIR Root directory of the X11 installation. [/usr/X11R6 or
504 [/usr/X11R7] 504 [/usr/X11R7]
505 505
506X11BINDIR X11 bin directory. [${X11ROOTDIR}/bin] 506X11BINDIR X11 bin directory. [${X11ROOTDIR}/bin]
507 507
508X11FONTDIR X11 font directory. [${X11ROOTDIR}/lib/X11/fonts] 508X11FONTDIR X11 font directory. [${X11ROOTDIR}/lib/X11/fonts]
509 509
510X11INCDIR X11 include directory. [${X11ROOTDIR}/include] 510X11INCDIR X11 include directory. [${X11ROOTDIR}/include]
511 511
512X11LIBDIR X11 lib/x11 (config) directory. [${X11ROOTDIR}/lib/X11] 512X11LIBDIR X11 lib/x11 (config) directory. [${X11ROOTDIR}/lib/X11]
513 513
514X11MANDIR X11 manual directory. [${X11ROOTDIR}/man] 514X11MANDIR X11 manual directory. [${X11ROOTDIR}/man]
515 515
516X11USRLIBDIR X11 library directory. [${X11ROOTDIR}/lib] 516X11USRLIBDIR X11 library directory. [${X11ROOTDIR}/lib]
517 517
518STRIPFLAG The flag passed to the install program to cause the binary 518STRIPFLAG The flag passed to the install program to cause the binary
519 to be stripped. This is to be used when building your 519 to be stripped. This is to be used when building your
520 own install script so that the entire system can be made 520 own install script so that the entire system can be made
521 stripped/not-stripped using a single knob. [] 521 stripped/not-stripped using a single knob. []
522 522
523COPY The flag passed to the install program to cause the binary 523COPY The flag passed to the install program to cause the binary
524 to be copied rather than moved. This is to be used when 524 to be copied rather than moved. This is to be used when
525 building our own install script so that the entire system 525 building our own install script so that the entire system
526 can either be installed with copies, or with moves using 526 can either be installed with copies, or with moves using
527 a single knob. [-c] 527 a single knob. [-c]
528 528
529MAKEDIRTARGET dir target [params] 529MAKEDIRTARGET dir target [params]
530 Runs "cd $${dir} && ${MAKE} [params] $${target}", 530 Runs "cd $${dir} && ${MAKE} [params] $${target}",
531 displaying a "pretty" message whilst doing so. 531 displaying a "pretty" message whilst doing so.
532 532
533RELEASEMACHINEDIR 533RELEASEMACHINEDIR
534 Subdirectory used below RELEASEDIR when building 534 Subdirectory used below RELEASEDIR when building
535 a release. [${MACHINE}] 535 a release. [${MACHINE}]
536 536
537RELEASEMACHINE Subdirectory or path component used for the following 537RELEASEMACHINE Subdirectory or path component used for the following
538 paths: 538 paths:
539 distrib/${RELEASEMACHINE} 539 distrib/${RELEASEMACHINE}
540 distrib/notes/${RELEASEMACHINE} 540 distrib/notes/${RELEASEMACHINE}
541 etc/etc.${RELEASEMACHINE} 541 etc/etc.${RELEASEMACHINE}
542 Used when building a release. [${MACHINE}] 542 Used when building a release. [${MACHINE}]
543 543
544Additionally, the following variables may be set by <bsd.own.mk> or in a 544Additionally, the following variables may be set by <bsd.own.mk> or in a
545make configuration file to modify the behavior of the system build 545make configuration file to modify the behavior of the system build
546process (default values are in brackets along with comments, if set by 546process (default values are in brackets along with comments, if set by
547<bsd.own.mk>): 547<bsd.own.mk>):
548 548
549USETOOLS Indicates whether the tools specified by ${TOOLDIR} should 549USETOOLS Indicates whether the tools specified by ${TOOLDIR} should
550 be used as part of a build in progress. 550 be used as part of a build in progress.
551 Supported values: 551 Supported values:
552 552
553 yes Use the tools from TOOLDIR. 553 yes Use the tools from TOOLDIR.
554 Must be set to this if cross-compiling. 554 Must be set to this if cross-compiling.
555 555
556 no Do not use the tools from TOOLDIR, but refuse to 556 no Do not use the tools from TOOLDIR, but refuse to
557 build native compilation tool components that are 557 build native compilation tool components that are
558 version-specific for that tool. 558 version-specific for that tool.
559 559
560 never Do not use the tools from TOOLDIR, even when 560 never Do not use the tools from TOOLDIR, even when
561 building native tool components. This is similar to 561 building native tool components. This is similar to
562 the traditional NetBSD build method, but does not 562 the traditional NetBSD build method, but does not
563 verify that the compilation tools in use are 563 verify that the compilation tools in use are
564 up-to-date enough in order to build the tree 564 up-to-date enough in order to build the tree
565 successfully. This may cause build or runtime 565 successfully. This may cause build or runtime
566 problems when building the whole NetBSD source tree. 566 problems when building the whole NetBSD source tree.
567 567
568 Default: "yes" if building all or part of a whole NetBSD 568 Default: "yes" if building all or part of a whole NetBSD
569 source tree (detected automatically); "no" otherwise 569 source tree (detected automatically); "no" otherwise
570 (to preserve traditional semantics of the <bsd.*.mk> 570 (to preserve traditional semantics of the <bsd.*.mk>
571 make(1) include files). 571 make(1) include files).
572 572
573OBJECT_FMT Object file format. [set to "ELF" on architectures that 573OBJECT_FMT Object file format. [set to "ELF" on architectures that
574 use ELF -- currently all architectures]. 574 use ELF -- currently all architectures].
575 575
576TOOLCHAIN_MISSING 576TOOLCHAIN_MISSING
577 If not "no", this indicates that the platform being built 577 If not "no", this indicates that the platform being built
578 does not have a working in-tree toolchain. If the 578 does not have a working in-tree toolchain. If the
579 ${MACHINE_ARCH} in question falls into this category, 579 ${MACHINE_ARCH} in question falls into this category,
580 TOOLCHAIN_MISSING is conditionally assigned the value "yes".  580 TOOLCHAIN_MISSING is conditionally assigned the value "yes".
581 Otherwise, the variable is unconditionally assigned the 581 Otherwise, the variable is unconditionally assigned the
582 value "no". 582 value "no".
583 If not "no", ${MKBFD}, ${MKGCC}, and ${MKGDB} are 583 If not "no", ${MKBFD}, ${MKGCC}, and ${MKGDB} are
584 unconditionally assigned the value "no". 584 unconditionally assigned the value "no".
585 585
586EXTERNAL_TOOLCHAIN 586EXTERNAL_TOOLCHAIN
587 This variable is not directly set by <bsd.own.mk>, but 587 This variable is not directly set by <bsd.own.mk>, but
588 including <bsd.own.mk> is the canonical way to gain 588 including <bsd.own.mk> is the canonical way to gain
589 access to this variable. The variable should be defined 589 access to this variable. The variable should be defined
590 either in the user's environment or in the user's mk.conf 590 either in the user's environment or in the user's mk.conf
591 file. If defined, this variable indicates the root of 591 file. If defined, this variable indicates the root of
592 an external toolchain which will be used to build the 592 an external toolchain which will be used to build the
593 tree. For example, if a platform is a ${TOOLCHAIN_MISSING} 593 tree. For example, if a platform is a ${TOOLCHAIN_MISSING}
594 platform, EXTERNAL_TOOLCHAIN can be used to re-enable the 594 platform, EXTERNAL_TOOLCHAIN can be used to re-enable the
595 cross-compile framework. 595 cross-compile framework.
596 596
597 If EXTERNAL_TOOLCHAIN is defined, ${MKGCC} is unconditionally 597 If EXTERNAL_TOOLCHAIN is defined, ${MKGCC} is unconditionally
598 assigned the value "no", since the external version of the 598 assigned the value "no", since the external version of the
599 compiler may not be able to build the library components of 599 compiler may not be able to build the library components of
600 the in-tree compiler. 600 the in-tree compiler.
601 601
602 NOTE: This variable is not yet used in as many places as 602 NOTE: This variable is not yet used in as many places as
603 it should be. Expect the exact semantics of this variable 603 it should be. Expect the exact semantics of this variable
604 to change in the short term as parts of the cross-compile 604 to change in the short term as parts of the cross-compile
605 framework continue to be cleaned up. 605 framework continue to be cleaned up.
606 606
607<bsd.own.mk> is generally useful when building your own Makefiles so that 607<bsd.own.mk> is generally useful when building your own Makefiles so that
608they use the same default owners etc. as the rest of the tree. 608they use the same default owners etc. as the rest of the tree.
609 609
610 610
611=-=-=-=-= bsd.dep.mk =-=-=-=-= 611=-=-=-=-= bsd.dep.mk =-=-=-=-=
612 612
613The include file <bsd.dep.mk> contains the default targets for building 613The include file <bsd.dep.mk> contains the default targets for building
614.depend files. It creates .d files from entries in SRCS and DPSRCS 614.depend files. It creates .d files from entries in SRCS and DPSRCS
615that are C, C++, or Objective C source files, and builds .depend from the 615that are C, C++, or Objective C source files, and builds .depend from the
616.d files. All other files in SRCS and all of DPSRCS will be used as 616.d files. All other files in SRCS and all of DPSRCS will be used as
617dependencies for the .d files. In order for this to function correctly, 617dependencies for the .d files. In order for this to function correctly,
618it should be .included after all other .mk files and directives that may 618it should be .included after all other .mk files and directives that may
619modify SRCS or DPSRCS. It uses the following variables: 619modify SRCS or DPSRCS. It uses the following variables:
620 620
621SRCS List of source files to build the program. 621SRCS List of source files to build the program.
622 622
623DPSRCS List of source files which are needed for generating 623DPSRCS List of source files which are needed for generating
624 dependencies, but are not needed in ${SRCS}. 624 dependencies, but are not needed in ${SRCS}.
625 625
626 626
627=-=-=-=-= bsd.files.mk =-=-=-=-= 627=-=-=-=-= bsd.files.mk =-=-=-=-=
628 628
629The include file <bsd.files.mk> handles the FILES variables and is included 629The include file <bsd.files.mk> handles the FILES variables and is included
630from <bsd.lib.mk> and <bsd.prog.mk>, and uses the following variables: 630from <bsd.lib.mk> and <bsd.prog.mk>, and uses the following variables:
631 631
632FILES The list of files to install. 632FILES The list of files to install.
633 633
634CONFIGFILES Similar semantics to FILES, except that the files 634CONFIGFILES Similar semantics to FILES, except that the files
635 are installed by the `configinstall' target, 635 are installed by the `configinstall' target,
636 not the `install' target. 636 not the `install' target.
637 The FILES* variables documented below also apply. 637 The FILES* variables documented below also apply.
638 638
639FILESOWN File owner. [${BINOWN}] 639FILESOWN File owner. [${BINOWN}]
640 640
641FILESGRP File group. [${BINGRP}] 641FILESGRP File group. [${BINGRP}]
642 642
643FILESMODE File mode. [${NONBINMODE}] 643FILESMODE File mode. [${NONBINMODE}]
644 644
645FILESDIR The location to install the files. 645FILESDIR The location to install the files.
646 646
647FILESNAME Optional name to install each file as. 647FILESNAME Optional name to install each file as.
648 648
649FILESOWN_<fn> File owner of the specific file <fn>. 649FILESOWN_<fn> File owner of the specific file <fn>.
650 650
651FILESGRP_<fn> File group of the specific file <fn>. 651FILESGRP_<fn> File group of the specific file <fn>.
652 652
653FILESMODE_<fn> File mode of the specific file <fn>. 653FILESMODE_<fn> File mode of the specific file <fn>.
654 654
655FILESDIR_<fn> The location to install the specific file <fn>. 655FILESDIR_<fn> The location to install the specific file <fn>.
656 656
657FILESNAME_<fn> Optional name to install <fn> as. 657FILESNAME_<fn> Optional name to install <fn> as.
658 658
659 659
660BUILDSYMLINKS List of two word items: 660BUILDSYMLINKS List of two word items:
661 lnsrc lntgt 661 lnsrc lntgt
662 For each lnsrc item, create a symlink named lntgt. 662 For each lnsrc item, create a symlink named lntgt.
663 The lntgt symlinks are removed by the cleandir target. 663 The lntgt symlinks are removed by the cleandir target.
664 664
665UUDECODE_FILES List of files which are stored as <file>.uue in the source 665UUDECODE_FILES List of files which are stored as <file>.uue in the source
666 tree. Each one will be decoded with ${TOOL_UUDECODE}. 666 tree. Each one will be decoded with ${TOOL_UUDECODE}.
667 The source files have a `.uue' suffix, the generated files do  667 The source files have a `.uue' suffix, the generated files do
668 not. 668 not.
669 669
670UUDECODE_FILES_RENAME_<fn> 670UUDECODE_FILES_RENAME_<fn>
671 Rename the output from the decode to the provided name. 671 Rename the output from the decode to the provided name.
672  672
673 *NOTE: These files are simply decoded, with no install or other 673 *NOTE: These files are simply decoded, with no install or other
674 rule applying implicitly except being added to the clean 674 rule applying implicitly except being added to the clean
675 target. 675 target.
676 676
677=-=-=-=-= bsd.gcc.mk =-=-=-=-= 677=-=-=-=-= bsd.gcc.mk =-=-=-=-=
678 678
679The include file <bsd.gcc.mk> computes various parameters related to GCC 679The include file <bsd.gcc.mk> computes various parameters related to GCC
680support libraries. It defines no targets. <bsd.own.mk> MUST be included 680support libraries. It defines no targets. <bsd.own.mk> MUST be included
681before <bsd.gcc.mk>. 681before <bsd.gcc.mk>.
682 682
683The primary users of <bsd.gcc.mk> are <bsd.prog.mk> and <bsd.lib.mk>, each 683The primary users of <bsd.gcc.mk> are <bsd.prog.mk> and <bsd.lib.mk>, each
684of which need to know where to find certain GCC support libraries. 684of which need to know where to find certain GCC support libraries.
685 685
686The behavior of <bsd.gcc.mk> is influenced by the EXTERNAL_TOOLCHAIN variable, 686The behavior of <bsd.gcc.mk> is influenced by the EXTERNAL_TOOLCHAIN variable,
687which is generally set by the user. If EXTERNAL_TOOLCHAIN it set, then 687which is generally set by the user. If EXTERNAL_TOOLCHAIN it set, then
688the compiler is asked where to find the support libraries, otherwise the 688the compiler is asked where to find the support libraries, otherwise the
689support libraries are found in ${DESTDIR}/usr/lib. 689support libraries are found in ${DESTDIR}/usr/lib.
690 690
691<bsd.gcc.mk> sets the following variables: 691<bsd.gcc.mk> sets the following variables:
692 692
693_GCC_CRTBEGIN The full path name to crtbegin.o. 693_GCC_CRTBEGIN The full path name to crtbegin.o.
694 694
695_GCC_CRTBEGINS The full path name to crtbeginS.o. 695_GCC_CRTBEGINS The full path name to crtbeginS.o.
696 696
697_GCC_CRTEND The full path name to crtend.o. 697_GCC_CRTEND The full path name to crtend.o.
698 698
699_GCC_CRTENDS The full path name to crtendS.o. 699_GCC_CRTENDS The full path name to crtendS.o.
700 700
701_GCC_LIBGCCDIR The directory where libgcc.a is located. 701_GCC_LIBGCCDIR The directory where libgcc.a is located.
702 702
703 703
704=-=-=-=-= bsd.inc.mk =-=-=-=-= 704=-=-=-=-= bsd.inc.mk =-=-=-=-=
705 705
706The include file <bsd.inc.mk> defines the includes target and uses the 706The include file <bsd.inc.mk> defines the includes target and uses the
707variables: 707variables:
708 708
709INCS The list of include files. 709INCS The list of include files.
710 710
711INCSDIR The location to install the include files. 711INCSDIR The location to install the include files.
712 712
713INCSNAME Target name of the include file, if only one; same as 713INCSNAME Target name of the include file, if only one; same as
714 FILESNAME, but for include files. 714 FILESNAME, but for include files.
715 715
716INCSYMLINKS Similar to SYMLINKS in <bsd.links.mk>, except that these 716INCSYMLINKS Similar to SYMLINKS in <bsd.links.mk>, except that these
717 are installed in the 'includes' target and not the 717 are installed in the 'includes' target and not the
718 (much later) 'install' target. 718 (much later) 'install' target.
719 719
720INCSNAME_<file> The name file <file> should be installed as, if not <file>, 720INCSNAME_<file> The name file <file> should be installed as, if not <file>,
721 same as FILESNAME_<file>, but for include files. 721 same as FILESNAME_<file>, but for include files.
722 722
723 723
724=-=-=-=-= bsd.info.mk =-=-=-=-= 724=-=-=-=-= bsd.info.mk =-=-=-=-=
725 725
726The include file <bsd.info.mk> is used to generate and install GNU Info 726The include file <bsd.info.mk> is used to generate and install GNU Info
727documentation from respective Texinfo source files. It defines three 727documentation from respective Texinfo source files. It defines three
728implicit targets (.txi.info, .texi.info, and .texinfo.info), and uses the 728implicit targets (.txi.info, .texi.info, and .texinfo.info), and uses the
729following variables: 729following variables:
730 730
731TEXINFO List of Texinfo source files. Info documentation will 731TEXINFO List of Texinfo source files. Info documentation will
732 consist of single files with the extension replaced by 732 consist of single files with the extension replaced by
733 .info. 733 .info.
734 734
735INFOFLAGS Flags to pass to makeinfo. [] 735INFOFLAGS Flags to pass to makeinfo. []
736 736
737 737
738=-=-=-=-= bsd.kernobj.mk =-=-=-=-= 738=-=-=-=-= bsd.kernobj.mk =-=-=-=-=
739 739
740The include file <bsd.kernobj.mk> defines variables related to the 740The include file <bsd.kernobj.mk> defines variables related to the
741location of kernel sources and object directories. 741location of kernel sources and object directories.
742 742
743KERNSRCDIR Is the location of the top of the kernel src. 743KERNSRCDIR Is the location of the top of the kernel src.
744 [${_SRC_TOP_}/sys] 744 [${_SRC_TOP_}/sys]
745 745
746KERNARCHDIR Is the location of the machine dependent kernel sources. 746KERNARCHDIR Is the location of the machine dependent kernel sources.
747 [arch/${MACHINE}] 747 [arch/${MACHINE}]
748 748
749KERNCONFDIR Is where the configuration files for kernels are found. 749KERNCONFDIR Is where the configuration files for kernels are found.
750 [${KERNSRCDIR}/${KERNARCHDIR}/conf] 750 [${KERNSRCDIR}/${KERNARCHDIR}/conf]
751 751
752KERNOBJDIR Is the kernel build directory. The kernel GENERIC for 752KERNOBJDIR Is the kernel build directory. The kernel GENERIC for
753 instance will be compiled in ${KERNOBJDIR}/GENERIC. 753 instance will be compiled in ${KERNOBJDIR}/GENERIC.
754 The default value is 754 The default value is
755 ${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile 755 ${MAKEOBJDIRPREFIX}${KERNSRCDIR}/${KERNARCHDIR}/compile
756 if it exists or the target 'obj' is being made. 756 if it exists or the target 'obj' is being made.
757 Otherwise the default is 757 Otherwise the default is
758 ${KERNSRCDIR}/${KERNARCHDIR}/compile. 758 ${KERNSRCDIR}/${KERNARCHDIR}/compile.
759 759
760It is important that Makefiles (such as those under src/distrib) that 760It is important that Makefiles (such as those under src/distrib) that
761wish to find compiled kernels use <bsd.kernobj.mk> and ${KERNOBJDIR} 761wish to find compiled kernels use <bsd.kernobj.mk> and ${KERNOBJDIR}
762rather than make assumptions about the location of the compiled kernel. 762rather than make assumptions about the location of the compiled kernel.
763 763
764 764
765=-=-=-=-= bsd.kinc.mk =-=-=-=-= 765=-=-=-=-= bsd.kinc.mk =-=-=-=-=
766 766
767The include file <bsd.kinc.mk> defines the many targets (includes, 767The include file <bsd.kinc.mk> defines the many targets (includes,
768subdirectories, etc.), and is used by kernel makefiles to handle 768subdirectories, etc.), and is used by kernel makefiles to handle
769include file installation. It is intended to be included alone, by 769include file installation. It is intended to be included alone, by
770kernel Makefiles. It uses similar variables to <bsd.inc.mk>. 770kernel Makefiles. It uses similar variables to <bsd.inc.mk>.
771Please see <bsd.kinc.mk> for more details, and keep the documentation 771Please see <bsd.kinc.mk> for more details, and keep the documentation
772in that file up to date. 772in that file up to date.
773 773
774 774
775=-=-=-=-= bsd.lib.mk =-=-=-=-= 775=-=-=-=-= bsd.lib.mk =-=-=-=-=
776 776
777The include file <bsd.lib.mk> has support for building libraries. It has 777The include file <bsd.lib.mk> has support for building libraries. It has
778the same eight targets as <bsd.prog.mk>: all, clean, cleandir, depend, 778the same eight targets as <bsd.prog.mk>: all, clean, cleandir, depend,
779includes, install, lint, and tags. Additionally, it has a checkver target 779includes, install, lint, and tags. Additionally, it has a checkver target
780which checks for installed shared object libraries whose version is greater 780which checks for installed shared object libraries whose version is greater
781that the version of the source. It has a limited number of suffixes, 781that the version of the source. It has a limited number of suffixes,
782consistent with the current needs of the BSD tree. <bsd.lib.mk> includes 782consistent with the current needs of the BSD tree. <bsd.lib.mk> includes
783<bsd.shlib.mk> to get shared library parameters. 783<bsd.shlib.mk> to get shared library parameters.
784 784
785It sets/uses the following variables: 785It sets/uses the following variables:
786 786
787LIB The name of the library to build. 787LIB The name of the library to build.
788 788
789LIBDIR Target directory for libraries. 789LIBDIR Target directory for libraries.
790 790
791SHLIBINSTALLDIR Target directory for shared libraries if ${USE_SHLIBDIR} 791SHLIBINSTALLDIR Target directory for shared libraries if ${USE_SHLIBDIR}
792 is not "no". 792 is not "no".
793 793
794USE_SHLIBDIR If not "no", use ${SHLIBINSTALLDIR} instead of ${LIBDIR} 794USE_SHLIBDIR If not "no", use ${SHLIBINSTALLDIR} instead of ${LIBDIR}
795 as the path to install shared libraries to. 795 as the path to install shared libraries to.
796 USE_SHLIBDIR must be defined before <bsd.own.mk> is included. 796 USE_SHLIBDIR must be defined before <bsd.own.mk> is included.
797 Default: no 797 Default: no
798 798
799LIBISMODULE If not "no", install as ${LIB}.so (without the "lib" prefix), 799LIBISMODULE If not "no", install as ${LIB}.so (without the "lib" prefix),
800 and act as "MKDEBUGLIB=no MKLINT=no MKPICINSTALL=no 800 and act as "MKDEBUGLIB=no MKLINT=no MKPICINSTALL=no
801 MKPROFILE=no MKSTATICLIB=no". 801 MKPROFILE=no MKSTATICLIB=no".
802 Default: no 802 Default: no
803 803
804LIBISPRIVATE If not "no", act as "MKDEBUGLIB=no MKLINT=no MKPIC=no 804LIBISPRIVATE If not "no", act as "MKDEBUGLIB=no MKLINT=no MKPIC=no
805 MKPROFILE=no", and don't install the (.a) library. 805 MKPROFILE=no", and don't install the (.a) library.
806 This is useful for "build only" helper libraries. 806 This is useful for "build only" helper libraries.
807 Default: no 807 Default: no
808 808
809LINTLIBDIR Target directory for lint libraries. 809LINTLIBDIR Target directory for lint libraries.
810 810
811LIBGRP Library group. 811LIBGRP Library group.
812 812
813LIBOWN Library owner. 813LIBOWN Library owner.
814 814
815LIBMODE Library mode. 815LIBMODE Library mode.
816 816
817LDADD Additional loader objects. 817LDADD Additional loader objects.
818 818
819MAN The manual pages to be installed (use a .1 - .9 suffix). 819MAN The manual pages to be installed (use a .1 - .9 suffix).
820 820
821NOCHECKVER_<library> 821NOCHECKVER_<library>
822NOCHECKVER If set, disables checking for installed shared object 822NOCHECKVER If set, disables checking for installed shared object
823 libraries with versions greater than the source. A 823 libraries with versions greater than the source. A
824 particular library name, without the "lib" prefix, may 824 particular library name, without the "lib" prefix, may
825 be appended to the variable name to disable the check for 825 be appended to the variable name to disable the check for
826 only that library. 826 only that library.
827 827
828SRCS List of source files to build the library. Suffix types 828SRCS List of source files to build the library. Suffix types
829 .s, .c, and .f are supported. Note, .s files are preferred 829 .s, .c, and .f are supported. Note, .s files are preferred
830 to .c files of the same name. (This is not the default for 830 to .c files of the same name. (This is not the default for
831 versions of make.) 831 versions of make.)
832 832
833LIBDPLIBS A list of the tuples: 833LIBDPLIBS A list of the tuples:
834 libname path-to-srcdir-of-libname 834 libname path-to-srcdir-of-libname
835 835
836 For each tuple; 836 For each tuple;
837 * LIBDO.libname contains the .OBJDIR of the library 837 * LIBDO.libname contains the .OBJDIR of the library
838 `libname', and if it is not set it is determined 838 `libname', and if it is not set it is determined
839 from the srcdir and added to MAKEOVERRIDES (the 839 from the srcdir and added to MAKEOVERRIDES (the
840 latter is to allow for build time optimization). 840 latter is to allow for build time optimization).
841 * LDADD gets -L${LIBDO.libname} -llibname added. 841 * LDADD gets -L${LIBDO.libname} -llibname added.
842 * DPADD gets ${LIBDO.libname}/liblibname.so or 842 * DPADD gets ${LIBDO.libname}/liblibname.so or
843 ${LIBDO.libname}/liblibname.a added. 843 ${LIBDO.libname}/liblibname.a added.
844 844
845 This variable may be used for individual libraries, as 845 This variable may be used for individual libraries, as
846 well as in parent directories to cache common libraries  846 well as in parent directories to cache common libraries
847 as a build-time optimization. 847 as a build-time optimization.
848 848
849The include file <bsd.lib.mk> includes the file named "../Makefile.inc" 849The include file <bsd.lib.mk> includes the file named "../Makefile.inc"
850if it exists, as well as the include file <bsd.man.mk>. 850if it exists, as well as the include file <bsd.man.mk>.
851 851
852It has rules for building profiled objects; profiled libraries are 852It has rules for building profiled objects; profiled libraries are
853built by default. 853built by default.
854 854
855Libraries are ranlib'd when made. 855Libraries are ranlib'd when made.
856 856
857 857
858=-=-=-=-= bsd.links.mk =-=-=-=-= 858=-=-=-=-= bsd.links.mk =-=-=-=-=
859 859
860The include file <bsd.links.mk> handles the LINKS and SYMLINKS variables 860The include file <bsd.links.mk> handles the LINKS and SYMLINKS variables
861and is included from from <bsd.lib.mk> and <bsd.prog.mk>. 861and is included from from <bsd.lib.mk> and <bsd.prog.mk>.
862 862
863LINKS The list of hard links, consisting of pairs of paths: 863LINKS The list of hard links, consisting of pairs of paths:
864 source-file target-file 864 source-file target-file
865 ${DESTDIR} is prepended to both paths before linking. 865 ${DESTDIR} is prepended to both paths before linking.
866 For example, to link /bin/test and /bin/[, use: 866 For example, to link /bin/test and /bin/[, use:
867 LINKS=/bin/test /bin/[ 867 LINKS=/bin/test /bin/[
868 868
869CONFIGLINKS Similar semantics to LINKS, except that the links 869CONFIGLINKS Similar semantics to LINKS, except that the links
870 are installed by the `configinstall' target, 870 are installed by the `configinstall' target,
871 not the `install' target. 871 not the `install' target.
872 872
873SYMLINKS The list of symbolic links, consisting of pairs of paths: 873SYMLINKS The list of symbolic links, consisting of pairs of paths:
874 source-file target-file 874 source-file target-file
875 ${DESTDIR} is only prepended to target-file before linking. 875 ${DESTDIR} is only prepended to target-file before linking.
876 For example, to symlink /usr/bin/tar to /bin/tar resulting 876 For example, to symlink /usr/bin/tar to /bin/tar resulting
877 in ${DESTDIR}/usr/bin/tar -> /bin/tar: 877 in ${DESTDIR}/usr/bin/tar -> /bin/tar:
878 SYMLINKS=/bin/tar /usr/bin/tar 878 SYMLINKS=/bin/tar /usr/bin/tar
879 879
880CONFIGSYMLINKS Similar semantics to SYMLINKS, except that the symbolic links 880CONFIGSYMLINKS Similar semantics to SYMLINKS, except that the symbolic links
881 are installed by the `configinstall' target, 881 are installed by the `configinstall' target,
882 not the `install' target. 882 not the `install' target.
883 883
884 884
885=-=-=-=-= bsd.man.mk =-=-=-=-= 885=-=-=-=-= bsd.man.mk =-=-=-=-=
886 886
887The include file <bsd.man.mk> handles installing manual pages and their 887The include file <bsd.man.mk> handles installing manual pages and their
888links. 888links.
889 889
890It has a three targets: 890It has a three targets:
891 891
892 catinstall: 892 catinstall:
893 Install the preformatted manual pages and their links. 893 Install the preformatted manual pages and their links.
894 htmlinstall: 894 htmlinstall:
895 Install the HTML manual pages and their links. 895 Install the HTML manual pages and their links.
896 maninstall: 896 maninstall:
897 Install the manual page sources and their links. 897 Install the manual page sources and their links.
898 898
899It sets/uses the following variables: 899It sets/uses the following variables:
900 900
901MANDIR Base path for manual installation. 901MANDIR Base path for manual installation.
902 902
903MANGRP Manual group. 903MANGRP Manual group.
904 904
905MANOWN Manual owner. 905MANOWN Manual owner.
906 906
907MANMODE Manual mode. 907MANMODE Manual mode.
908 908
909MANSUBDIR Subdirectory under the manual page section, i.e. "/vax" 909MANSUBDIR Subdirectory under the manual page section, i.e. "/vax"
910 or "/tahoe" for machine specific manual pages. 910 or "/tahoe" for machine specific manual pages.
911 911
912MAN The manual pages to be installed (use a .1 - .9 suffix). 912MAN The manual pages to be installed (use a .1 - .9 suffix).
913 913
914MLINKS List of manual page links (using a .1 - .9 suffix). The 914MLINKS List of manual page links (using a .1 - .9 suffix). The
915 linked-to file must come first, the linked file second, 915 linked-to file must come first, the linked file second,
916 and there may be multiple pairs. The files are soft-linked. 916 and there may be multiple pairs. The files are soft-linked.
917 917
918The include file <bsd.man.mk> includes a file named "../Makefile.inc" if 918The include file <bsd.man.mk> includes a file named "../Makefile.inc" if
919it exists. 919it exists.
920 920
921 921
922=-=-=-=-= bsd.obj.mk =-=-=-=-= 922=-=-=-=-= bsd.obj.mk =-=-=-=-=
923 923
924The include file <bsd.obj.mk> defines targets related to the creation 924The include file <bsd.obj.mk> defines targets related to the creation
925and use of separated object and source directories. 925and use of separated object and source directories.
926 926
927If an environment variable named MAKEOBJDIRPREFIX is set, make(1) uses 927If an environment variable named MAKEOBJDIRPREFIX is set, make(1) uses
928${MAKEOBJDIRPREFIX}${.CURDIR} as the name of the object directory if 928${MAKEOBJDIRPREFIX}${.CURDIR} as the name of the object directory if
929it exists. Otherwise make(1) looks for the existence of a 929it exists. Otherwise make(1) looks for the existence of a
930subdirectory (or a symlink to a directory) of the source directory 930subdirectory (or a symlink to a directory) of the source directory
931into which built targets should be placed. If an environment variable 931into which built targets should be placed. If an environment variable
932named MAKEOBJDIR is set, make(1) uses its value as the name of the 932named MAKEOBJDIR is set, make(1) uses its value as the name of the
933object directory; failing that, make first looks for a subdirectory 933object directory; failing that, make first looks for a subdirectory
934named "obj.${MACHINE}", and if that doesn't exist, it looks for "obj". 934named "obj.${MACHINE}", and if that doesn't exist, it looks for "obj".
935 935
936Object directories are not created automatically by make(1) if they 936Object directories are not created automatically by make(1) if they
937don't exist; you need to run a separate "make obj". (This will happen 937don't exist; you need to run a separate "make obj". (This will happen
938during a top-level build if "MKOBJDIRS" is set to a value other than 938during a top-level build if "MKOBJDIRS" is set to a value other than
939"no"). When the source directory is a subdirectory of ${BSDSRCDIR} -- 939"no"). When the source directory is a subdirectory of ${BSDSRCDIR} --
940and this is determined by a simple string prefix comparison -- object 940and this is determined by a simple string prefix comparison -- object
941directories are created in a separate object directory tree, and a 941directories are created in a separate object directory tree, and a
942symlink to the object directory in that tree is created in the source 942symlink to the object directory in that tree is created in the source
943directory; otherwise, "make obj" assumes that you're not in the main 943directory; otherwise, "make obj" assumes that you're not in the main
944source tree and that it's not safe to use a separate object tree. 944source tree and that it's not safe to use a separate object tree.
945 945
946Several variables used by <bsd.obj.mk> control exactly what 946Several variables used by <bsd.obj.mk> control exactly what
947directories and links get created during a "make obj": 947directories and links get created during a "make obj":
948 948
949MAKEOBJDIR If set, this is the component name of the object 949MAKEOBJDIR If set, this is the component name of the object
950 directory. 950 directory.
951 951
952OBJMACHINE If this is set but MAKEOBJDIR is not set, creates 952OBJMACHINE If this is set but MAKEOBJDIR is not set, creates
953 object directories or links named "obj.${MACHINE}"; 953 object directories or links named "obj.${MACHINE}";
954 otherwise, just creates ones named "obj". 954 otherwise, just creates ones named "obj".
955 955
956USR_OBJMACHINE If set, and the current directory is a subdirectory of 956USR_OBJMACHINE If set, and the current directory is a subdirectory of
957 ${BSDSRCDIR}, create object directory in the 957 ${BSDSRCDIR}, create object directory in the
958 corresponding subdirectory of ${BSDOBJDIR}.${MACHINE}; 958 corresponding subdirectory of ${BSDOBJDIR}.${MACHINE};
959 otherwise, create it in the corresponding subdirectory 959 otherwise, create it in the corresponding subdirectory
960 of ${BSDOBJDIR} 960 of ${BSDOBJDIR}
961 961
962BUILDID If set, the contents of this variable are appended 962BUILDID If set, the contents of this variable are appended
963 to the object directory name. If OBJMACHINE is also 963 to the object directory name. If OBJMACHINE is also
964 set, ".${BUILDID}" is added after ".${MACHINE}". 964 set, ".${BUILDID}" is added after ".${MACHINE}".
965 965
966 966
967=-=-=-=-= bsd.prog.mk =-=-=-=-= 967=-=-=-=-= bsd.prog.mk =-=-=-=-=
968 968
969The include file <bsd.prog.mk> handles building programs from one or 969The include file <bsd.prog.mk> handles building programs from one or
970more source files, along with their manual pages. It has a limited number 970more source files, along with their manual pages. It has a limited number
971of suffixes, consistent with the current needs of the BSD tree.  971of suffixes, consistent with the current needs of the BSD tree.
972<bsd.prog.mk> includes <bsd.shlib.mk> to get shared library parameters. 972<bsd.prog.mk> includes <bsd.shlib.mk> to get shared library parameters.
973 973
974It has eight targets: 974It has eight targets:
975 975
976 all: 976 all:
977 build the program and its manual page. This also 977 build the program and its manual page. This also
978 creates a GDB initialization file (.gdbinit) in 978 creates a GDB initialization file (.gdbinit) in
979 the objdir. The .gdbinit file sets the shared library 979 the objdir. The .gdbinit file sets the shared library
980 prefix to ${DESTDIR} to facilitate cross-debugging. 980 prefix to ${DESTDIR} to facilitate cross-debugging.
981 clean: 981 clean:
982 remove the program, any object files and the files a.out, 982 remove the program, any object files and the files a.out,
983 Errs, errs, mklog, and ${PROG}.core. 983 Errs, errs, mklog, and ${PROG}.core.
984 cleandir: 984 cleandir:
985 remove all of the files removed by the target clean, as 985 remove all of the files removed by the target clean, as
986 well as .depend, tags, and any manual pages. 986 well as .depend, tags, and any manual pages.
987 `distclean' is a synonym for `cleandir'. 987 `distclean' is a synonym for `cleandir'.
988 depend: 988 depend:
989 make the dependencies for the source files, and store 989 make the dependencies for the source files, and store
990 them in the file .depend. 990 them in the file .depend.
991 includes: 991 includes:
992 install any header files. 992 install any header files.
993 install: 993 install:
994 install the program and its manual pages; if the Makefile 994 install the program and its manual pages; if the Makefile
995 does not itself define the target install, the targets 995 does not itself define the target install, the targets
996 beforeinstall and afterinstall may also be used to cause 996 beforeinstall and afterinstall may also be used to cause
997 actions immediately before and after the install target 997 actions immediately before and after the install target
998 is executed. 998 is executed.
999 lint: 999 lint:
1000 run lint on the source files 1000 run lint on the source files
1001 tags: 1001 tags:
1002 create a tags file for the source files. 1002 create a tags file for the source files.
1003 1003
1004It sets/uses the following variables: 1004It sets/uses the following variables:
1005 1005
1006BINGRP Binary group. 1006BINGRP Binary group.
1007 1007
1008BINOWN Binary owner. 1008BINOWN Binary owner.
1009 1009
1010BINMODE Binary mode. 1010BINMODE Binary mode.
1011 1011
1012CLEANFILES Additional files to remove for the clean and cleandir targets. 1012CLEANFILES Additional files to remove for the clean and cleandir targets.
1013 1013
1014COPTS Additional flags to the compiler when creating C objects. 1014COPTS Additional flags to the compiler when creating C objects.
1015 1015
1016COPTS.<fn> Additional flags to the compiler when creating the 1016COPTS.<fn> Additional flags to the compiler when creating the
1017 C objects for <fn>. 1017 C objects for <fn>.
1018 For <fn>.[ly], "<fn>.c" must be used. 1018 For <fn>.[ly], "<fn>.c" must be used.
1019 1019
1020CPUFLAGS Additional flags to the compiler/assembler to select 1020CPUFLAGS Additional flags to the compiler/assembler to select
1021 CPU instruction set options, CPU tuning options, etc. 1021 CPU instruction set options, CPU tuning options, etc.
1022 1022
1023CPUFLAGS.<fn> Additional flags to the compiler/assembler for <fn>. 1023CPUFLAGS.<fn> Additional flags to the compiler/assembler for <fn>.
1024 For <fn>.[ly], "<fn>.c" must be used. 1024 For <fn>.[ly], "<fn>.c" must be used.
1025 1025
1026CPPFLAGS Additional flags to the C pre-processor. 1026CPPFLAGS Additional flags to the C pre-processor.
1027 1027
1028CPPFLAGS.<fn> Additional flags to the C pre-processor for <fn>. 1028CPPFLAGS.<fn> Additional flags to the C pre-processor for <fn>.
1029 For <fn>.[ly], "<fn>.c" must be used. 1029 For <fn>.[ly], "<fn>.c" must be used.
1030 1030
1031GDBINIT List of GDB initialization files to add to "source" 1031GDBINIT List of GDB initialization files to add to "source"
1032 directives in the .gdbinit file that is created in the 1032 directives in the .gdbinit file that is created in the
1033 objdir. 1033 objdir.
1034 1034
1035LDADD Additional loader objects. Usually used for libraries. 1035LDADD Additional loader objects. Usually used for libraries.
1036 For example, to load with the compatibility and utility 1036 For example, to load with the compatibility and utility
1037 libraries, use: 1037 libraries, use:
1038 1038
1039 LDADD+=-lutil -lcompat 1039 LDADD+=-lutil -lcompat
1040 1040
1041LDFLAGS Additional linker flags (passed to ${CC} during link). 1041LDFLAGS Additional linker flags (passed to ${CC} during link).
1042 1042
1043LINKS See <bsd.links.mk> 1043LINKS See <bsd.links.mk>
1044 1044
1045OBJCOPTS Additional flags to the compiler when creating ObjC objects. 1045OBJCOPTS Additional flags to the compiler when creating ObjC objects.
1046 1046
1047OBJCOPTS.<fn> Additional flags to the compiler when creating the 1047OBJCOPTS.<fn> Additional flags to the compiler when creating the
1048 ObjC objects for <fn>. 1048 ObjC objects for <fn>.
1049 For <fn>.[ly], "<fn>.c" must be used. 1049 For <fn>.[ly], "<fn>.c" must be used.
1050 1050
1051SYMLINKS See <bsd.links.mk> 1051SYMLINKS See <bsd.links.mk>
1052 1052
1053MAN Manual pages (should end in .1 - .9). If no MAN variable is 1053MAN Manual pages (should end in .1 - .9). If no MAN variable is
1054 defined, "MAN=${PROG}.1" is assumed. 1054 defined, "MAN=${PROG}.1" is assumed.
1055 1055
1056PAXCTL_FLAGS If defined, run paxctl(1) on the program binary after link 1056PAXCTL_FLAGS If defined, run paxctl(1) on the program binary after link
1057 time, with the value of this variable as args to paxctl(1). 1057 time, with the value of this variable as args to paxctl(1).
1058 1058
1059PAXCTL_FLAGS.${PROG} Custom override for PAXCTL_FLAGS. 1059PAXCTL_FLAGS.${PROG} Custom override for PAXCTL_FLAGS.
1060 1060
1061PROG The name of the program to build. If not supplied, nothing 1061PROG The name of the program to build. If not supplied, nothing
1062 is built. 1062 is built.
1063 1063
1064PROG_CXX If defined, the name of the program to build. Also 1064PROG_CXX If defined, the name of the program to build. Also
1065 causes <bsd.prog.mk> to link the program with the C++ 1065 causes <bsd.prog.mk> to link the program with the C++
1066 compiler rather than the C compiler. PROG_CXX overrides 1066 compiler rather than the C compiler. PROG_CXX overrides
1067 the value of PROG if PROG is also set. 1067 the value of PROG if PROG is also set.
1068 1068
1069PROGNAME The name that the above program will be installed as, if 1069PROGNAME The name that the above program will be installed as, if
1070 different from ${PROG}. 1070 different from ${PROG}.
1071 1071
1072SRCS List of source files to build the program. If SRCS is not 1072SRCS List of source files to build the program. If SRCS is not
1073 defined, it's assumed to be ${PROG}.c. 1073 defined, it's assumed to be ${PROG}.c.
1074 1074
1075DPSRCS List of source files which are needed for generating 1075DPSRCS List of source files which are needed for generating
1076 dependencies, but are not needed in ${SRCS}. 1076 dependencies, but are not needed in ${SRCS}.
1077 1077
1078DPADD Additional dependencies for the program. Usually used for 1078DPADD Additional dependencies for the program. Usually used for
1079 libraries. For example, to depend on the compatibility and 1079 libraries. For example, to depend on the compatibility and
1080 utility libraries use: 1080 utility libraries use:
1081 1081
1082 DPADD+=${LIBCOMPAT} ${LIBUTIL} 1082 DPADD+=${LIBCOMPAT} ${LIBUTIL}
1083 1083
1084 The following libraries are predefined for DPADD: 1084 The following libraries are predefined for DPADD:
1085 1085
1086 LIBCRT0?= ${DESTDIR}/usr/lib/crt0.o 1086 LIBCRT0?= ${DESTDIR}/usr/lib/crt0.o
1087 LIBARCHIVE?= ${DESTDIR}/usr/lib/libarchive.a 1087 LIBARCHIVE?= ${DESTDIR}/usr/lib/libarchive.a
1088 LIBASN1?= ${DESTDIR}/usr/lib/libasn1.a 1088 LIBASN1?= ${DESTDIR}/usr/lib/libasn1.a
1089 LIBBLUETOOTH?= ${DESTDIR}/usr/lib/libbluetooth.a 1089 LIBBLUETOOTH?= ${DESTDIR}/usr/lib/libbluetooth.a
1090 LIBBSDMALLOC?= ${DESTDIR}/usr/lib/libbsdmalloc.a 1090 LIBBSDMALLOC?= ${DESTDIR}/usr/lib/libbsdmalloc.a
1091 LIBBZ2?= ${DESTDIR}/usr/lib/libbz2.a 1091 LIBBZ2?= ${DESTDIR}/usr/lib/libbz2.a
1092 LIBC?= ${DESTDIR}/usr/lib/libc.a 1092 LIBC?= ${DESTDIR}/usr/lib/libc.a
1093 LIBC_PIC?= ${DESTDIR}/usr/lib/libc_pic.a 1093 LIBC_PIC?= ${DESTDIR}/usr/lib/libc_pic.a
1094 LIBCOM_ERR?= ${DESTDIR}/usr/lib/libcom_err.a 1094 LIBCOM_ERR?= ${DESTDIR}/usr/lib/libcom_err.a
1095 LIBCOMPAT?= ${DESTDIR}/usr/lib/libcompat.a 1095 LIBCOMPAT?= ${DESTDIR}/usr/lib/libcompat.a
1096 LIBCRYPT?= ${DESTDIR}/usr/lib/libcrypt.a 1096 LIBCRYPT?= ${DESTDIR}/usr/lib/libcrypt.a
1097 LIBCRYPTO?= ${DESTDIR}/usr/lib/libcrypto.a 1097 LIBCRYPTO?= ${DESTDIR}/usr/lib/libcrypto.a
1098 LIBCRYPTO_IDEA?=${DESTDIR}/usr/lib/libcrypto_idea.a 1098 LIBCRYPTO_IDEA?=${DESTDIR}/usr/lib/libcrypto_idea.a
1099 LIBCRYPTO_MDC2?=${DESTDIR}/usr/lib/libcrypto_mdc2.a 1099 LIBCRYPTO_MDC2?=${DESTDIR}/usr/lib/libcrypto_mdc2.a
1100 LIBCRYPTO_RC5?= ${DESTDIR}/usr/lib/libcrypto_rc5.a 1100 LIBCRYPTO_RC5?= ${DESTDIR}/usr/lib/libcrypto_rc5.a
1101 LIBCURSES?= ${DESTDIR}/usr/lib/libcurses.a 1101 LIBCURSES?= ${DESTDIR}/usr/lib/libcurses.a
1102 LIBDBM?= ${DESTDIR}/usr/lib/libdbm.a 1102 LIBDBM?= ${DESTDIR}/usr/lib/libdbm.a
1103 LIBDES?= ${DESTDIR}/usr/lib/libdes.a 1103 LIBDES?= ${DESTDIR}/usr/lib/libdes.a
1104 LIBEDIT?= ${DESTDIR}/usr/lib/libedit.a 1104 LIBEDIT?= ${DESTDIR}/usr/lib/libedit.a
1105 LIBEVENT?= ${DESTDIR}/usr/lib/libevent.a 1105 LIBEVENT?= ${DESTDIR}/usr/lib/libevent.a
1106 LIBFETCH?= ${DESTDIR}/usr/lib/libfetch.a 1106 LIBFETCH?= ${DESTDIR}/usr/lib/libfetch.a
1107 LIBFORM?= ${DESTDIR}/usr/lib/libform.a 1107 LIBFORM?= ${DESTDIR}/usr/lib/libform.a
1108 LIBGCC?= ${DESTDIR}/usr/lib/libgcc.a 1108 LIBGCC?= ${DESTDIR}/usr/lib/libgcc.a
1109 LIBGNUMALLOC?= ${DESTDIR}/usr/lib/libgnumalloc.a 1109 LIBGNUMALLOC?= ${DESTDIR}/usr/lib/libgnumalloc.a
1110 LIBGSSAPI?= ${DESTDIR}/usr/lib/libgssapi.a 1110 LIBGSSAPI?= ${DESTDIR}/usr/lib/libgssapi.a
1111 LIBHDB?= ${DESTDIR}/usr/lib/libhdb.a 1111 LIBHDB?= ${DESTDIR}/usr/lib/libhdb.a
1112 LIBINTL?= ${DESTDIR}/usr/lib/libintl.a 1112 LIBINTL?= ${DESTDIR}/usr/lib/libintl.a
1113 LIBIPSEC?= ${DESTDIR}/usr/lib/libipsec.a 1113 LIBIPSEC?= ${DESTDIR}/usr/lib/libipsec.a
1114 LIBKADM5CLNT?= ${DESTDIR}/usr/lib/libkadm5clnt.a 1114 LIBKADM5CLNT?= ${DESTDIR}/usr/lib/libkadm5clnt.a
1115 LIBKADM5SRV?= ${DESTDIR}/usr/lib/libkadm5srv.a 1115 LIBKADM5SRV?= ${DESTDIR}/usr/lib/libkadm5srv.a
1116 LIBKAFS?= ${DESTDIR}/usr/lib/libkafs.a 1116 LIBKAFS?= ${DESTDIR}/usr/lib/libkafs.a
1117 LIBKRB5?= ${DESTDIR}/usr/lib/libkrb5.a 1117 LIBKRB5?= ${DESTDIR}/usr/lib/libkrb5.a
1118 LIBKVM?= ${DESTDIR}/usr/lib/libkvm.a 1118 LIBKVM?= ${DESTDIR}/usr/lib/libkvm.a
1119 LIBL?= ${DESTDIR}/usr/lib/libl.a 1119 LIBL?= ${DESTDIR}/usr/lib/libl.a
1120 LIBLBER?= ${DESTDIR}/usr/lib/liblber.a 1120 LIBLBER?= ${DESTDIR}/usr/lib/liblber.a
1121 LIBLDAP?= ${DESTDIR}/usr/lib/libldap.a 1121 LIBLDAP?= ${DESTDIR}/usr/lib/libldap.a
1122 LIBLDAP_R?= ${DESTDIR}/usr/lib/libldap_r.a 1122 LIBLDAP_R?= ${DESTDIR}/usr/lib/libldap_r.a
1123 LIBM?= ${DESTDIR}/usr/lib/libm.a 1123 LIBM?= ${DESTDIR}/usr/lib/libm.a
1124 LIBMENU?= ${DESTDIR}/usr/lib/libmenu.a 1124 LIBMENU?= ${DESTDIR}/usr/lib/libmenu.a
1125 LIBOBJC?= ${DESTDIR}/usr/lib/libobjc.a 1125 LIBOBJC?= ${DESTDIR}/usr/lib/libobjc.a
1126 LIBOSSAUDIO?= ${DESTDIR}/usr/lib/libossaudio.a 1126 LIBOSSAUDIO?= ${DESTDIR}/usr/lib/libossaudio.a
1127 LIBPAM?= ${DESTDIR}/usr/lib/libpam.a 1127 LIBPAM?= ${DESTDIR}/usr/lib/libpam.a
1128 LIBPCAP?= ${DESTDIR}/usr/lib/libpcap.a 1128 LIBPCAP?= ${DESTDIR}/usr/lib/libpcap.a
1129 LIBPCI?= ${DESTDIR}/usr/lib/libpci.a 1129 LIBPCI?= ${DESTDIR}/usr/lib/libpci.a
1130 LIBPMC?= ${DESTDIR}/usr/lib/libpmc.a 1130 LIBPMC?= ${DESTDIR}/usr/lib/libpmc.a
1131 LIBPOSIX?= ${DESTDIR}/usr/lib/libposix.a 1131 LIBPOSIX?= ${DESTDIR}/usr/lib/libposix.a
1132 LIBPTHREAD?= ${DESTDIR}/usr/lib/libpthread.a 1132 LIBPTHREAD?= ${DESTDIR}/usr/lib/libpthread.a
1133 LIBPTHREAD_DBG?=${DESTDIR}/usr/lib/libpthread_dbg.a 1133 LIBPTHREAD_DBG?=${DESTDIR}/usr/lib/libpthread_dbg.a
1134 LIBRADIUS?= ${DESTDIR}/usr/lib/libradius.a 1134 LIBRADIUS?= ${DESTDIR}/usr/lib/libradius.a
1135 LIBRESOLV?= ${DESTDIR}/usr/lib/libresolv.a 1135 LIBRESOLV?= ${DESTDIR}/usr/lib/libresolv.a
1136 LIBRMT?= ${DESTDIR}/usr/lib/librmt.a 1136 LIBRMT?= ${DESTDIR}/usr/lib/librmt.a
1137 LIBROKEN?= ${DESTDIR}/usr/lib/libroken.a 1137 LIBROKEN?= ${DESTDIR}/usr/lib/libroken.a
1138 LIBRPCSVC?= ${DESTDIR}/usr/lib/librpcsvc.a 1138 LIBRPCSVC?= ${DESTDIR}/usr/lib/librpcsvc.a
1139 LIBRT?= ${DESTDIR}/usr/lib/librt.a 1139 LIBRT?= ${DESTDIR}/usr/lib/librt.a
1140 LIBSDP?= ${DESTDIR}/usr/lib/libsdp.a 1140 LIBSDP?= ${DESTDIR}/usr/lib/libsdp.a
1141 LIBSKEY?= ${DESTDIR}/usr/lib/libskey.a 1141 LIBSKEY?= ${DESTDIR}/usr/lib/libskey.a
1142 LIBSL?= ${DESTDIR}/usr/lib/libsl.a 1142 LIBSL?= ${DESTDIR}/usr/lib/libsl.a
1143 LIBSS?= ${DESTDIR}/usr/lib/libss.a 1143 LIBSS?= ${DESTDIR}/usr/lib/libss.a
1144 LIBSSH?= ${DESTDIR}/usr/lib/libssh.a 1144 LIBSSH?= ${DESTDIR}/usr/lib/libssh.a
1145 LIBSSL?= ${DESTDIR}/usr/lib/libssl.a 1145 LIBSSL?= ${DESTDIR}/usr/lib/libssl.a
1146 LIBSSP?= ${DESTDIR}/usr/lib/libssp.a 1146 LIBSSP?= ${DESTDIR}/usr/lib/libssp.a
1147 LIBSTDCXX?= ${DESTDIR}/usr/lib/libstdc++.a 1147 LIBSTDCXX?= ${DESTDIR}/usr/lib/libstdc++.a
1148 LIBSUPCXX?= ${DESTDIR}/usr/lib/libsupc++.a 1148 LIBSUPCXX?= ${DESTDIR}/usr/lib/libsupc++.a
1149 LIBTERMCAP?= ${DESTDIR}/usr/lib/libtermcap.a 1149 LIBTERMCAP?= ${DESTDIR}/usr/lib/libtermcap.a
1150 LIBUSBHID?= ${DESTDIR}/usr/lib/libusbhid.a 1150 LIBUSBHID?= ${DESTDIR}/usr/lib/libusbhid.a
1151 LIBUTIL?= ${DESTDIR}/usr/lib/libutil.a 1151 LIBUTIL?= ${DESTDIR}/usr/lib/libutil.a
1152 LIBWRAP?= ${DESTDIR}/usr/lib/libwrap.a 1152 LIBWRAP?= ${DESTDIR}/usr/lib/libwrap.a
1153 LIBY?= ${DESTDIR}/usr/lib/liby.a 1153 LIBY?= ${DESTDIR}/usr/lib/liby.a
1154 LIBZ?= ${DESTDIR}/usr/lib/libz.a 1154 LIBZ?= ${DESTDIR}/usr/lib/libz.a
1155 1155
1156SHAREDSTRINGS If defined, a new .c.o rule is used that results in shared 1156SHAREDSTRINGS If defined, a new .c.o rule is used that results in shared
1157 strings, using xstr(1). Note that this will not work with 1157 strings, using xstr(1). Note that this will not work with
1158 parallel makes. 1158 parallel makes.
1159 1159
1160STRIPFLAG The flag passed to the install program to cause the binary 1160STRIPFLAG The flag passed to the install program to cause the binary
1161 to be stripped. 1161 to be stripped.
1162 1162
1163SUBDIR A list of subdirectories that should be built as well. 1163SUBDIR A list of subdirectories that should be built as well.
1164 Each of the targets will execute the same target in the 1164 Each of the targets will execute the same target in the
1165 subdirectories. 1165 subdirectories.
1166 1166
1167SCRIPTS A list of interpreter scripts [file.{sh,csh,pl,awk,...}]. 1167SCRIPTS A list of interpreter scripts [file.{sh,csh,pl,awk,...}].
1168 These are installed exactly like programs. 1168 These are installed exactly like programs.
1169 1169
1170SCRIPTSDIR The location to install the scripts. Each script can be 1170SCRIPTSDIR The location to install the scripts. Each script can be
1171 installed to a separate path by setting SCRIPTSDIR_<script>. 1171 installed to a separate path by setting SCRIPTSDIR_<script>.
1172 1172
1173SCRIPTSNAME The name that the above program will be installed as, if 1173SCRIPTSNAME The name that the above program will be installed as, if
1174 different from ${SCRIPTS}. These can be further specialized 1174 different from ${SCRIPTS}. These can be further specialized
1175 by setting SCRIPTSNAME_<script>. 1175 by setting SCRIPTSNAME_<script>.
1176 1176
1177FILES See description of <bsd.files.mk>. 1177FILES See description of <bsd.files.mk>.
1178 1178
1179SHLINKDIR Target directory for shared linker. See description of 1179SHLINKDIR Target directory for shared linker. See description of
1180 <bsd.own.mk> for additional information about this variable. 1180 <bsd.own.mk> for additional information about this variable.
1181 1181
1182The include file <bsd.prog.mk> includes the file named "../Makefile.inc" 1182The include file <bsd.prog.mk> includes the file named "../Makefile.inc"
1183if it exists, as well as the include file <bsd.man.mk>. 1183if it exists, as well as the include file <bsd.man.mk>.
1184 1184
1185Some simple examples: 1185Some simple examples:
1186 1186
1187To build foo from foo.c with a manual page foo.1, use: 1187To build foo from foo.c with a manual page foo.1, use:
1188 1188
1189 PROG= foo 1189 PROG= foo
1190 1190
1191 .include <bsd.prog.mk> 1191 .include <bsd.prog.mk>
1192 1192
1193To build foo from foo.c with a manual page foo.2, add the line: 1193To build foo from foo.c with a manual page foo.2, add the line:
1194 1194
1195 MAN= foo.2 1195 MAN= foo.2
1196 1196
1197If foo does not have a manual page at all, add the line: 1197If foo does not have a manual page at all, add the line:
1198 1198
1199 MKMAN= no 1199 MKMAN= no
1200 1200
1201If foo has multiple source files, add the line: 1201If foo has multiple source files, add the line:
1202 1202
1203 SRCS= a.c b.c c.c d.c 1203 SRCS= a.c b.c c.c d.c
1204 1204
1205 1205
1206=-=-=-=-= bsd.rpc.mk =-=-=-=-= 1206=-=-=-=-= bsd.rpc.mk =-=-=-=-=
1207 1207
1208The include file <bsd.rpc.mk> contains a makefile fragment used to 1208The include file <bsd.rpc.mk> contains a makefile fragment used to
1209construct source files built by rpcgen. 1209construct source files built by rpcgen.
1210 1210
1211The following macros may be defined in makefiles which include 1211The following macros may be defined in makefiles which include
1212<bsd.rpc.mk> in order to control which files get built and how they 1212<bsd.rpc.mk> in order to control which files get built and how they
1213are to be built: 1213are to be built:
1214 1214
1215RPC_INCS: construct .h file from .x file 1215RPC_INCS: construct .h file from .x file
1216RPC_XDRFILES: construct _xdr.c from .x file 1216RPC_XDRFILES: construct _xdr.c from .x file
1217 (for marshalling/unmarshalling data types) 1217 (for marshalling/unmarshalling data types)
1218RPC_SVCFILES: construct _svc.c from .x file 1218RPC_SVCFILES: construct _svc.c from .x file
1219 (server-side stubs) 1219 (server-side stubs)
1220RPC_SVCFLAGS: Additional flags passed to builds of RPC_SVCFILES. 1220RPC_SVCFLAGS: Additional flags passed to builds of RPC_SVCFILES.
1221 1221
1222RPC_XDIR: Directory containing .x/.h files 1222RPC_XDIR: Directory containing .x/.h files
1223 1223
1224 1224
1225=-=-=-=-= bsd.shlib.mk =-=-=-=-= 1225=-=-=-=-= bsd.shlib.mk =-=-=-=-=
1226 1226
1227The include file <bsd.shlib.mk> computes parameters for shared library 1227The include file <bsd.shlib.mk> computes parameters for shared library
1228installation and use. It defines no targets. <bsd.own.mk> MUST be 1228installation and use. It defines no targets. <bsd.own.mk> MUST be
1229included before <bsd.shlib.mk>. 1229included before <bsd.shlib.mk>.
1230 1230
1231<bsd.own.mk> sets the following variables, if they are not already defined 1231<bsd.own.mk> sets the following variables, if they are not already defined
1232(defaults are in brackets): 1232(defaults are in brackets):
1233 1233
1234SHLIBINSTALLDIR If ${USE_SHLIBDIR} is not "no", use ${SHLIBINSTALLDIR} 1234SHLIBINSTALLDIR If ${USE_SHLIBDIR} is not "no", use ${SHLIBINSTALLDIR}
1235 instead of ${LIBDIR} as the base path for shared library 1235 instead of ${LIBDIR} as the base path for shared library
1236 installation. [/lib] 1236 installation. [/lib]
1237 1237
1238SHLIBDIR The path to USE_SHLIBDIR shared libraries to use when building 1238SHLIBDIR The path to USE_SHLIBDIR shared libraries to use when building
1239 a program. [/lib for programs in /bin and /sbin, /usr/lib 1239 a program. [/lib for programs in /bin and /sbin, /usr/lib
1240 for all others.] 1240 for all others.]
1241 1241
1242_LIBSODIR Set to ${SHLIBINSTALLDIR} if ${USE_SHLIBDIR} is not "no", 1242_LIBSODIR Set to ${SHLIBINSTALLDIR} if ${USE_SHLIBDIR} is not "no",
1243 otherwise set to ${LIBDIR} 1243 otherwise set to ${LIBDIR}
1244 1244
1245SHLINKINSTALLDIR Base path for shared linker. [/libexec] 1245SHLINKINSTALLDIR Base path for shared linker. [/libexec]
1246 1246
1247SHLINKDIR Path to use for shared linker when building a program. 1247SHLINKDIR Path to use for shared linker when building a program.
1248 [/libexec for programs in /bin and /sbin, /usr/libexec for 1248 [/libexec for programs in /bin and /sbin, /usr/libexec for
1249 all others.] 1249 all others.]
1250 1250
1251 1251
1252=-=-=-=-= bsd.subdir.mk =-=-=-=-= 1252=-=-=-=-= bsd.subdir.mk =-=-=-=-=
1253 1253
1254The include file <bsd.subdir.mk> contains the default targets for building 1254The include file <bsd.subdir.mk> contains the default targets for building
1255subdirectories. It has the same eight targets as <bsd.prog.mk>: all, 1255subdirectories. It has the same eight targets as <bsd.prog.mk>: all,
1256clean, cleandir, depend, includes, install, lint, and tags. For all of 1256clean, cleandir, depend, includes, install, lint, and tags. For all of
1257the directories listed in ${SUBDIR}, the specified directory will be 1257the directories listed in ${SUBDIR}, the specified directory will be
1258visited and the target made. There is also a default target which allows 1258visited and the target made. There is also a default target which allows
1259the command "make subdir" where subdir is any directory listed in ${SUBDIR}. 1259the command "make subdir" where subdir is any directory listed in ${SUBDIR}.
1260 1260
1261As a special case, the use of a token .WAIT as an entry in SUBDIR acts 1261As a special case, the use of a token .WAIT as an entry in SUBDIR acts
1262as a synchronization barrier when multiple make jobs are run; subdirs 1262as a synchronization barrier when multiple make jobs are run; subdirs
1263before the .WAIT must complete before any subdirs after .WAIT are 1263before the .WAIT must complete before any subdirs after .WAIT are
1264started. See make(1) for some caveats on use of .WAIT and other 1264started. See make(1) for some caveats on use of .WAIT and other
1265special sources. 1265special sources.
1266 1266
1267 1267
1268=-=-=-=-= bsd.sys.mk =-=-=-=-= 1268=-=-=-=-= bsd.sys.mk =-=-=-=-=
1269 1269
1270The include file <bsd.sys.mk> is used by <bsd.prog.mk> and 1270The include file <bsd.sys.mk> is used by <bsd.prog.mk> and
1271<bsd.lib.mk>. It contains overrides that are used when building 1271<bsd.lib.mk>. It contains overrides that are used when building
1272the NetBSD source tree. 1272the NetBSD source tree.
1273 1273
1274The following variables control how various files are compiled/built. 1274The following variables control how various files are compiled/built.
1275(Note that these may be overridden in <bsd.own.mk> if USETOOLS == "yes"): 1275(Note that these may be overridden in <bsd.own.mk> if USETOOLS == "yes"):
1276 1276
1277AR Create, modify, and extract from archives. [ar] 1277AR Create, modify, and extract from archives. [ar]
1278 1278
1279ARFLAGS Options to ${AR}. [rl] 1279ARFLAGS Options to ${AR}. [rl]
1280 1280
1281AS Assembler. [as] 1281AS Assembler. [as]
1282 1282
1283AFLAGS Options to ${CC} when compiling or linking .s or .S 1283AFLAGS Options to ${CC} when compiling or linking .s or .S
1284 assembly source files. [] 1284 assembly source files. []
1285 1285
1286BUILDSEED GCC uses random numbers when compiling C++ code. 1286BUILDSEED GCC uses random numbers when compiling C++ code.
1287 If this option is present, seed the random number 1287 If this option is present, seed the random number
1288 generator based on the value, source file names and 1288 generator based on the value, source file names and
1289 the output file name to make builds more deterministic. 1289 the output file name to make builds more deterministic.
1290 Additional information is available in the GCC 1290 Additional information is available in the GCC
1291 documentation of -frandom-seed. 1291 documentation of -frandom-seed.
1292 1292
1293CC C compiler. [cc] 1293CC C compiler. [cc]
1294 1294
1295CFLAGS Options to ${CC}. [Usually -O or -O2] 1295CFLAGS Options to ${CC}. [Usually -O or -O2]
1296 1296
1297CPP C Pre-Processor. [cpp] 1297CPP C Pre-Processor. [cpp]
1298 1298
1299CPPFLAGS Options to ${CPP}. [] 1299CPPFLAGS Options to ${CPP}. []
1300 1300
1301CPUFLAGS Optimization flags for ${CC}. [] 1301CPUFLAGS Optimization flags for ${CC}. []
1302 1302
1303CXX C++ compiler. [c++] 1303CXX C++ compiler. [c++]
1304 1304
1305CXXFLAGS Options to ${CXX}. [${CFLAGS}] 1305CXXFLAGS Options to ${CXX}. [${CFLAGS}]
1306 1306
1307ELF2ECOFF Convert ELF-format executable to ECOFF. [elf2ecoff] 1307ELF2ECOFF Convert ELF-format executable to ECOFF. [elf2ecoff]
1308 1308
1309FC Fortran compiler. [f77] 1309FC Fortran compiler. [f77]
1310 1310
1311FFLAGS Options to {$FC}. [-O] 1311FFLAGS Options to {$FC}. [-O]
1312 1312
1313INSTALL install(1) command. [install] 1313INSTALL install(1) command. [install]
1314 1314
1315LEX Lexical analyzer. [lex] 1315LEX Lexical analyzer. [lex]
1316 1316
1317LFLAGS Options to ${LEX}. [] 1317LFLAGS Options to ${LEX}. []
1318 1318
1319LPREFIX Symbol prefix for ${LEX} (see -P option in lex(1)) [yy] 1319LPREFIX Symbol prefix for ${LEX} (see -P option in lex(1)) [yy]
1320 1320
1321LD Linker. [ld] 1321LD Linker. [ld]
1322 1322
1323LDFLAGS Options to ${CC} during the link process. [] 1323LDFLAGS Options to ${CC} during the link process. []
1324 1324
1325LINT C program verifier. [lint] 1325LINT C program verifier. [lint]
1326 1326
1327LINTFLAGS Options to ${LINT}. [-chapbxzFS] 1327LINTFLAGS Options to ${LINT}. [-chapbxzFS]
1328 1328
1329LORDER List dependencies for object files. [lorder] 1329LORDER List dependencies for object files. [lorder]
1330 1330
1331MAKE make(1). [make] 1331MAKE make(1). [make]
1332 1332
1333MKDEP Construct Makefile dependency list. [mkdep] 1333MKDEP Construct Makefile dependency list. [mkdep]
1334 1334
1335NM List symbols from object files. [nm] 1335NM List symbols from object files. [nm]
1336 1336
1337PC Pascal compiler. [pc] (Not present) 1337PC Pascal compiler. [pc] (Not present)
1338 1338
1339PFLAGS Options to ${PC}. [] 1339PFLAGS Options to ${PC}. []
1340 1340
1341OBJC Objective C compiler. [${CC}] 1341OBJC Objective C compiler. [${CC}]
1342 1342
1343OBJCFLAGS Options to ${OBJC}. [${CFLAGS}] 1343OBJCFLAGS Options to ${OBJC}. [${CFLAGS}]
1344 1344
1345OBJCOPY Copy and translate object files. [objcopy] 1345OBJCOPY Copy and translate object files. [objcopy]
1346 1346
1347OBJDUMP Display information from object files. [objdump] 1347OBJDUMP Display information from object files. [objdump]
1348 1348
1349RANLIB Generate index to archive. [ranlib] 1349RANLIB Generate index to archive. [ranlib]
1350 1350
1351SHELL Shell. [sh] 1351SHELL Shell. [sh]
1352 1352
1353SIZE List section sizes and total size. [size] 1353SIZE List section sizes and total size. [size]
1354 1354
1355STRIP Discard symbols from object files. [strip] 1355STRIP Discard symbols from object files. [strip]
1356 1356
1357TSORT Topological sort of a directed graph. [tsort -q] 1357TSORT Topological sort of a directed graph. [tsort -q]
1358 1358
1359YACC LALR(1) parser generator. [yacc] 1359YACC LALR(1) parser generator. [yacc]
1360 1360
1361YFLAGS Options to ${YACC}. [] 1361YFLAGS Options to ${YACC}. []
1362 1362
1363YHEADER If defined, add "-d" to YFLAGS, and add dependencies 1363YHEADER If defined, add "-d" to YFLAGS, and add dependencies
1364 from <file>.y to <file>.h and <file>.c, and add 1364 from <file>.y to <file>.h and <file>.c, and add
1365 <foo>.h to CLEANFILES. 1365 <foo>.h to CLEANFILES.
1366 1366
1367YPREFIX If defined, add "-p ${YPREFIX}" to YFLAGS. 1367YPREFIX If defined, add "-p ${YPREFIX}" to YFLAGS.
1368 1368
1369 1369
1370The following variables are defined to commands to perform the 1370The following variables are defined to commands to perform the
1371appropriate operation, with the default in [brackets]. 1371appropriate operation, with the default in [brackets].
1372(Note that these are overridden in <bsd.own.mk> if USETOOLS == "yes"): 1372(Note that these are overridden in <bsd.own.mk> if USETOOLS == "yes"):
1373 1373
1374TOOL_ASN1_COMPILE ASN1 compiler. [asn1_compile] 1374TOOL_ASN1_COMPILE ASN1 compiler. [asn1_compile]
1375 1375
1376TOOL_CAP_MKDB Create capability database. [cap_mkdb] 1376TOOL_CAP_MKDB Create capability database. [cap_mkdb]
1377 1377
1378TOOL_CAT Concatenate and print files. [cat] 1378TOOL_CAT Concatenate and print files. [cat]
1379 1379
1380TOOL_CKSUM Display file checksums. [cksum] 1380TOOL_CKSUM Display file checksums. [cksum]
1381 1381
1382TOOL_COMPILE_ET Error table compiler. [compile_et] 1382TOOL_COMPILE_ET Error table compiler. [compile_et]
1383 1383
1384TOOL_CONFIG Build kernel compilation directories. [config] 1384TOOL_CONFIG Build kernel compilation directories. [config]
1385 1385
1386TOOL_CRUNCHGEN Generate crunched binary build environment. [crunchgen] 1386TOOL_CRUNCHGEN Generate crunched binary build environment. [crunchgen]
1387 1387
1388TOOL_CTAGS Create a tags file. [ctags] 1388TOOL_CTAGS Create a tags file. [ctags]
1389 1389
1390TOOL_DB Manipulate db(3) databases. [db] 1390TOOL_DB Manipulate db(3) databases. [db]
1391 1391
1392TOOL_EQN Format equations for groff. [eqn] 1392TOOL_EQN Format equations for groff. [eqn]
1393 1393
1394TOOL_FGEN IEEE 1275 Open Firmware FCode Tokenizer. [fgen] 1394TOOL_FGEN IEEE 1275 Open Firmware FCode Tokenizer. [fgen]
1395 1395
1396TOOL_GENASSYM Generate constants for assembly files. [genassym] 1396TOOL_GENASSYM Generate constants for assembly files. [genassym]
1397 1397
1398TOOL_GENCAT Generate NLS message catalogs. [gencat] 1398TOOL_GENCAT Generate NLS message catalogs. [gencat]
1399 1399
1400TOOL_GROFF Front end for groff document formatting system. [groff] 1400TOOL_GROFF Front end for groff document formatting system. [groff]
1401 1401
1402TOOL_HEXDUMP Ascii, decimal, hexadecimal, octal dump. [hexdump] 1402TOOL_HEXDUMP Ascii, decimal, hexadecimal, octal dump. [hexdump]
1403 1403
1404TOOL_INDXBIB Make bibliographic database's inverted index. [indxbib] 1404TOOL_INDXBIB Make bibliographic database's inverted index. [indxbib]
1405 1405
1406TOOL_INSTALLBOOT Install disk bootstrap software. [installboot] 1406TOOL_INSTALLBOOT Install disk bootstrap software. [installboot]
1407 1407
1408TOOL_INSTALL_INFO Update info/dir entries. [install-info] 1408TOOL_INSTALL_INFO Update info/dir entries. [install-info]
1409 1409
1410TOOL_JOIN Relational database operator. [join] 1410TOOL_JOIN Relational database operator. [join]
1411 1411
1412TOOL_M4 M4 macro language processor. [m4] 1412TOOL_M4 M4 macro language processor. [m4]
1413 1413
1414TOOL_MAKEFS Create file system image from directory tree. [makefs] 1414TOOL_MAKEFS Create file system image from directory tree. [makefs]
1415 1415
1416TOOL_MAKEINFO Translate Texinfo documents. [makeinfo] 1416TOOL_MAKEINFO Translate Texinfo documents. [makeinfo]
1417 1417
1418TOOL_MAKEWHATIS Create a whatis.db database. [makewhatis] 1418TOOL_MAKEWHATIS Create a whatis.db database. [makewhatis]
1419 1419
1420TOOL_MDSETIMAGE Set kernel RAM disk image. [mdsetimage] 1420TOOL_MDSETIMAGE Set kernel RAM disk image. [mdsetimage]
1421 1421
1422TOOL_MENUC Menu compiler. [menuc] 1422TOOL_MENUC Menu compiler. [menuc]
1423 1423
1424TOOL_MKCSMAPPER Make charset mapping table. [mkcsmapper] 1424TOOL_MKCSMAPPER Make charset mapping table. [mkcsmapper]
1425 1425
1426TOOL_MKESDB Make encoding scheme database. [mkesdb] 1426TOOL_MKESDB Make encoding scheme database. [mkesdb]
1427 1427
1428TOOL_MKLOCALE Make LC_CTYPE locale files. [mklocale] 1428TOOL_MKLOCALE Make LC_CTYPE locale files. [mklocale]
1429 1429
1430TOOL_MKMAGIC Create database for file(1). [file] 1430TOOL_MKMAGIC Create database for file(1). [file]
1431 1431
1432TOOL_MKTEMP Make (unique) temporary file name. [mktemp] 1432TOOL_MKTEMP Make (unique) temporary file name. [mktemp]
1433 1433
1434TOOL_MSGC Simple message list compiler. [msgc] 1434TOOL_MSGC Simple message list compiler. [msgc]
1435 1435
1436TOOL_MTREE Map a directory hierarchy. [mtree] 1436TOOL_MTREE Map a directory hierarchy. [mtree]
1437 1437
1438TOOL_PAX Manipulate file archives and copy directories. [pax] 1438TOOL_PAX Manipulate file archives and copy directories. [pax]
1439 1439
1440TOOL_PIC Compile pictures for groff. [pic] 1440TOOL_PIC Compile pictures for groff. [pic]
1441 1441
1442TOOL_POWERPCMKBOOTIMAGE powerpc-mkbootimage (XXXBUILDSH). [powerpc-mkbootimage] 1442TOOL_POWERPCMKBOOTIMAGE powerpc-mkbootimage (XXXBUILDSH). [powerpc-mkbootimage]
1443 1443
1444TOOL_PWD_MKDB Generate the password databases. [pwd_mkdb] 1444TOOL_PWD_MKDB Generate the password databases. [pwd_mkdb]
1445 1445
1446TOOL_REFER Preprocess bibliographic references for groff. [refer] 1446TOOL_REFER Preprocess bibliographic references for groff. [refer]
1447 1447
1448TOOL_ROFF_ASCII Generate ASCII groff output. [nroff] 1448TOOL_ROFF_ASCII Generate ASCII groff output. [nroff]
1449 1449
1450TOOL_ROFF_DVI Generate DVI groff output. [${TOOL_GROFF} -Tdvi] 1450TOOL_ROFF_DVI Generate DVI groff output. [${TOOL_GROFF} -Tdvi]
1451 1451
1452TOOL_ROFF_HTML Generate HTML groff output. 1452TOOL_ROFF_HTML Generate HTML groff output.
1453 [${TOOL_GROFF} -Tlatin1 -mdoc2html] 1453 [${TOOL_GROFF} -Tlatin1 -mdoc2html]
1454 1454
1455TOOL_ROFF_PS Generate PS groff output. [${TOOL_GROFF} -Tps] 1455TOOL_ROFF_PS Generate PS groff output. [${TOOL_GROFF} -Tps]
1456 1456
1457TOOL_ROFF_RAW Generate "raw" groff output. [${TOOL_GROFF} -Z] 1457TOOL_ROFF_RAW Generate "raw" groff output. [${TOOL_GROFF} -Z]
1458 1458
1459TOOL_RPCGEN Remote Procedure Call (RPC) protocol compiler. [rpcgen] 1459TOOL_RPCGEN Remote Procedure Call (RPC) protocol compiler. [rpcgen]
1460 1460
1461TOOL_SOELIM Eliminate .so's from groff input. [soelim] 1461TOOL_SOELIM Eliminate .so's from groff input. [soelim]
1462 1462
1463TOOL_STAT Display file status. [stat] 1463TOOL_STAT Display file status. [stat]
1464 1464
 1465TOOL_SED Stream editor. [sed]
 1466
1465TOOL_STRFILE Create a random access file for storing strings. 1467TOOL_STRFILE Create a random access file for storing strings.
1466 [strfile] 1468 [strfile]
1467 1469
1468TOOL_SUNLABEL Read or modify a SunOS disk label. [sunlabel] 1470TOOL_SUNLABEL Read or modify a SunOS disk label. [sunlabel]
1469 1471
1470TOOL_TBL Format tables for groff. [tbl] 1472TOOL_TBL Format tables for groff. [tbl]
1471 1473
1472TOOL_UUDECODE Uudecode a binary file. [uudecode] 1474TOOL_UUDECODE Uudecode a binary file. [uudecode]
1473 1475
1474TOOL_VGRIND Grind nice listings of programs. [vgrind -f] 1476TOOL_VGRIND Grind nice listings of programs. [vgrind -f]
1475 1477
1476TOOL_ZIC Time zone compiler. [zic] 1478TOOL_ZIC Time zone compiler. [zic]
1477 1479
1478 1480
1479Other variables of note (incomplete list): 1481Other variables of note (incomplete list):
1480 1482
1481NOGCCERROR If defined, prevents passing certain ${CFLAGS} to GCC 1483NOGCCERROR If defined, prevents passing certain ${CFLAGS} to GCC
1482 that cause warnings to be fatal, such as: 1484 that cause warnings to be fatal, such as:
1483 -Werror -Wa,--fatal-warnings 1485 -Werror -Wa,--fatal-warnings
1484 (The latter being for as(1).) 1486 (The latter being for as(1).)
1485 1487
1486WARNS Crank up GCC warning options; the distinct levels are: 1488WARNS Crank up GCC warning options; the distinct levels are:
1487 WARNS=1 1489 WARNS=1
1488 WARNS=2 1490 WARNS=2
1489 WARNS=3 1491 WARNS=3
1490 WARNS=4 1492 WARNS=4
1491 1493
1492=-=-=-=-= bsd.x11.mk =-=-=-=-= 1494=-=-=-=-= bsd.x11.mk =-=-=-=-=
1493 1495
1494The include file <bsd.x11.mk> contains parameters and targets for 1496The include file <bsd.x11.mk> contains parameters and targets for
1495cross-building X11 from ${X11SRCDIR.xc} / ${X11MITSRCDIR.*}. 1497cross-building X11 from ${X11SRCDIR.xc} / ${X11MITSRCDIR.*}.
1496It should be included after the general Makefile contents but before 1498It should be included after the general Makefile contents but before
1497the include files such as <bsd.prog.mk> and <bsd.lib.mk>. 1499the include files such as <bsd.prog.mk> and <bsd.lib.mk>.
1498 1500
1499It provides the following targets: 1501It provides the following targets:
1500 .man.1 .man.3 .man.4 .man.5 .man.7: 1502 .man.1 .man.3 .man.4 .man.5 .man.7:
1501 If ${MAN} or ${PROG} is set and ${MKMAN} != "no", 1503 If ${MAN} or ${PROG} is set and ${MKMAN} != "no",
1502 these rules convert from X11's manual page source 1504 these rules convert from X11's manual page source
1503 into an mdoc.old source file. 1505 into an mdoc.old source file.
1504 cleanx11man: 1506 cleanx11man:
1505 Clean up the mdoc.old files generated by the above. 1507 Clean up the mdoc.old files generated by the above.
1506 1508
1507It sets the following variables: 1509It sets the following variables:
1508 1510
1509BINDIR Set to ${X11BINDIR}. 1511BINDIR Set to ${X11BINDIR}.
1510 To override, define after including <bsd.x11.mk> 1512 To override, define after including <bsd.x11.mk>
1511 1513
1512LIBDIR Set to ${X11USRLIBDIR}. 1514LIBDIR Set to ${X11USRLIBDIR}.
1513 To override, define after including <bsd.x11.mk> 1515 To override, define after including <bsd.x11.mk>
1514 1516
1515MANDIR Set to ${X11MANDIR}. 1517MANDIR Set to ${X11MANDIR}.
1516 To override, define after including <bsd.x11.mk> 1518 To override, define after including <bsd.x11.mk>
1517 1519
1518CPPFLAGS Appended with definitions to include from 1520CPPFLAGS Appended with definitions to include from
1519 ${DESTDIR}${X11INCDIR} 1521 ${DESTDIR}${X11INCDIR}
1520 1522
1521LDFLAGS Appended with definitions to link from 1523LDFLAGS Appended with definitions to link from
1522 ${DESTDIR}${X11USRLIBDIR} 1524 ${DESTDIR}${X11USRLIBDIR}
1523 1525
1524X11FLAGS.CONNECTION Equivalent to X11's CONNECTION_FLAGS. 1526X11FLAGS.CONNECTION Equivalent to X11's CONNECTION_FLAGS.
1525 1527
1526X11FLAGS.EXTENSION Equivalent to X11's EXT_DEFINES. 1528X11FLAGS.EXTENSION Equivalent to X11's EXT_DEFINES.
1527 1529
1528X11FLAGS.LOADABLE Equivalent to X11's LOADABLE. 1530X11FLAGS.LOADABLE Equivalent to X11's LOADABLE.
1529 1531
1530X11FLAGS.OS_DEFINES Equivalent to X11's OS_DEFINES. 1532X11FLAGS.OS_DEFINES Equivalent to X11's OS_DEFINES.
1531 1533
1532X11FLAGS.SERVER Equivalent to X11's ServerDefines. 1534X11FLAGS.SERVER Equivalent to X11's ServerDefines.
1533 1535
1534X11FLAGS.THREADLIB Equivalent to X11's THREADS_DEFINES for libraries. 1536X11FLAGS.THREADLIB Equivalent to X11's THREADS_DEFINES for libraries.
1535 1537
1536X11FLAGS.THREADS Equivalent to X11's THREADS_DEFINES. 1538X11FLAGS.THREADS Equivalent to X11's THREADS_DEFINES.
1537 1539
1538X11FLAGS.VERSION cpp(1) definitions of OSMAJORVERSION and OSMINORVERSION. 1540X11FLAGS.VERSION cpp(1) definitions of OSMAJORVERSION and OSMINORVERSION.
1539 1541
1540X11FLAGS.DIX Equivalent to X11's DIX_DEFINES. 1542X11FLAGS.DIX Equivalent to X11's DIX_DEFINES.
1541 1543
1542X11TOOL_UNXCOMM Commandline to convert `XCOMM' comments to `#' 1544X11TOOL_UNXCOMM Commandline to convert `XCOMM' comments to `#'
1543 1545
1544It uses the following variables: 1546It uses the following variables:
1545 1547
1546APPDEFS List of app-default files to install. 1548APPDEFS List of app-default files to install.
1547 1549
1548CPPSCRIPTS List of files/scripts to run through cpp(1) 1550CPPSCRIPTS List of files/scripts to run through cpp(1)
1549 and then ${X11TOOL_UNXCOMM}. The source files 1551 and then ${X11TOOL_UNXCOMM}. The source files
1550 have a `.cpp' suffix, the generated files do not. 1552 have a `.cpp' suffix, the generated files do not.
1551 1553
1552CPPSCRIPTFLAGS Additional flags to cpp(1) when building CPPSCRIPTS. 1554CPPSCRIPTFLAGS Additional flags to cpp(1) when building CPPSCRIPTS.
1553 1555
1554CPPSCRIPTFLAGS_<fn> Additional flags to cpp(1) when building CPPSCRIPT <fn>. 1556CPPSCRIPTFLAGS_<fn> Additional flags to cpp(1) when building CPPSCRIPT <fn>.
1555 1557
1556 1558
1557=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 1559=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=