source: trunk/kBuild/doc/QuickReference-kmk.html@ 2171

Last change on this file since 2171 was 2171, checked in by bird, 17 years ago

kmk-qr: added the special targets section.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 69.8 KB
Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6<meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" />
7<title>kmk Quick Reference</title>
8<style type="text/css">
9
10/*
11:Author: David Goodger
12:Contact: goodger@users.sourceforge.net
13:Date: $Date: 2008-12-30 22:18:10 +0000 (Tue, 30 Dec 2008) $
14:Revision: $Revision: 2171 $
15:Copyright: This stylesheet has been placed in the public domain.
16
17Default cascading style sheet for the HTML output of Docutils.
18
19See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
20customize this style sheet.
21*/
22
23/* used to remove borders from tables and images */
24.borderless, table.borderless td, table.borderless th {
25 border: 0 }
26
27table.borderless td, table.borderless th {
28 /* Override padding for "table.docutils td" with "! important".
29 The right padding separates the table cells. */
30 padding: 0 0.5em 0 0 ! important }
31
32.first {
33 /* Override more specific margin styles with "! important". */
34 margin-top: 0 ! important }
35
36.last, .with-subtitle {
37 margin-bottom: 0 ! important }
38
39.hidden {
40 display: none }
41
42a.toc-backref {
43 text-decoration: none ;
44 color: black }
45
46blockquote.epigraph {
47 margin: 2em 5em ; }
48
49dl.docutils dd {
50 margin-bottom: 0.5em }
51
52/* Uncomment (and remove this text!) to get bold-faced definition list terms
53dl.docutils dt {
54 font-weight: bold }
55*/
56
57div.abstract {
58 margin: 2em 5em }
59
60div.abstract p.topic-title {
61 font-weight: bold ;
62 text-align: center }
63
64div.admonition, div.attention, div.caution, div.danger, div.error,
65div.hint, div.important, div.note, div.tip, div.warning {
66 margin: 2em ;
67 border: medium outset ;
68 padding: 1em }
69
70div.admonition p.admonition-title, div.hint p.admonition-title,
71div.important p.admonition-title, div.note p.admonition-title,
72div.tip p.admonition-title {
73 font-weight: bold ;
74 font-family: sans-serif }
75
76div.attention p.admonition-title, div.caution p.admonition-title,
77div.danger p.admonition-title, div.error p.admonition-title,
78div.warning p.admonition-title {
79 color: red ;
80 font-weight: bold ;
81 font-family: sans-serif }
82
83/* Uncomment (and remove this text!) to get reduced vertical space in
84 compound paragraphs.
85div.compound .compound-first, div.compound .compound-middle {
86 margin-bottom: 0.5em }
87
88div.compound .compound-last, div.compound .compound-middle {
89 margin-top: 0.5em }
90*/
91
92div.dedication {
93 margin: 2em 5em ;
94 text-align: center ;
95 font-style: italic }
96
97div.dedication p.topic-title {
98 font-weight: bold ;
99 font-style: normal }
100
101div.figure {
102 margin-left: 2em ;
103 margin-right: 2em }
104
105div.footer, div.header {
106 clear: both;
107 font-size: smaller }
108
109div.line-block {
110 display: block ;
111 margin-top: 1em ;
112 margin-bottom: 1em }
113
114div.line-block div.line-block {
115 margin-top: 0 ;
116 margin-bottom: 0 ;
117 margin-left: 1.5em }
118
119div.sidebar {
120 margin-left: 1em ;
121 border: medium outset ;
122 padding: 1em ;
123 background-color: #ffffee ;
124 width: 40% ;
125 float: right ;
126 clear: right }
127
128div.sidebar p.rubric {
129 font-family: sans-serif ;
130 font-size: medium }
131
132div.system-messages {
133 margin: 5em }
134
135div.system-messages h1 {
136 color: red }
137
138div.system-message {
139 border: medium outset ;
140 padding: 1em }
141
142div.system-message p.system-message-title {
143 color: red ;
144 font-weight: bold }
145
146div.topic {
147 margin: 2em }
148
149h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
150h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
151 margin-top: 0.4em }
152
153h1.title {
154 text-align: center }
155
156h2.subtitle {
157 text-align: center }
158
159hr.docutils {
160 width: 75% }
161
162img.align-left {
163 clear: left }
164
165img.align-right {
166 clear: right }
167
168ol.simple, ul.simple {
169 margin-bottom: 1em }
170
171ol.arabic {
172 list-style: decimal }
173
174ol.loweralpha {
175 list-style: lower-alpha }
176
177ol.upperalpha {
178 list-style: upper-alpha }
179
180ol.lowerroman {
181 list-style: lower-roman }
182
183ol.upperroman {
184 list-style: upper-roman }
185
186p.attribution {
187 text-align: right ;
188 margin-left: 50% }
189
190p.caption {
191 font-style: italic }
192
193p.credits {
194 font-style: italic ;
195 font-size: smaller }
196
197p.label {
198 white-space: nowrap }
199
200p.rubric {
201 font-weight: bold ;
202 font-size: larger ;
203 color: maroon ;
204 text-align: center }
205
206p.sidebar-title {
207 font-family: sans-serif ;
208 font-weight: bold ;
209 font-size: larger }
210
211p.sidebar-subtitle {
212 font-family: sans-serif ;
213 font-weight: bold }
214
215p.topic-title {
216 font-weight: bold }
217
218pre.address {
219 margin-bottom: 0 ;
220 margin-top: 0 ;
221 font-family: serif ;
222 font-size: 100% }
223
224pre.literal-block, pre.doctest-block {
225 margin-left: 2em ;
226 margin-right: 2em ;
227 background-color: #eeeeee }
228
229span.classifier {
230 font-family: sans-serif ;
231 font-style: oblique }
232
233span.classifier-delimiter {
234 font-family: sans-serif ;
235 font-weight: bold }
236
237span.interpreted {
238 font-family: sans-serif }
239
240span.option {
241 white-space: nowrap }
242
243span.pre {
244 white-space: pre }
245
246span.problematic {
247 color: red }
248
249span.section-subtitle {
250 /* font-size relative to parent (h1..h6 element) */
251 font-size: 80% }
252
253table.citation {
254 border-left: solid 1px gray;
255 margin-left: 1px }
256
257table.docinfo {
258 margin: 2em 4em }
259
260table.docutils {
261 margin-top: 0.5em ;
262 margin-bottom: 0.5em }
263
264table.footnote {
265 border-left: solid 1px black;
266 margin-left: 1px }
267
268table.docutils td, table.docutils th,
269table.docinfo td, table.docinfo th {
270 padding-left: 0.5em ;
271 padding-right: 0.5em ;
272 vertical-align: top }
273
274table.docutils th.field-name, table.docinfo th.docinfo-name {
275 font-weight: bold ;
276 text-align: left ;
277 white-space: nowrap ;
278 padding-left: 0 }
279
280h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
281h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
282 font-size: 100% }
283
284tt.docutils {
285 background-color: #eeeeee }
286
287ul.auto-toc {
288 list-style-type: none }
289
290</style>
291</head>
292<body>
293<div class="document" id="kmk-quick-reference">
294<h1 class="title">kmk Quick Reference</h1>
295<p>This is an attempt at summarizing all directives, functions, special variables,
296special targets, built-in commands, external commands, and <tt class="docutils literal"><span class="pre">kmk</span></tt>-expressions.
297Since <em>all</em> the features are included, the quickness of this reference can be
298disputed. ;-)</p>
299<div class="section">
300<h1><a id="directives" name="directives">Directives</a></h1>
301<p>Here is a summary of the directives <tt class="docutils literal"><span class="pre">kmk</span></tt> recognizes:</p>
302<blockquote>
303<p>Define a multi-line, recursively-expanded variable:</p>
304<pre class="literal-block">
305define variable
306endef
307</pre>
308<p>Conditionally evaluate part of the makefile:</p>
309<pre class="literal-block">
310ifdef variable
311ifndef variable
312ifeq (a,b)
313ifeq &quot;a&quot; &quot;b&quot;
314ifeq 'a' 'b'
315ifneq (a,b)
316ifneq &quot;a&quot; &quot;b&quot;
317ifneq 'a' 'b'
318if1of (set-a,set-b) [1]
319ifn1of (set-a,set-b) [1]
320if expression [1]
321else
322endif
323</pre>
324<p>Include another makefile:</p>
325<pre class="literal-block">
326include file
327-include file
328sinclude file
329</pre>
330<p>Include another dependency file <a class="footnote-reference" href="#id82" id="id1" name="id1">[1]</a>:</p>
331<pre class="literal-block">
332includedep file
333</pre>
334<p>Define a variable, overriding any previous definition, even one from the
335command line:</p>
336<pre class="literal-block">
337override variable = value
338override variable := value
339override variable += value
340override variable &lt;= value [1]
341override variable ?= value
342override define variable
343endef
344</pre>
345<p>Tell <tt class="docutils literal"><span class="pre">kmk</span></tt> to export all variables to child processes by default:</p>
346<pre class="literal-block">
347export
348</pre>
349<p>Tell <tt class="docutils literal"><span class="pre">kmk</span></tt> whether or not to export a particular variable to child
350processes:</p>
351<pre class="literal-block">
352export variable
353export variable = value
354export variable := value
355export variable += value
356export variable &lt;= value [1]
357export variable ?= value
358unexport variable
359</pre>
360<p>Define a variable in the local context instead of the global one <a class="footnote-reference" href="#id82" id="id2" name="id2">[1]</a>:</p>
361<pre class="literal-block">
362local variable = value
363local variable := value
364local variable += value
365local variable &lt;= value
366local variable ?= value
367local define variable
368endef
369</pre>
370<p>Specify a search path for files matching a <tt class="docutils literal"><span class="pre">%</span></tt> pattern:</p>
371<pre class="literal-block">
372vpath pattern path
373</pre>
374<p>Remove all search paths previously specified for pattern:</p>
375<pre class="literal-block">
376vpath pattern
377</pre>
378<p>Remove all search paths previously specified in any vpath directive:</p>
379<pre class="literal-block">
380vpath
381</pre>
382</blockquote>
383</div>
384<div class="section">
385<h1><a id="automatic-variables" name="automatic-variables">Automatic variables</a></h1>
386<p>Here is a summary of the automatic variables.</p>
387<table border="1" class="docutils">
388<colgroup>
389<col width="14%" />
390<col width="86%" />
391</colgroup>
392<thead valign="bottom">
393<tr><th class="head">Variable</th>
394<th class="head">Description</th>
395</tr>
396</thead>
397<tbody valign="top">
398<tr><td><tt class="docutils literal"><span class="pre">$&#64;</span></tt></td>
399<td>The file name of the target.</td>
400</tr>
401<tr><td><tt class="docutils literal"><span class="pre">$&lt;</span></tt></td>
402<td>The name of the first prerequisite.</td>
403</tr>
404<tr><td><tt class="docutils literal"><span class="pre">$?</span></tt></td>
405<td>The names of all the prerequisites that are newer than the
406target, with spaces between them.</td>
407</tr>
408<tr><td><tt class="docutils literal"><span class="pre">$^</span></tt></td>
409<td>The names of all the prerequisites, duplicates omitted.</td>
410</tr>
411<tr><td><tt class="docutils literal"><span class="pre">$+</span></tt></td>
412<td>The names of all the prerequisites, duplicates and order
413preserved</td>
414</tr>
415<tr><td><tt class="docutils literal"><span class="pre">$*</span></tt></td>
416<td>The stem with which an implicit rule matches.</td>
417</tr>
418<tr><td><tt class="docutils literal"><span class="pre">$|</span></tt></td>
419<td>The name of all the order only prerequisites.</td>
420</tr>
421<tr><td><tt class="docutils literal"><span class="pre">$(&#64;D)</span></tt></td>
422<td>The directory part of <tt class="docutils literal"><span class="pre">$&#64;</span></tt>.</td>
423</tr>
424<tr><td><tt class="docutils literal"><span class="pre">$(&lt;D)</span></tt></td>
425<td>The directory part of <tt class="docutils literal"><span class="pre">$&lt;</span></tt>.</td>
426</tr>
427<tr><td><tt class="docutils literal"><span class="pre">$(?D)</span></tt></td>
428<td>The directory part of <tt class="docutils literal"><span class="pre">$?</span></tt>.</td>
429</tr>
430<tr><td><tt class="docutils literal"><span class="pre">$(^D)</span></tt></td>
431<td>The directory part of <tt class="docutils literal"><span class="pre">%^</span></tt>.</td>
432</tr>
433<tr><td><tt class="docutils literal"><span class="pre">$(+D)</span></tt></td>
434<td>The directory part of <tt class="docutils literal"><span class="pre">$+</span></tt>.</td>
435</tr>
436<tr><td><tt class="docutils literal"><span class="pre">$(*D)</span></tt></td>
437<td>The directory part of <tt class="docutils literal"><span class="pre">$*</span></tt>.</td>
438</tr>
439<tr><td><tt class="docutils literal"><span class="pre">$(|D)</span></tt></td>
440<td>The directory part of <tt class="docutils literal"><span class="pre">$|</span></tt>.</td>
441</tr>
442<tr><td><tt class="docutils literal"><span class="pre">$(&#64;F)</span></tt></td>
443<td>The file-within-directory part of <tt class="docutils literal"><span class="pre">$&#64;</span></tt>.</td>
444</tr>
445<tr><td><tt class="docutils literal"><span class="pre">$(&lt;F)</span></tt></td>
446<td>The file-within-directory part of <tt class="docutils literal"><span class="pre">$&lt;</span></tt>.</td>
447</tr>
448<tr><td><tt class="docutils literal"><span class="pre">$(?F)</span></tt></td>
449<td>The file-within-directory part of <tt class="docutils literal"><span class="pre">$?</span></tt>.</td>
450</tr>
451<tr><td><tt class="docutils literal"><span class="pre">$(^F)</span></tt></td>
452<td>The file-within-directory part of <tt class="docutils literal"><span class="pre">$^</span></tt>.</td>
453</tr>
454<tr><td><tt class="docutils literal"><span class="pre">$(+F)</span></tt></td>
455<td>The file-within-directory part of <tt class="docutils literal"><span class="pre">$+</span></tt>.</td>
456</tr>
457<tr><td><tt class="docutils literal"><span class="pre">$(*F)</span></tt></td>
458<td>The file-within-directory part of <tt class="docutils literal"><span class="pre">$*</span></tt>.</td>
459</tr>
460<tr><td><tt class="docutils literal"><span class="pre">$(|F)</span></tt></td>
461<td>The file-within-directory part of <tt class="docutils literal"><span class="pre">$|</span></tt>.</td>
462</tr>
463</tbody>
464</table>
465</div>
466<div class="section">
467<h1><a id="special-variables" name="special-variables">Special variables</a></h1>
468<p>All variables starting with a <tt class="docutils literal"><span class="pre">.</span></tt> is reserved by <tt class="docutils literal"><span class="pre">kmk</span></tt>. The following
469variables are specially used or/and defined by <tt class="docutils literal"><span class="pre">kmk</span></tt>:</p>
470<table border="1" class="docutils">
471<colgroup>
472<col width="34%" />
473<col width="66%" />
474</colgroup>
475<thead valign="bottom">
476<tr><th class="head">Variable</th>
477<th class="head">Description</th>
478</tr>
479</thead>
480<tbody valign="top">
481<tr><td><tt class="docutils literal"><span class="pre">.DEFAULT_GOAL</span></tt></td>
482<td>The makefile default goal. You can set this in
483the makefile, if you don't it will default to
484the first target that is encountered.</td>
485</tr>
486<tr><td><tt class="docutils literal"><span class="pre">.FEATURES</span></tt></td>
487<td>List of GNU <tt class="docutils literal"><span class="pre">make</span></tt> features. Do not set this.</td>
488</tr>
489<tr><td><tt class="docutils literal"><span class="pre">.INCLUDE_DIRS</span></tt></td>
490<td>List of include directories, <tt class="docutils literal"><span class="pre">-I</span></tt> arguments
491and defaults. Do not set this.</td>
492</tr>
493<tr><td><tt class="docutils literal"><span class="pre">.RECIPEPREFIX</span></tt></td>
494<td>Recipe prefix, defaults to tab.</td>
495</tr>
496<tr><td><tt class="docutils literal"><span class="pre">.VARIABLES</span></tt></td>
497<td>Special variable which exands to the list of
498variable. Do not set this.</td>
499</tr>
500<tr><td><tt class="docutils literal"><span class="pre">CURDIR</span></tt></td>
501<td>Set to the pathname of the current working
502directory (after all <tt class="docutils literal"><span class="pre">-C</span></tt> options are
503processed, if any). Do not set this.</td>
504</tr>
505<tr><td><tt class="docutils literal"><span class="pre">KBUILD_VERSION</span></tt>,
506<tt class="docutils literal"><span class="pre">KBUILD_VERSION_MAJOR</span></tt>,
507<tt class="docutils literal"><span class="pre">KBUILD_VERSION_MINOR</span></tt>,
508<tt class="docutils literal"><span class="pre">KBUILD_VERSION_PATCH</span></tt>,
509<tt class="docutils literal"><span class="pre">KBUILD_KMK_REVISION</span></tt></td>
510<td>The kBuild version string and the break down
511into individual components. <a class="footnote-reference" href="#id82" id="id3" name="id3">[1]</a></td>
512</tr>
513<tr><td><tt class="docutils literal"><span class="pre">KBUILD_HOST</span></tt> <a class="footnote-reference" href="#id82" id="id4" name="id4">[1]</a></td>
514<td>The host operating system.</td>
515</tr>
516<tr><td><tt class="docutils literal"><span class="pre">KBUILD_HOST_ARCH</span></tt> <a class="footnote-reference" href="#id82" id="id5" name="id5">[1]</a></td>
517<td>The host architecture.</td>
518</tr>
519<tr><td><tt class="docutils literal"><span class="pre">KBUILD_HOST_CPU</span></tt> <a class="footnote-reference" href="#id82" id="id6" name="id6">[1]</a></td>
520<td>The host CPU <tt class="docutils literal"><span class="pre">kmk</span></tt> is built for, set to
521<tt class="docutils literal"><span class="pre">blend</span></tt> if not any particular CPU.</td>
522</tr>
523<tr><td><tt class="docutils literal"><span class="pre">KBUILD_PATH</span></tt> <a class="footnote-reference" href="#id82" id="id7" name="id7">[1]</a></td>
524<td>Where the kBuild scripts are.</td>
525</tr>
526<tr><td><tt class="docutils literal"><span class="pre">KBUILD_BIN_PATH</span></tt> <a class="footnote-reference" href="#id82" id="id8" name="id8">[1]</a></td>
527<td>Where the host specific kBuild binaries are.</td>
528</tr>
529<tr><td><tt class="docutils literal"><span class="pre">KMK</span></tt> <a class="footnote-reference" href="#id82" id="id9" name="id9">[1]</a>,
530<tt class="docutils literal"><span class="pre">MAKE</span></tt></td>
531<td>The name with which <tt class="docutils literal"><span class="pre">kmk</span></tt> was invoked. Using
532this variable in recipes has special meaning.</td>
533</tr>
534<tr><td><tt class="docutils literal"><span class="pre">KMK_BUILTIN</span></tt> <a class="footnote-reference" href="#id82" id="id10" name="id10">[1]</a></td>
535<td>List of built-in commands.</td>
536</tr>
537<tr><td><tt class="docutils literal"><span class="pre">KMK_FEATURES</span></tt> <a class="footnote-reference" href="#id82" id="id11" name="id11">[1]</a></td>
538<td>List of <tt class="docutils literal"><span class="pre">kmk</span></tt> specific features.</td>
539</tr>
540<tr><td><tt class="docutils literal"><span class="pre">KMK_FLAGS</span></tt> <a class="footnote-reference" href="#id82" id="id12" name="id12">[1]</a></td>
541<td><p class="first">The flags given to <tt class="docutils literal"><span class="pre">kmk</span></tt>. You can set this in
542the environment or a makefile to set flags.</p>
543<p class="last">It is never appropriate to use <tt class="docutils literal"><span class="pre">KMK_FLAGS</span></tt>
544directly in a recipe line: its contents may not
545be quoted correctly for use in the shell. Always
546allow recursive <tt class="docutils literal"><span class="pre">kmk</span></tt>'s to obtain these values
547through the environment from its parent.</p>
548</td>
549</tr>
550<tr><td><tt class="docutils literal"><span class="pre">KMK_LEVEL</span></tt> <a class="footnote-reference" href="#id82" id="id13" name="id13">[1]</a></td>
551<td>The number of levels of recursion (sub-makes).</td>
552</tr>
553<tr><td><tt class="docutils literal"><span class="pre">KMK_VERSION</span></tt> <a class="footnote-reference" href="#id82" id="id14" name="id14">[1]</a></td>
554<td>The GNU <tt class="docutils literal"><span class="pre">make</span></tt> version number.</td>
555</tr>
556<tr><td><tt class="docutils literal"><span class="pre">MAKECMDGOALS</span></tt></td>
557<td>The targets given to <tt class="docutils literal"><span class="pre">kmk</span></tt> on the command line.
558Do not set this.</td>
559</tr>
560<tr><td><tt class="docutils literal"><span class="pre">MAKEFILES</span></tt></td>
561<td>Makefiles to be read on every invocation of
562<tt class="docutils literal"><span class="pre">kmk</span></tt>.</td>
563</tr>
564<tr><td><tt class="docutils literal"><span class="pre">MAKEFILE_LIST</span></tt></td>
565<td>List of the makefiles that <tt class="docutils literal"><span class="pre">kmk</span></tt> has opened.</td>
566</tr>
567<tr><td><tt class="docutils literal"><span class="pre">MAKESHELL</span></tt></td>
568<td>OS/2 and MS-DOS only, the name of the command
569interpreter that is to be used by <tt class="docutils literal"><span class="pre">kmk</span></tt>. This
570value takes precedence over the value of SHELL.</td>
571</tr>
572<tr><td><tt class="docutils literal"><span class="pre">SHELL</span></tt></td>
573<td>The name of the default command interpreter,
574kmk_ash. You can set SHELL in the makefile to
575change the shell used to run recipes. The SHELL
576variable is handled specially when importing
577from and exporting to the environment.</td>
578</tr>
579<tr><td><tt class="docutils literal"><span class="pre">SUFFIXES</span></tt></td>
580<td>The default list of suffixes before <tt class="docutils literal"><span class="pre">kmk</span></tt>
581reads any makefiles (always empty).</td>
582</tr>
583<tr><td><tt class="docutils literal"><span class="pre">VPATH</span></tt></td>
584<td>Directory search path for files not found in the
585current directory.</td>
586</tr>
587</tbody>
588</table>
589<p>The following variables reflects <tt class="docutils literal"><span class="pre">kmk</span></tt> options. Do not set these. <a class="footnote-reference" href="#id82" id="id15" name="id15">[1]</a></p>
590<table border="1" class="docutils">
591<colgroup>
592<col width="49%" />
593<col width="51%" />
594</colgroup>
595<thead valign="bottom">
596<tr><th class="head">Variable</th>
597<th class="head">Description</th>
598</tr>
599</thead>
600<tbody valign="top">
601<tr><td><tt class="docutils literal"><span class="pre">KMK_OPTS_JOBS</span></tt></td>
602<td>-j slots, <tt class="docutils literal"><span class="pre">0</span></tt> if not given.</td>
603</tr>
604<tr><td><tt class="docutils literal"><span class="pre">KMK_OPTS_KEEP_GOING</span></tt></td>
605<td>-k indictor (<tt class="docutils literal"><span class="pre">0</span></tt>/<tt class="docutils literal"><span class="pre">1</span></tt>).</td>
606</tr>
607<tr><td><tt class="docutils literal"><span class="pre">KMK_OPTS_JUST_PRINT</span></tt></td>
608<td>-n indicator (<tt class="docutils literal"><span class="pre">0</span></tt>/<tt class="docutils literal"><span class="pre">1</span></tt>).</td>
609</tr>
610<tr><td><tt class="docutils literal"><span class="pre">KMK_OPTS_PRORITY</span></tt></td>
611<td>--priority level, <tt class="docutils literal"><span class="pre">0</span></tt> if not given.</td>
612</tr>
613<tr><td><tt class="docutils literal"><span class="pre">KMK_OPTS_AFFINITY</span></tt></td>
614<td>--affinity mask, <tt class="docutils literal"><span class="pre">0</span></tt> if not given.</td>
615</tr>
616<tr><td><tt class="docutils literal"><span class="pre">KMK_OPTS_STATISTICS</span></tt></td>
617<td>--statistics indicator (<tt class="docutils literal"><span class="pre">0</span></tt>/<tt class="docutils literal"><span class="pre">1</span></tt>).</td>
618</tr>
619<tr><td><tt class="docutils literal"><span class="pre">KMK_OPTS_PRINT_TIME</span></tt></td>
620<td>The --print-time value.</td>
621</tr>
622<tr><td><tt class="docutils literal"><span class="pre">KMK_OPTS_PRETTY_COMMAND_PRINTING</span></tt></td>
623<td>--pretty-command-printing indicator.</td>
624</tr>
625</tbody>
626</table>
627</div>
628<div class="section">
629<h1><a id="special-targets" name="special-targets">Special Targets</a></h1>
630<p>Certain names have special meanings if they appear as targets.</p>
631<table border="1" class="docutils">
632<colgroup>
633<col width="41%" />
634<col width="59%" />
635</colgroup>
636<thead valign="bottom">
637<tr><th class="head">Target</th>
638<th class="head">Description</th>
639</tr>
640</thead>
641<tbody valign="top">
642<tr><td><tt class="docutils literal"><span class="pre">.DEFAULT</span></tt></td>
643<td>The recipe is used for any target for which
644no rules are found.</td>
645</tr>
646<tr><td><tt class="docutils literal"><span class="pre">.DELETE_ON_ERROR</span></tt></td>
647<td>If mentioned, <tt class="docutils literal"><span class="pre">kmk</span></tt> will delete the
648targets of a rule if it hash changed and its
649recipe fails or is interrupted.</td>
650</tr>
651<tr><td><tt class="docutils literal"><span class="pre">.EXPORT_ALL_VARIABLES</span></tt></td>
652<td>If mentioned, all variables will by default
653be exported to child processes.</td>
654</tr>
655<tr><td><tt class="docutils literal"><span class="pre">.IGNORE</span></tt></td>
656<td>Ignore errors in the execution of the recipe
657for the targets <tt class="docutils literal"><span class="pre">.IGNORE</span></tt> depends on, if
658no prequisites all targets are affected.</td>
659</tr>
660<tr><td><tt class="docutils literal"><span class="pre">.INTERMEIDATE</span></tt></td>
661<td>The prerequisites are treated as
662intermediate files (implicite rules).</td>
663</tr>
664<tr><td><tt class="docutils literal"><span class="pre">.LOW_RESOLUTION_TIME</span></tt></td>
665<td><tt class="docutils literal"><span class="pre">kmk</span></tt> will assume prerequisite files are
666created with low resolution time stamps.</td>
667</tr>
668<tr><td><tt class="docutils literal"><span class="pre">.NOTPARALLEL</span></tt></td>
669<td>If mentioned without any prerequisites,
670<tt class="docutils literal"><span class="pre">kmk</span></tt> will run serially as if -j1 was
671given. If it has prerequisites <tt class="docutils literal"><span class="pre">kmk</span></tt> <a class="footnote-reference" href="#id82" id="id16" name="id16">[1]</a>
672will only do this for the targets among
673them.</td>
674</tr>
675<tr><td><tt class="docutils literal"><span class="pre">.PHONY</span></tt></td>
676<td>The prerequisites are considered phony and
677will be rebuilt unconditionally.</td>
678</tr>
679<tr><td><tt class="docutils literal"><span class="pre">.PRECIOUS</span></tt></td>
680<td>The targets which <tt class="docutils literal"><span class="pre">.PRECIOUS</span></tt> depends will
681to be deleted if <tt class="docutils literal"><span class="pre">kmk</span></tt> is killed or
682interrupted while their building.</td>
683</tr>
684<tr><td><tt class="docutils literal"><span class="pre">.SECONDARY</span></tt></td>
685<td>The prerequisites are treated as
686intermediate files, except that they are
687never automatically deleted. If used with
688no prerequisites all targets gets this
689treatement.</td>
690</tr>
691<tr><td><tt class="docutils literal"><span class="pre">.SECONDEXPANSION</span></tt></td>
692<td>If mentioned, all prerequisite lists after
693it will be expanded a second time after all
694makefiles have been read.</td>
695</tr>
696<tr><td><tt class="docutils literal"><span class="pre">.SECONDTARGETEXPANSION</span></tt>
697<a class="footnote-reference" href="#id82" id="id17" name="id17">[1]</a></td>
698<td>If mentioned, all prerequisite lists after
699it will be expanded a second time after all
700makefiles have been read.</td>
701</tr>
702<tr><td><tt class="docutils literal"><span class="pre">.SILENT</span></tt></td>
703<td><tt class="docutils literal"><span class="pre">kmk</span></tt> will not print the recipe for
704targets listed as prerequisites, if none
705then it applies to all targets.</td>
706</tr>
707<tr><td><tt class="docutils literal"><span class="pre">.SUFFIXES</span></tt></td>
708<td>The prerequisites are the list of suffixes
709used in checking for suffix rules.</td>
710</tr>
711</tbody>
712</table>
713</div>
714<div class="section">
715<h1><a id="commands" name="commands">Commands</a></h1>
716<p>Builtin commands <a class="footnote-reference" href="#id82" id="id18" name="id18">[1]</a> all start with <tt class="docutils literal"><span class="pre">kmk_builtin_</span></tt>, so in order to save
717space this prefix has been omitted in the table below. All commands comes in an
718external edition that can be used by/in the shell, these are prefixed <tt class="docutils literal"><span class="pre">kmk_</span></tt>.</p>
719<table border="1" class="docutils">
720<colgroup>
721<col width="20%" />
722<col width="80%" />
723</colgroup>
724<thead valign="bottom">
725<tr><th class="head">Command</th>
726<th class="head">Description</th>
727</tr>
728</thead>
729<tbody valign="top">
730<tr><td><tt class="docutils literal"><span class="pre">append</span></tt></td>
731<td>Append text to a file. The builtin version can output the
732value of a variable or the commands of a target.</td>
733</tr>
734<tr><td><tt class="docutils literal"><span class="pre">cat</span></tt></td>
735<td>The BSD <tt class="docutils literal"><span class="pre">cat</span></tt> command.</td>
736</tr>
737<tr><td><tt class="docutils literal"><span class="pre">chmod</span></tt></td>
738<td>The BSD <tt class="docutils literal"><span class="pre">chmod</span></tt> command.</td>
739</tr>
740<tr><td><tt class="docutils literal"><span class="pre">cmp</span></tt></td>
741<td>The BSD <tt class="docutils literal"><span class="pre">cmp</span></tt> command.</td>
742</tr>
743<tr><td><tt class="docutils literal"><span class="pre">cp</span></tt></td>
744<td>The BSD <tt class="docutils literal"><span class="pre">cp</span></tt> command with some twaking.</td>
745</tr>
746<tr><td><tt class="docutils literal"><span class="pre">echo</span></tt></td>
747<td>The BSD <tt class="docutils literal"><span class="pre">echo</span></tt> command.</td>
748</tr>
749<tr><td><tt class="docutils literal"><span class="pre">expr</span></tt></td>
750<td>The BSD <tt class="docutils literal"><span class="pre">expr</span></tt> command.</td>
751</tr>
752<tr><td><tt class="docutils literal"><span class="pre">install</span></tt></td>
753<td>The BSD <tt class="docutils literal"><span class="pre">install</span></tt> command with some tweaking.</td>
754</tr>
755<tr><td><tt class="docutils literal"><span class="pre">kDepIDB</span></tt></td>
756<td>Extract dependencies from a Visual C++ .IDB file.</td>
757</tr>
758<tr><td><tt class="docutils literal"><span class="pre">ln</span></tt></td>
759<td>The BSD <tt class="docutils literal"><span class="pre">ln</span></tt> command.</td>
760</tr>
761<tr><td><tt class="docutils literal"><span class="pre">md5sum</span></tt></td>
762<td>Typical MD5 sum program, custom kBuild version.</td>
763</tr>
764<tr><td><tt class="docutils literal"><span class="pre">mkdir</span></tt></td>
765<td>The BSD <tt class="docutils literal"><span class="pre">mkdir</span></tt> command.</td>
766</tr>
767<tr><td><tt class="docutils literal"><span class="pre">mv</span></tt></td>
768<td>The BSD <tt class="docutils literal"><span class="pre">mv</span></tt> command with some tweaking.</td>
769</tr>
770<tr><td><tt class="docutils literal"><span class="pre">printf</span></tt></td>
771<td>The BSD <tt class="docutils literal"><span class="pre">printf</span></tt> command.</td>
772</tr>
773<tr><td><tt class="docutils literal"><span class="pre">rm</span></tt></td>
774<td>The BSD <tt class="docutils literal"><span class="pre">rm</span></tt> command with some tweaking.</td>
775</tr>
776<tr><td><tt class="docutils literal"><span class="pre">rmdir</span></tt></td>
777<td>The BSD <tt class="docutils literal"><span class="pre">rmdir</span></tt> command with some tweaking.</td>
778</tr>
779<tr><td><tt class="docutils literal"><span class="pre">sleep</span></tt></td>
780<td>Typical <tt class="docutils literal"><span class="pre">sleep</span></tt> program, custom kBuild version.</td>
781</tr>
782<tr><td><tt class="docutils literal"><span class="pre">test</span></tt></td>
783<td>The BSD <tt class="docutils literal"><span class="pre">test</span></tt> program with some tweaking.</td>
784</tr>
785</tbody>
786</table>
787<p>Some additional external commands are available in the <tt class="docutils literal"><span class="pre">kmk</span></tt> / <tt class="docutils literal"><span class="pre">kBuild</span></tt>
788environment (<tt class="docutils literal"><span class="pre">kSomething</span></tt> command are not prefixed with <tt class="docutils literal"><span class="pre">kmk_</span></tt>):</p>
789<table border="1" class="docutils">
790<colgroup>
791<col width="20%" />
792<col width="80%" />
793</colgroup>
794<thead valign="bottom">
795<tr><th class="head">Command</th>
796<th class="head">Description</th>
797</tr>
798</thead>
799<tbody valign="top">
800<tr><td><tt class="docutils literal"><span class="pre">kDepPre</span></tt></td>
801<td>Extract dependencies from the C/C++ preprocessor output.</td>
802</tr>
803<tr><td><tt class="docutils literal"><span class="pre">kObjCache</span></tt></td>
804<td>Simple object file cache program.</td>
805</tr>
806<tr><td><tt class="docutils literal"><span class="pre">ash</span></tt></td>
807<td>Almquist's shell (NetBSD variant).</td>
808</tr>
809<tr><td><tt class="docutils literal"><span class="pre">gmake</span></tt></td>
810<td>Vanilla GNU <tt class="docutils literal"><span class="pre">make</span></tt> from same sources as <tt class="docutils literal"><span class="pre">kmk</span></tt>.</td>
811</tr>
812<tr><td><tt class="docutils literal"><span class="pre">redirect</span></tt></td>
813<td>Shell avoidance tool. Sets up file descriptors, environment
814variables and current directory before kicking of program.</td>
815</tr>
816<tr><td><tt class="docutils literal"><span class="pre">sed</span></tt></td>
817<td>GNU <tt class="docutils literal"><span class="pre">sed</span></tt> with some tweaks to avoid involving the shell.</td>
818</tr>
819<tr><td><tt class="docutils literal"><span class="pre">time</span></tt></td>
820<td>Stopwatch utility for measuring program execution time(s).</td>
821</tr>
822</tbody>
823</table>
824</div>
825<div class="section">
826<h1><a id="kmk-expression" name="kmk-expression">kmk-expression</a></h1>
827<p><tt class="docutils literal"><span class="pre">kmk</span></tt>-expressions <a class="footnote-reference" href="#id82" id="id19" name="id19">[1]</a> are related to the C/C++ preprocessor in some ways as
828well as <tt class="docutils literal"><span class="pre">nmake</span></tt> and BSD <tt class="docutils literal"><span class="pre">make</span></tt>. There are however some peculiarities
829because of the way GNU <tt class="docutils literal"><span class="pre">make</span></tt> choose to represent booleans in its function
830library, so, strings can be turned into boolean by taking any non-empty string
831as true.</p>
832<p>Quoting using single quotes results in hard strings, while double quotes and
833unquoted string results in soft strings that can be converted to number or
834boolean to fit the situation.</p>
835<p>Here's the operator table in decending precedence order:</p>
836<table border="1" class="docutils">
837<colgroup>
838<col width="20%" />
839<col width="11%" />
840<col width="70%" />
841</colgroup>
842<thead valign="bottom">
843<tr><th class="head">Operator</th>
844<th class="head">Type</th>
845<th class="head">Description</th>
846</tr>
847</thead>
848<tbody valign="top">
849<tr><td><tt class="docutils literal"><span class="pre">defined</span></tt></td>
850<td rowspan="6">Unary</td>
851<td>Checks if the following variable exists.</td>
852</tr>
853<tr><td><tt class="docutils literal"><span class="pre">exists</span></tt></td>
854<td>Checks if the following file exists.</td>
855</tr>
856<tr><td><tt class="docutils literal"><span class="pre">target</span></tt></td>
857<td>Checks if the following target exists.</td>
858</tr>
859<tr><td><tt class="docutils literal"><span class="pre">bool</span></tt></td>
860<td>Casts the following value to boolean.</td>
861</tr>
862<tr><td><tt class="docutils literal"><span class="pre">num</span></tt></td>
863<td>Casts the following value to a number.</td>
864</tr>
865<tr><td><tt class="docutils literal"><span class="pre">str</span></tt></td>
866<td>Casts the following value to a string.</td>
867</tr>
868<tr><td><tt class="docutils literal"><span class="pre">!</span></tt></td>
869<td rowspan="4">Unary</td>
870<td>Logical NOT.</td>
871</tr>
872<tr><td><tt class="docutils literal"><span class="pre">+</span></tt></td>
873<td>Pluss prefix.</td>
874</tr>
875<tr><td><tt class="docutils literal"><span class="pre">-</span></tt></td>
876<td>Minus prefix.</td>
877</tr>
878<tr><td><tt class="docutils literal"><span class="pre">~</span></tt></td>
879<td>Bitwise one's complement.</td>
880</tr>
881<tr><td><tt class="docutils literal"><span class="pre">*</span></tt></td>
882<td rowspan="3">Binary</td>
883<td>Multiplication (product).</td>
884</tr>
885<tr><td><tt class="docutils literal"><span class="pre">/</span></tt></td>
886<td>Division (quotient).</td>
887</tr>
888<tr><td><tt class="docutils literal"><span class="pre">%</span></tt></td>
889<td>Modulus (remainder).</td>
890</tr>
891<tr><td><tt class="docutils literal"><span class="pre">+</span></tt></td>
892<td rowspan="2">Binary</td>
893<td>Addition (sum).</td>
894</tr>
895<tr><td><tt class="docutils literal"><span class="pre">-</span></tt></td>
896<td>Subtraction (difference).</td>
897</tr>
898<tr><td><tt class="docutils literal"><span class="pre">&lt;&lt;</span></tt></td>
899<td rowspan="2">Binary</td>
900<td>Bitwise left shift.</td>
901</tr>
902<tr><td><tt class="docutils literal"><span class="pre">&gt;&gt;</span></tt></td>
903<td>Bitwise right shift.</td>
904</tr>
905<tr><td><tt class="docutils literal"><span class="pre">&lt;=</span></tt></td>
906<td rowspan="4">Binary</td>
907<td>Less or equal than.</td>
908</tr>
909<tr><td><tt class="docutils literal"><span class="pre">&lt;</span></tt></td>
910<td>Less than.</td>
911</tr>
912<tr><td><tt class="docutils literal"><span class="pre">&gt;=</span></tt></td>
913<td>Greater or equal than.</td>
914</tr>
915<tr><td><tt class="docutils literal"><span class="pre">&gt;</span></tt></td>
916<td>Greater than.</td>
917</tr>
918<tr><td><tt class="docutils literal"><span class="pre">==</span></tt></td>
919<td rowspan="2">Binary</td>
920<td>Equal to.</td>
921</tr>
922<tr><td><tt class="docutils literal"><span class="pre">!=</span></tt></td>
923<td>Not equal to.</td>
924</tr>
925<tr><td><tt class="docutils literal"><span class="pre">&amp;</span></tt></td>
926<td>Binary</td>
927<td>Bitwise AND.</td>
928</tr>
929<tr><td><tt class="docutils literal"><span class="pre">^</span></tt></td>
930<td>Binary</td>
931<td>Bitwise XOR.</td>
932</tr>
933<tr><td><tt class="docutils literal"><span class="pre">|</span></tt></td>
934<td>Binary</td>
935<td>Bitwise OR.</td>
936</tr>
937<tr><td><tt class="docutils literal"><span class="pre">&amp;&amp;</span></tt></td>
938<td>Binary</td>
939<td>Logical AND.</td>
940</tr>
941<tr><td><tt class="docutils literal"><span class="pre">||</span></tt></td>
942<td>Binary</td>
943<td>Logical OR.</td>
944</tr>
945</tbody>
946</table>
947</div>
948<div class="section">
949<h1><a id="built-in-functions" name="built-in-functions">Built-in functions</a></h1>
950<p>String Manipulation Functions:</p>
951<blockquote>
952<p>Replace <tt class="docutils literal"><span class="pre">from</span></tt> with <tt class="docutils literal"><span class="pre">to</span></tt> in <tt class="docutils literal"><span class="pre">text</span></tt>:</p>
953<pre class="literal-block">
954$(subst from,to,text)
955</pre>
956<p>Replace words matching <tt class="docutils literal"><span class="pre">pattern</span></tt> with <tt class="docutils literal"><span class="pre">replacement</span></tt> in <tt class="docutils literal"><span class="pre">text</span></tt>:</p>
957<pre class="literal-block">
958$(patsubst pattern,replacement,text)
959</pre>
960<p>Remove excess whitespace characters from <tt class="docutils literal"><span class="pre">string</span></tt>:</p>
961<pre class="literal-block">
962$(strip string)
963</pre>
964<p>Locate <tt class="docutils literal"><span class="pre">find</span></tt> in <tt class="docutils literal"><span class="pre">text</span></tt>, returning <tt class="docutils literal"><span class="pre">find</span></tt> if found:</p>
965<pre class="literal-block">
966$(findstring find,text)
967</pre>
968<p>Select words in <tt class="docutils literal"><span class="pre">text</span></tt> that match one of the <tt class="docutils literal"><span class="pre">pattern</span></tt> words:</p>
969<pre class="literal-block">
970$(filter pattern...,text)
971</pre>
972<p>Select words in <tt class="docutils literal"><span class="pre">text</span></tt> that do not match any of the <tt class="docutils literal"><span class="pre">pattern</span></tt> words:</p>
973<pre class="literal-block">
974$(filter-out pattern...,text)
975</pre>
976<p>Sort the words in <tt class="docutils literal"><span class="pre">list</span></tt> lexicographically, removing duplicates:</p>
977<pre class="literal-block">
978$(sort list)
979</pre>
980<p>Sort the words in <tt class="docutils literal"><span class="pre">list</span></tt> lexicographically in reserve order, removing
981duplicates <a class="footnote-reference" href="#id82" id="id20" name="id20">[1]</a>:</p>
982<pre class="literal-block">
983$(rsort list)
984</pre>
985<p>Count the number of words in <tt class="docutils literal"><span class="pre">text</span></tt>:</p>
986<pre class="literal-block">
987$(words text)
988</pre>
989<p>Extract the <tt class="docutils literal"><span class="pre">n</span></tt>th word (one-origin) of <tt class="docutils literal"><span class="pre">text</span></tt>:</p>
990<pre class="literal-block">
991$(word n,text)
992</pre>
993<p>Returns the list of words in <tt class="docutils literal"><span class="pre">text</span></tt> from <tt class="docutils literal"><span class="pre">s</span></tt> to <tt class="docutils literal"><span class="pre">e</span></tt> (one-origin):</p>
994<pre class="literal-block">
995$(wordlist s,e,text)
996</pre>
997<p>Extract the first word of <tt class="docutils literal"><span class="pre">names</span></tt>:</p>
998<pre class="literal-block">
999$(firstword names...)
1000</pre>
1001<p>Extract the last word of <tt class="docutils literal"><span class="pre">names</span></tt>:</p>
1002<pre class="literal-block">
1003$(lastword names...)
1004</pre>
1005<p>Join two parallel lists of words:</p>
1006<pre class="literal-block">
1007$(join list1,list2)
1008</pre>
1009<p>Fold <tt class="docutils literal"><span class="pre">text</span></tt> to upper case <a class="footnote-reference" href="#id82" id="id21" name="id21">[1]</a>:</p>
1010<pre class="literal-block">
1011$(toupper text)
1012</pre>
1013<p>Fold <tt class="docutils literal"><span class="pre">text</span></tt> to lower case <a class="footnote-reference" href="#id82" id="id22" name="id22">[1]</a>:</p>
1014<pre class="literal-block">
1015$(tolower text)
1016</pre>
1017<p>String formatting a la the unix <tt class="docutils literal"><span class="pre">printf</span></tt> command <a class="footnote-reference" href="#id82" id="id23" name="id23">[1]</a>:</p>
1018<pre class="literal-block">
1019$(printf fmt, arg...)
1020</pre>
1021<p>Return the length of a string or a (unexpanded) variable <a class="footnote-reference" href="#id82" id="id24" name="id24">[1]</a>:</p>
1022<pre class="literal-block">
1023$(length string)
1024$(length-var var)
1025</pre>
1026<p>Find the position of <tt class="docutils literal"><span class="pre">needle</span></tt> in <tt class="docutils literal"><span class="pre">haystack</span></tt>, returns 0 if not found.
1027Negative <tt class="docutils literal"><span class="pre">start</span></tt> indices are relative to the end of <tt class="docutils literal"><span class="pre">haystack</span></tt>, while
1028positive ones are one based <a class="footnote-reference" href="#id82" id="id25" name="id25">[1]</a>:</p>
1029<pre class="literal-block">
1030$(pos needle, haystack[, start])
1031$(lastpos needle, haystack[, start])
1032</pre>
1033<p>Returns the specified substring. The <tt class="docutils literal"><span class="pre">start</span></tt> works like with <tt class="docutils literal"><span class="pre">$(pos</span> <span class="pre">)</span></tt>.
1034If the substring is partially outside the <tt class="docutils literal"><span class="pre">string</span></tt> the result will be
1035padded with <tt class="docutils literal"><span class="pre">pad</span></tt> if present <a class="footnote-reference" href="#id82" id="id26" name="id26">[1]</a>:</p>
1036<pre class="literal-block">
1037$(substr string, start[, length[, pad]])
1038</pre>
1039<p>Insert <tt class="docutils literal"><span class="pre">in</span></tt> into <tt class="docutils literal"><span class="pre">str</span></tt> at the specified position. <tt class="docutils literal"><span class="pre">n</span></tt> works like with
1040<tt class="docutils literal"><span class="pre">$(pos</span> <span class="pre">)</span></tt>, except that <tt class="docutils literal"><span class="pre">0</span></tt> is the end of the string <a class="footnote-reference" href="#id82" id="id27" name="id27">[1]</a>:</p>
1041<pre class="literal-block">
1042$(insert in, str[, n[, length[, pad]]])
1043</pre>
1044<p>Translate <tt class="docutils literal"><span class="pre">string</span></tt> exchanging characters in <tt class="docutils literal"><span class="pre">from-set</span></tt> with <tt class="docutils literal"><span class="pre">to-set</span></tt>,
1045optionally completing <tt class="docutils literal"><span class="pre">to-set</span></tt> with <tt class="docutils literal"><span class="pre">pad-char</span></tt> if specified. If no
1046<tt class="docutils literal"><span class="pre">pad-char</span></tt> characters absent in <tt class="docutils literal"><span class="pre">to-set</span></tt> will be deleted <a class="footnote-reference" href="#id82" id="id28" name="id28">[1]</a>:</p>
1047<pre class="literal-block">
1048$(translate string, from-set[, to-set[, pad-char]])
1049</pre>
1050</blockquote>
1051<p>Functions for file names:</p>
1052<blockquote>
1053<p>Extract the directory part of each file <tt class="docutils literal"><span class="pre">name</span></tt>:</p>
1054<pre class="literal-block">
1055$(dir names...)
1056</pre>
1057<p>Extract the non-directory part of each file <tt class="docutils literal"><span class="pre">name</span></tt>:</p>
1058<pre class="literal-block">
1059$(notdir names...)
1060</pre>
1061<p>Extract the suffix (the last <tt class="docutils literal"><span class="pre">.</span></tt> and following characters) of each file
1062<tt class="docutils literal"><span class="pre">name</span></tt>:</p>
1063<pre class="literal-block">
1064$(suffix names...)
1065</pre>
1066<p>Extract the base name (name without suffix) of each file name:</p>
1067<pre class="literal-block">
1068$(basename names...)
1069</pre>
1070<p>Append <tt class="docutils literal"><span class="pre">suffix</span></tt> to each word in <tt class="docutils literal"><span class="pre">names</span></tt>:</p>
1071<pre class="literal-block">
1072$(addsuffix suffix,names...)
1073</pre>
1074<p>Prepend <tt class="docutils literal"><span class="pre">prefix</span></tt> to each word in <tt class="docutils literal"><span class="pre">names</span></tt>:</p>
1075<pre class="literal-block">
1076$(addprefix prefix,names...)
1077</pre>
1078<p>Find file names matching a shell file name <tt class="docutils literal"><span class="pre">pattern</span></tt> (not a <tt class="docutils literal"><span class="pre">%</span></tt>
1079pattern):</p>
1080<pre class="literal-block">
1081$(wildcard pattern...)
1082</pre>
1083<p>For each file name in <tt class="docutils literal"><span class="pre">names</span></tt>, expand to an absolute name that does not
1084contain any <tt class="docutils literal"><span class="pre">.</span></tt>, <tt class="docutils literal"><span class="pre">..</span></tt>, nor symlinks:</p>
1085<pre class="literal-block">
1086$(realpath names...)
1087</pre>
1088<p>For each file name in <tt class="docutils literal"><span class="pre">names</span></tt>, expand to an absolute name that does not
1089contain any <tt class="docutils literal"><span class="pre">.</span></tt> or <tt class="docutils literal"><span class="pre">..</span></tt> components, but preserves symlinks:</p>
1090<pre class="literal-block">
1091$(abspath names...)
1092</pre>
1093<p>Same as <tt class="docutils literal"><span class="pre">$(abspath</span> <span class="pre">)</span></tt> except that the current directory can be
1094specified as <tt class="docutils literal"><span class="pre">curdir</span></tt> <a class="footnote-reference" href="#id82" id="id29" name="id29">[1]</a>:</p>
1095<pre class="literal-block">
1096$(abspathex names...[, curdir])
1097</pre>
1098</blockquote>
1099<p>Arithmetic Functions:</p>
1100<blockquote>
1101<p>Returns the sum of the arguments <a class="footnote-reference" href="#id82" id="id30" name="id30">[1]</a>:</p>
1102<pre class="literal-block">
1103$(int-add addend1, addend2[, addendN])
1104</pre>
1105<p>Returns the difference between the first argument and the sum of the
1106rest <a class="footnote-reference" href="#id82" id="id31" name="id31">[1]</a>:</p>
1107<pre class="literal-block">
1108$(int-sub minuend, subtrahend[, subtrahendN])
1109</pre>
1110<p>Returns the product of the arguments <a class="footnote-reference" href="#id82" id="id32" name="id32">[1]</a>:</p>
1111<pre class="literal-block">
1112$(int-mul factor1, factor2[, factorN])
1113</pre>
1114<p>Returns the quotient of first argument and the rest <a class="footnote-reference" href="#id82" id="id33" name="id33">[1]</a>:</p>
1115<pre class="literal-block">
1116$(int-div dividend, divisor[, divisorN])
1117</pre>
1118<p>Returns the modulus of the two arguments <a class="footnote-reference" href="#id82" id="id34" name="id34">[1]</a>:</p>
1119<pre class="literal-block">
1120$(int-mod dividend, divisor)
1121</pre>
1122<p>Returns the bitwise two-complement of argument <a class="footnote-reference" href="#id82" id="id35" name="id35">[1]</a>:</p>
1123<pre class="literal-block">
1124$(int-not val)
1125</pre>
1126<p>Returns the result of a bitwise AND of the arguments <a class="footnote-reference" href="#id82" id="id36" name="id36">[1]</a>:</p>
1127<pre class="literal-block">
1128$(int-and val1, val2[, valN])
1129</pre>
1130<p>Returns the result of a bitwise OR of the arguments <a class="footnote-reference" href="#id82" id="id37" name="id37">[1]</a>:</p>
1131<pre class="literal-block">
1132$(int-or val1, val2[, valN])
1133</pre>
1134<p>Returns the result of a bitwise XOR of the arguments <a class="footnote-reference" href="#id82" id="id38" name="id38">[1]</a>:</p>
1135<pre class="literal-block">
1136$(int-xor val1, val2[, valN])
1137</pre>
1138<p>Returns the <tt class="docutils literal"><span class="pre">kmk</span></tt> boolean (true = non-empty, false = empty) result
1139of <tt class="docutils literal"><span class="pre">val1</span> <span class="pre">==</span> <span class="pre">val2</span></tt> <a class="footnote-reference" href="#id82" id="id39" name="id39">[1]</a>:</p>
1140<pre class="literal-block">
1141$(int-eq val1, val2)
1142</pre>
1143<p>Returns the <tt class="docutils literal"><span class="pre">kmk</span></tt> boolean result of <tt class="docutils literal"><span class="pre">val1</span> <span class="pre">!=</span> <span class="pre">val2</span></tt> <a class="footnote-reference" href="#id82" id="id40" name="id40">[1]</a>:</p>
1144<pre class="literal-block">
1145$(int-ne val1, val2)
1146</pre>
1147<p>Returns the <tt class="docutils literal"><span class="pre">kmk</span></tt> boolean result of <tt class="docutils literal"><span class="pre">val1</span> <span class="pre">&gt;</span> <span class="pre">val2</span></tt> <a class="footnote-reference" href="#id82" id="id41" name="id41">[1]</a>:</p>
1148<pre class="literal-block">
1149$(int-gt val1, val2)
1150</pre>
1151<p>Returns the <tt class="docutils literal"><span class="pre">kmk</span></tt> boolean result of <tt class="docutils literal"><span class="pre">val1</span> <span class="pre">&gt;=</span> <span class="pre">val2</span></tt> <a class="footnote-reference" href="#id82" id="id42" name="id42">[1]</a>:</p>
1152<pre class="literal-block">
1153$(int-ge val1, val2)
1154</pre>
1155<p>Returns the <tt class="docutils literal"><span class="pre">kmk</span></tt> boolean result of <tt class="docutils literal"><span class="pre">val1</span> <span class="pre">&lt;</span> <span class="pre">val2</span></tt> <a class="footnote-reference" href="#id82" id="id43" name="id43">[1]</a>:</p>
1156<pre class="literal-block">
1157$(int-lt val1, val2)
1158</pre>
1159<p>Returns the <tt class="docutils literal"><span class="pre">kmk</span></tt> boolean result of <tt class="docutils literal"><span class="pre">val1</span> <span class="pre">&lt;=</span> <span class="pre">val2</span></tt> <a class="footnote-reference" href="#id82" id="id44" name="id44">[1]</a>:</p>
1160<pre class="literal-block">
1161$(int-le val1, val2)
1162</pre>
1163</blockquote>
1164<p>Boolean and Conditional Functions:</p>
1165<blockquote>
1166<p>Condition is false if the <tt class="docutils literal"><span class="pre">condition</span></tt> evaluates to an empty string
1167(stripped). Evaluate the <tt class="docutils literal"><span class="pre">true-part</span></tt> if the condition is true, otherwise
1168the <tt class="docutils literal"><span class="pre">false-part</span></tt>:</p>
1169<pre class="literal-block">
1170$(if condition,true-part[,false-part])
1171</pre>
1172<p>Test if any of the conditions evalues to non-empty string, returning the
1173first one:</p>
1174<pre class="literal-block">
1175$(or condition1[,condition2[,condition3[...]]])
1176</pre>
1177<p>Test if all of the conditions evaluates to non-empty strings, returning the
1178last one:</p>
1179<pre class="literal-block">
1180$(and condition1[,condition2[,condition3[...]]])
1181</pre>
1182<p>Test if the two strings are identical, returning <tt class="docutils literal"><span class="pre">kmk</span></tt> boolean (true =
1183non-empty, false = empty) <a class="footnote-reference" href="#id83" id="id45" name="id45">[2]</a>:</p>
1184<pre class="literal-block">
1185$(eq str1, str2)
1186</pre>
1187<p>Invert a <tt class="docutils literal"><span class="pre">kmk</span></tt> boolean value <a class="footnote-reference" href="#id83" id="id46" name="id46">[2]</a>:</p>
1188<pre class="literal-block">
1189$(not val)
1190</pre>
1191<p>Test if <tt class="docutils literal"><span class="pre">variable</span></tt> is defined, returning a <tt class="docutils literal"><span class="pre">kmk</span></tt> boolean value <a class="footnote-reference" href="#id82" id="id47" name="id47">[1]</a>:</p>
1192<pre class="literal-block">
1193$(defined variable)
1194</pre>
1195<p>Test if <tt class="docutils literal"><span class="pre">set-a</span></tt> and <tt class="docutils literal"><span class="pre">set-b</span></tt> intersects, returning a <tt class="docutils literal"><span class="pre">kmk</span></tt> boolean
1196value <a class="footnote-reference" href="#id82" id="id48" name="id48">[1]</a>:</p>
1197<pre class="literal-block">
1198$(intersects set-a, set-b)
1199</pre>
1200<p>Same as <tt class="docutils literal"><span class="pre">$(if</span> <span class="pre">)</span></tt> execpt that the condition is a <tt class="docutils literal"><span class="pre">kmk</span></tt>-expression <a class="footnote-reference" href="#id82" id="id49" name="id49">[1]</a>:</p>
1201<pre class="literal-block">
1202$(if-expr kmk-expression,true-part[,false-part])
1203</pre>
1204<p>Select the first true condition (<tt class="docutils literal"><span class="pre">kmk</span></tt>-expression) and expand the
1205following body. Special condition strings <tt class="docutils literal"><span class="pre">default</span></tt> and
1206<tt class="docutils literal"><span class="pre">otherwise</span></tt> <a class="footnote-reference" href="#id82" id="id50" name="id50">[1]</a>:</p>
1207<pre class="literal-block">
1208$(select when1-cond, when1-body[, whenN-cond, whenN-body])
1209</pre>
1210<p>Evalutate the <tt class="docutils literal"><span class="pre">kmk-expression</span></tt> returning what it evalues as. This is
1211the preferred way of doing arithmentic now <a class="footnote-reference" href="#id82" id="id51" name="id51">[1]</a>:</p>
1212<pre class="literal-block">
1213$(expr kmk-expression)
1214</pre>
1215</blockquote>
1216<p>Stack Fuctions:</p>
1217<blockquote>
1218<p>Push <tt class="docutils literal"><span class="pre">item</span></tt> onto the <tt class="docutils literal"><span class="pre">stack-var</span></tt>, returning the empty string <a class="footnote-reference" href="#id82" id="id52" name="id52">[1]</a>:</p>
1219<pre class="literal-block">
1220$(stack-push stack-var, item)
1221</pre>
1222<p>Pop the top item off the <tt class="docutils literal"><span class="pre">stack-var</span></tt> <a class="footnote-reference" href="#id82" id="id53" name="id53">[1]</a>:</p>
1223<pre class="literal-block">
1224$(stack-pop stack-var)
1225</pre>
1226<p>Pop the top item off the <tt class="docutils literal"><span class="pre">stack-var</span></tt>, returning the empty string <a class="footnote-reference" href="#id82" id="id54" name="id54">[1]</a>:</p>
1227<pre class="literal-block">
1228$(stack-popv stack-var)
1229</pre>
1230<p>Get the top item of the <tt class="docutils literal"><span class="pre">stack-var</span></tt>, returning the empty string <a class="footnote-reference" href="#id82" id="id55" name="id55">[1]</a>:</p>
1231<pre class="literal-block">
1232$(stack-top stack-var)
1233</pre>
1234</blockquote>
1235<p>Advanced Functions:</p>
1236<blockquote>
1237<p>Evaluates to the contents of the variable <tt class="docutils literal"><span class="pre">var</span></tt>, with no expansion
1238performed on it:</p>
1239<pre class="literal-block">
1240$(value var)
1241</pre>
1242<p>Evaluate <tt class="docutils literal"><span class="pre">body</span></tt> with <tt class="docutils literal"><span class="pre">var</span></tt> bound to each word in <tt class="docutils literal"><span class="pre">words</span></tt>, and
1243concatenate the results (spaced):</p>
1244<pre class="literal-block">
1245$(foreach var,words,body)
1246</pre>
1247<p>C-style for-loop. Start by evaluating <tt class="docutils literal"><span class="pre">init</span></tt>. Each iteration will
1248first check whether the <tt class="docutils literal"><span class="pre">condition</span></tt> (<tt class="docutils literal"><span class="pre">kmk</span></tt>-expression) is true,
1249then expand <tt class="docutils literal"><span class="pre">body</span></tt> concatenating the result to the previous iterations
1250(spaced), and finally evaluate <tt class="docutils literal"><span class="pre">next</span></tt> <a class="footnote-reference" href="#id82" id="id56" name="id56">[1]</a>:</p>
1251<pre class="literal-block">
1252$(for init,conditions,next,body)
1253</pre>
1254<p>C-style while-loop. Each iteration will check whether the <tt class="docutils literal"><span class="pre">condition</span></tt>
1255(<tt class="docutils literal"><span class="pre">kmk</span></tt>-expression) is true, then expand <tt class="docutils literal"><span class="pre">body</span></tt> concatenating the
1256result to the previous iterations <a class="footnote-reference" href="#id82" id="id57" name="id57">[1]</a>:</p>
1257<pre class="literal-block">
1258$(while conditions,body)
1259</pre>
1260<p>Evaluate the variable <tt class="docutils literal"><span class="pre">var</span></tt> replacing any references to <tt class="docutils literal"><span class="pre">$(1)</span></tt>,
1261<tt class="docutils literal"><span class="pre">$(2)</span></tt> with the first, second, etc. <tt class="docutils literal"><span class="pre">param</span></tt> values:</p>
1262<pre class="literal-block">
1263$(call var,param,...)
1264</pre>
1265<p>Evaluate <tt class="docutils literal"><span class="pre">text</span></tt> then read the results as makefile commands. Expands
1266to the empty string:</p>
1267<pre class="literal-block">
1268$(eval text)
1269</pre>
1270<p>Same as <tt class="docutils literal"><span class="pre">$(eval</span> <span class="pre">text)</span></tt> except that the <tt class="docutils literal"><span class="pre">text</span></tt> is expanded in its
1271own variable context <a class="footnote-reference" href="#id82" id="id58" name="id58">[1]</a>:</p>
1272<pre class="literal-block">
1273$(evalctx text)
1274</pre>
1275<p>Same as <tt class="docutils literal"><span class="pre">$(eval</span> <span class="pre">$(value</span> <span class="pre">var))</span></tt> <a class="footnote-reference" href="#id82" id="id59" name="id59">[1]</a>:</p>
1276<pre class="literal-block">
1277$(evalval var)
1278</pre>
1279<p>Same as <tt class="docutils literal"><span class="pre">$(evalctx</span> <span class="pre">$(value</span> <span class="pre">var))</span></tt> <a class="footnote-reference" href="#id82" id="id60" name="id60">[1]</a>:</p>
1280<pre class="literal-block">
1281$(evalvalctx var)
1282</pre>
1283<p>A combination of <tt class="docutils literal"><span class="pre">$(eval</span> <span class="pre">)</span></tt>, <tt class="docutils literal"><span class="pre">$(call</span> <span class="pre">)</span></tt> and <tt class="docutils literal"><span class="pre">$(value</span> <span class="pre">)</span></tt> <a class="footnote-reference" href="#id82" id="id61" name="id61">[1]</a>:</p>
1284<pre class="literal-block">
1285$(evalcall var)
1286</pre>
1287<p>A combination of <tt class="docutils literal"><span class="pre">$(eval</span> <span class="pre">)</span></tt> and <tt class="docutils literal"><span class="pre">$(call</span> <span class="pre">)</span></tt> <a class="footnote-reference" href="#id82" id="id62" name="id62">[1]</a>:</p>
1288<pre class="literal-block">
1289$(evalcall var)
1290</pre>
1291<p>Remove comments and blank lines from the variable <tt class="docutils literal"><span class="pre">var</span></tt>. Expands to
1292the empty string <a class="footnote-reference" href="#id82" id="id63" name="id63">[1]</a>:</p>
1293<pre class="literal-block">
1294$(eval-opt-var var)
1295</pre>
1296<p>Returns accessing <tt class="docutils literal"><span class="pre">$&lt;</span></tt> of <tt class="docutils literal"><span class="pre">target</span></tt>, either retriving the whole thing
1297or the file at <tt class="docutils literal"><span class="pre">pos</span></tt> (one-origin) <a class="footnote-reference" href="#id82" id="id64" name="id64">[1]</a>:</p>
1298<pre class="literal-block">
1299$(deps target[, pos])
1300</pre>
1301<p>Returns accessing <tt class="docutils literal"><span class="pre">$+</span></tt> (order + duplicates) of <tt class="docutils literal"><span class="pre">target</span></tt>, either
1302retriving the whole thing or the file at <tt class="docutils literal"><span class="pre">pos</span></tt> (one-origin) <a class="footnote-reference" href="#id82" id="id65" name="id65">[1]</a>:</p>
1303<pre class="literal-block">
1304$(deps-all target[, pos])
1305</pre>
1306<p>Returns accessing <tt class="docutils literal"><span class="pre">$?</span></tt> of <tt class="docutils literal"><span class="pre">target</span></tt>, either retriving the whole
1307thing or the file at <tt class="docutils literal"><span class="pre">pos</span></tt> (one-origin) <a class="footnote-reference" href="#id82" id="id66" name="id66">[1]</a>:</p>
1308<pre class="literal-block">
1309$(deps-newer target[, pos])
1310</pre>
1311<p>Returns accessing <tt class="docutils literal"><span class="pre">$|</span></tt> (order only) of <tt class="docutils literal"><span class="pre">target</span></tt>, either retriving the
1312whole thing or the file at <tt class="docutils literal"><span class="pre">pos</span></tt> (one-origin) <a class="footnote-reference" href="#id82" id="id67" name="id67">[1]</a>:</p>
1313<pre class="literal-block">
1314$(deps-oo target[, pos])
1315</pre>
1316</blockquote>
1317<p>Command Functions:</p>
1318<blockquote>
1319<p>Create one or more command lines avoiding the max argument
1320length restriction of the host OS <a class="footnote-reference" href="#id82" id="id68" name="id68">[1]</a>:</p>
1321<pre class="literal-block">
1322$(xargs ar cas mylib.a,$(objects))
1323$(xargs ar cas mylib.a,ar as mylib.a,$(objects))
1324</pre>
1325<p>Returns the commands for the specified target separated by new-line, space,
1326or a user defined string. Note that this might not produce the 100% correct
1327result if any of the prerequisite automatic variables are used <a class="footnote-reference" href="#id82" id="id69" name="id69">[1]</a>:</p>
1328<pre class="literal-block">
1329$(commands target)
1330$(commands-sc target)
1331$(commands-usr target,sep)
1332</pre>
1333<p>Compares two commands returning the empty string if equal and the 3rd
1334argument if not. This differs from <tt class="docutils literal"><span class="pre">$(comp-vars</span> <span class="pre">v1,v2,ne)</span></tt> in that
1335line by line is stripped of leading spaces, command prefixes and
1336trailing spaces before comparing <a class="footnote-reference" href="#id82" id="id70" name="id70">[1]</a>:</p>
1337<pre class="literal-block">
1338$(comp-cmds cmds-var1, cmds-var2, ne)
1339$(comp-cmds-ex cmds1, cmd2, ne)
1340</pre>
1341<p>Compares the values of the two variables returning the empty string if
1342equal and the 3rd argument if not. Leading and trailing spaces is
1343ignored <a class="footnote-reference" href="#id82" id="id71" name="id71">[1]</a>:</p>
1344<pre class="literal-block">
1345$(comp-var var1, var2, ne)
1346</pre>
1347</blockquote>
1348<p>Utility functions:</p>
1349<blockquote>
1350<p>When this function is evaluated, <tt class="docutils literal"><span class="pre">kmk</span></tt> generates a fatal error with the
1351message <tt class="docutils literal"><span class="pre">text</span></tt>:</p>
1352<pre class="literal-block">
1353$(error text...)
1354</pre>
1355<p>When this function is evaluated, <tt class="docutils literal"><span class="pre">kmk</span></tt> generates a warning with the
1356message <tt class="docutils literal"><span class="pre">text</span></tt>:</p>
1357<pre class="literal-block">
1358$(warning text...)
1359</pre>
1360<p>When this function is evaluated, <tt class="docutils literal"><span class="pre">kmk</span></tt> generates a info with the
1361message <tt class="docutils literal"><span class="pre">text</span></tt>:</p>
1362<pre class="literal-block">
1363$(info text...)
1364</pre>
1365<p>Execute a shell <tt class="docutils literal"><span class="pre">command</span></tt> and return its output:</p>
1366<pre class="literal-block">
1367$(shell command)
1368</pre>
1369<p>Return a string describing how the <tt class="docutils literal"><span class="pre">kmk</span></tt> variable <tt class="docutils literal"><span class="pre">variable</span></tt> was defined:</p>
1370<pre class="literal-block">
1371$(origin variable)
1372</pre>
1373<p>Return a string describing the flavor of the <tt class="docutils literal"><span class="pre">kmk</span></tt> variable <tt class="docutils literal"><span class="pre">variable</span></tt>:</p>
1374<pre class="literal-block">
1375$(flavor variable)
1376</pre>
1377<p>Returns the current local time and date formatted in the <tt class="docutils literal"><span class="pre">strftime</span></tt>
1378style specifier <tt class="docutils literal"><span class="pre">fmt</span></tt>. <tt class="docutils literal"><span class="pre">fmt</span></tt> defaults to <tt class="docutils literal"><span class="pre">%Y-%m-%dT%H:%M:%S</span></tt> when
1379not specified <a class="footnote-reference" href="#id82" id="id72" name="id72">[1]</a>:</p>
1380<pre class="literal-block">
1381$(date fmt)
1382</pre>
1383<p>Returns the current UTC time and date formatted in the <tt class="docutils literal"><span class="pre">strftime</span></tt>
1384style specifier <tt class="docutils literal"><span class="pre">fmt</span></tt>. <tt class="docutils literal"><span class="pre">fmt</span></tt> defaults to <tt class="docutils literal"><span class="pre">%Y-%m-%dT%H:%M:%SZ</span></tt> when
1385not specified <a class="footnote-reference" href="#id82" id="id73" name="id73">[1]</a>:</p>
1386<pre class="literal-block">
1387$(date-utc fmt)
1388</pre>
1389<p>Reformats the <tt class="docutils literal"><span class="pre">in</span></tt> time and date using <tt class="docutils literal"><span class="pre">fmt</span></tt>. The <tt class="docutils literal"><span class="pre">in-fmt</span></tt> defaults
1390to <tt class="docutils literal"><span class="pre">fmt</span></tt> if not specified. While <tt class="docutils literal"><span class="pre">fmt</span></tt> defaults to
1391<tt class="docutils literal"><span class="pre">%Y-%m-%dT%H:%M:%SZ</span></tt> if not specified <a class="footnote-reference" href="#id82" id="id74" name="id74">[1]</a>:</p>
1392<pre class="literal-block">
1393$(date-utc fmt,time,in-fmt)
1394</pre>
1395<p>Returns the current nanosecond timestamp (monotonic when possible) <a class="footnote-reference" href="#id82" id="id75" name="id75">[1]</a>:</p>
1396<pre class="literal-block">
1397$(nanots )
1398</pre>
1399<p>Returns the size of the specified file, or -1 if the size could not
1400be obtained. This can be used to check if a file exist or not <a class="footnote-reference" href="#id82" id="id76" name="id76">[1]</a>:</p>
1401<pre class="literal-block">
1402$(file-size file)
1403</pre>
1404<p>Searches the <tt class="docutils literal"><span class="pre">PATH</span></tt> <tt class="docutils literal"><span class="pre">kmk</span></tt> variable for the specified <tt class="docutils literal"><span class="pre">files</span></tt> <a class="footnote-reference" href="#id82" id="id77" name="id77">[1]</a>:</p>
1405<pre class="literal-block">
1406$(which files...)
1407</pre>
1408<p>OS/2: Returns the specified LIBPATH variable value <a class="footnote-reference" href="#id82" id="id78" name="id78">[1]</a>:</p>
1409<pre class="literal-block">
1410$(libpath var)
1411</pre>
1412<p>OS/2: Sets the specified LIBPATH variable value, returning the empty
1413string <a class="footnote-reference" href="#id82" id="id79" name="id79">[1]</a>:</p>
1414<pre class="literal-block">
1415$(libpath var,value)
1416</pre>
1417</blockquote>
1418<p>Debugging Functions:</p>
1419<blockquote>
1420<p>Returns various make statistics, if no item is specified a default
1421selection is returned <a class="footnote-reference" href="#id82" id="id80" name="id80">[1]</a>:</p>
1422<pre class="literal-block">
1423$(make-stats item[,itemN])
1424</pre>
1425<p>Raise a debug breakpoint. Used for debugging <tt class="docutils literal"><span class="pre">kmk</span></tt> makefile
1426parsing <a class="footnote-reference" href="#id82" id="id81" name="id81">[1]</a>:</p>
1427<pre class="literal-block">
1428$(breakpoint )
1429</pre>
1430</blockquote>
1431<hr class="docutils" />
1432<table class="docutils footnote" frame="void" id="id82" rules="none">
1433<colgroup><col class="label" /><col /></colgroup>
1434<tbody valign="top">
1435<tr><td class="label"><a name="id82">[1]</a></td><td><em>(<a class="fn-backref" href="#id1">1</a>, <a class="fn-backref" href="#id2">2</a>, <a class="fn-backref" href="#id3">3</a>, <a class="fn-backref" href="#id4">4</a>, <a class="fn-backref" href="#id5">5</a>, <a class="fn-backref" href="#id6">6</a>, <a class="fn-backref" href="#id7">7</a>, <a class="fn-backref" href="#id8">8</a>, <a class="fn-backref" href="#id9">9</a>, <a class="fn-backref" href="#id10">10</a>, <a class="fn-backref" href="#id11">11</a>, <a class="fn-backref" href="#id12">12</a>, <a class="fn-backref" href="#id13">13</a>, <a class="fn-backref" href="#id14">14</a>, <a class="fn-backref" href="#id15">15</a>, <a class="fn-backref" href="#id16">16</a>, <a class="fn-backref" href="#id17">17</a>, <a class="fn-backref" href="#id18">18</a>, <a class="fn-backref" href="#id19">19</a>, <a class="fn-backref" href="#id20">20</a>, <a class="fn-backref" href="#id21">21</a>, <a class="fn-backref" href="#id22">22</a>, <a class="fn-backref" href="#id23">23</a>, <a class="fn-backref" href="#id24">24</a>, <a class="fn-backref" href="#id25">25</a>, <a class="fn-backref" href="#id26">26</a>, <a class="fn-backref" href="#id27">27</a>, <a class="fn-backref" href="#id28">28</a>, <a class="fn-backref" href="#id29">29</a>, <a class="fn-backref" href="#id30">30</a>, <a class="fn-backref" href="#id31">31</a>, <a class="fn-backref" href="#id32">32</a>, <a class="fn-backref" href="#id33">33</a>, <a class="fn-backref" href="#id34">34</a>, <a class="fn-backref" href="#id35">35</a>, <a class="fn-backref" href="#id36">36</a>, <a class="fn-backref" href="#id37">37</a>, <a class="fn-backref" href="#id38">38</a>, <a class="fn-backref" href="#id39">39</a>, <a class="fn-backref" href="#id40">40</a>, <a class="fn-backref" href="#id41">41</a>, <a class="fn-backref" href="#id42">42</a>, <a class="fn-backref" href="#id43">43</a>, <a class="fn-backref" href="#id44">44</a>, <a class="fn-backref" href="#id47">45</a>, <a class="fn-backref" href="#id48">46</a>, <a class="fn-backref" href="#id49">47</a>, <a class="fn-backref" href="#id50">48</a>, <a class="fn-backref" href="#id51">49</a>, <a class="fn-backref" href="#id52">50</a>, <a class="fn-backref" href="#id53">51</a>, <a class="fn-backref" href="#id54">52</a>, <a class="fn-backref" href="#id55">53</a>, <a class="fn-backref" href="#id56">54</a>, <a class="fn-backref" href="#id57">55</a>, <a class="fn-backref" href="#id58">56</a>, <a class="fn-backref" href="#id59">57</a>, <a class="fn-backref" href="#id60">58</a>, <a class="fn-backref" href="#id61">59</a>, <a class="fn-backref" href="#id62">60</a>, <a class="fn-backref" href="#id63">61</a>, <a class="fn-backref" href="#id64">62</a>, <a class="fn-backref" href="#id65">63</a>, <a class="fn-backref" href="#id66">64</a>, <a class="fn-backref" href="#id67">65</a>, <a class="fn-backref" href="#id68">66</a>, <a class="fn-backref" href="#id69">67</a>, <a class="fn-backref" href="#id70">68</a>, <a class="fn-backref" href="#id71">69</a>, <a class="fn-backref" href="#id72">70</a>, <a class="fn-backref" href="#id73">71</a>, <a class="fn-backref" href="#id74">72</a>, <a class="fn-backref" href="#id75">73</a>, <a class="fn-backref" href="#id76">74</a>, <a class="fn-backref" href="#id77">75</a>, <a class="fn-backref" href="#id78">76</a>, <a class="fn-backref" href="#id79">77</a>, <a class="fn-backref" href="#id80">78</a>, <a class="fn-backref" href="#id81">79</a>)</em> <tt class="docutils literal"><span class="pre">kmk</span></tt> only feature.</td></tr>
1436</tbody>
1437</table>
1438<table class="docutils footnote" frame="void" id="id83" rules="none">
1439<colgroup><col class="label" /><col /></colgroup>
1440<tbody valign="top">
1441<tr><td class="label"><a name="id83">[2]</a></td><td><em>(<a class="fn-backref" href="#id45">1</a>, <a class="fn-backref" href="#id46">2</a>)</em> Experimental GNU <tt class="docutils literal"><span class="pre">make</span></tt> feature that is not enabled by default.</td></tr>
1442</tbody>
1443</table>
1444<hr class="docutils" />
1445<table class="docutils field-list" frame="void" rules="none">
1446<col class="field-name" />
1447<col class="field-body" />
1448<tbody valign="top">
1449<tr class="field"><th class="field-name">Status:</th><td class="field-body"><p class="first">$Id: QuickReference-kmk.html 2171 2008-12-30 22:18:10Z bird $</p>
1450</td>
1451</tr>
1452<tr class="field"><th class="field-name">Copyright:</th><td class="field-body"><p class="first">Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
14531996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
14542007 Free Software Foundation, Inc.</p>
1455<p class="last">Copyright (C) 2008 Knut St. Osmundsen</p>
1456</td>
1457</tr>
1458</tbody>
1459</table>
1460</div>
1461</div>
1462</body>
1463</html>
Note: See TracBrowser for help on using the repository browser.