VirtualBox

Changeset 2170 in kBuild


Ignore:
Timestamp:
Dec 30, 2008 8:39:35 PM (16 years ago)
Author:
bird
Message:

kmk-qr: filled in the kmk-only markers for the rest of the stuff.

Location:
trunk/kBuild/doc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/doc/QuickReference-kmk.html

    r2169 r2170  
    297297Since <em>all</em> the features are included, the quickness of this reference can be
    298298disputed. ;-)</p>
    299 <p>Features that are</p>
    300299<div class="section">
    301300<h1><a id="directives" name="directives">Directives</a></h1>
     
    329328sinclude file
    330329</pre>
    331 <p>Include another dependency file <a class="footnote-reference" href="#id15" id="id1" name="id1">[1]</a>:</p>
     330<p>Include another dependency file <a class="footnote-reference" href="#id80" id="id1" name="id1">[1]</a>:</p>
    332331<pre class="literal-block">
    333332includedep file
     
    359358unexport variable
    360359</pre>
    361 <p>Define a variable in the local context instead of the global one <a class="footnote-reference" href="#id15" id="id2" name="id2">[1]</a>:</p>
     360<p>Define a variable in the local context instead of the global one <a class="footnote-reference" href="#id80" id="id2" name="id2">[1]</a>:</p>
    362361<pre class="literal-block">
    363362local variable = value
     
    510509<tt class="docutils literal"><span class="pre">KBUILD_KMK_REVISION</span></tt></td>
    511510<td>The kBuild version string and the break down
    512 into individual components. <a class="footnote-reference" href="#id15" id="id3" name="id3">[1]</a></td>
    513 </tr>
    514 <tr><td><tt class="docutils literal"><span class="pre">KBUILD_HOST</span></tt> <a class="footnote-reference" href="#id15" id="id4" name="id4">[1]</a></td>
     511into individual components. <a class="footnote-reference" href="#id80" 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="#id80" id="id4" name="id4">[1]</a></td>
    515514<td>The host operating system.</td>
    516515</tr>
    517 <tr><td><tt class="docutils literal"><span class="pre">KBUILD_HOST_ARCH</span></tt> <a class="footnote-reference" href="#id15" id="id5" name="id5">[1]</a></td>
     516<tr><td><tt class="docutils literal"><span class="pre">KBUILD_HOST_ARCH</span></tt> <a class="footnote-reference" href="#id80" id="id5" name="id5">[1]</a></td>
    518517<td>The host architecture.</td>
    519518</tr>
    520 <tr><td><tt class="docutils literal"><span class="pre">KBUILD_HOST_CPU</span></tt> <a class="footnote-reference" href="#id15" id="id6" name="id6">[1]</a></td>
     519<tr><td><tt class="docutils literal"><span class="pre">KBUILD_HOST_CPU</span></tt> <a class="footnote-reference" href="#id80" id="id6" name="id6">[1]</a></td>
    521520<td>The host CPU <tt class="docutils literal"><span class="pre">kmk</span></tt> is built for, set to
    522521<tt class="docutils literal"><span class="pre">blend</span></tt> if not any particular CPU.</td>
    523522</tr>
    524 <tr><td><tt class="docutils literal"><span class="pre">KBUILD_PATH</span></tt> <a class="footnote-reference" href="#id15" id="id7" name="id7">[1]</a></td>
     523<tr><td><tt class="docutils literal"><span class="pre">KBUILD_PATH</span></tt> <a class="footnote-reference" href="#id80" id="id7" name="id7">[1]</a></td>
    525524<td>Where the kBuild scripts are.</td>
    526525</tr>
    527 <tr><td><tt class="docutils literal"><span class="pre">KBUILD_BIN_PATH</span></tt> <a class="footnote-reference" href="#id15" id="id8" name="id8">[1]</a></td>
     526<tr><td><tt class="docutils literal"><span class="pre">KBUILD_BIN_PATH</span></tt> <a class="footnote-reference" href="#id80" id="id8" name="id8">[1]</a></td>
    528527<td>Where the host specific kBuild binaries are.</td>
    529528</tr>
    530 <tr><td><tt class="docutils literal"><span class="pre">KMK</span></tt> <a class="footnote-reference" href="#id15" id="id9" name="id9">[1]</a>,
     529<tr><td><tt class="docutils literal"><span class="pre">KMK</span></tt> <a class="footnote-reference" href="#id80" id="id9" name="id9">[1]</a>,
    531530<tt class="docutils literal"><span class="pre">MAKE</span></tt></td>
    532531<td>The name with which <tt class="docutils literal"><span class="pre">kmk</span></tt> was invoked. Using
    533532this variable in recipes has special meaning.</td>
    534533</tr>
    535 <tr><td><tt class="docutils literal"><span class="pre">KMK_BUILTIN</span></tt> <a class="footnote-reference" href="#id15" id="id10" name="id10">[1]</a></td>
     534<tr><td><tt class="docutils literal"><span class="pre">KMK_BUILTIN</span></tt> <a class="footnote-reference" href="#id80" id="id10" name="id10">[1]</a></td>
    536535<td>List of built-in commands.</td>
    537536</tr>
    538 <tr><td><tt class="docutils literal"><span class="pre">KMK_FEATURES</span></tt> <a class="footnote-reference" href="#id15" id="id11" name="id11">[1]</a></td>
     537<tr><td><tt class="docutils literal"><span class="pre">KMK_FEATURES</span></tt> <a class="footnote-reference" href="#id80" id="id11" name="id11">[1]</a></td>
    539538<td>List of <tt class="docutils literal"><span class="pre">kmk</span></tt> specific features.</td>
    540539</tr>
    541 <tr><td><tt class="docutils literal"><span class="pre">KMK_FLAGS</span></tt> <a class="footnote-reference" href="#id15" id="id12" name="id12">[1]</a></td>
     540<tr><td><tt class="docutils literal"><span class="pre">KMK_FLAGS</span></tt> <a class="footnote-reference" href="#id80" id="id12" name="id12">[1]</a></td>
    542541<td><p class="first">The flags given to <tt class="docutils literal"><span class="pre">kmk</span></tt>. You can set this in
    543542the environment or a makefile to set flags.</p>
     
    549548</td>
    550549</tr>
    551 <tr><td><tt class="docutils literal"><span class="pre">KMK_LEVEL</span></tt> <a class="footnote-reference" href="#id15" id="id13" name="id13">[1]</a></td>
     550<tr><td><tt class="docutils literal"><span class="pre">KMK_LEVEL</span></tt> <a class="footnote-reference" href="#id80" id="id13" name="id13">[1]</a></td>
    552551<td>The number of levels of recursion (sub-makes).</td>
    553552</tr>
    554 <tr><td><tt class="docutils literal"><span class="pre">KMK_VERSION</span></tt> <a class="footnote-reference" href="#id15" id="id14" name="id14">[1]</a></td>
     553<tr><td><tt class="docutils literal"><span class="pre">KMK_VERSION</span></tt> <a class="footnote-reference" href="#id80" id="id14" name="id14">[1]</a></td>
    555554<td>The GNU <tt class="docutils literal"><span class="pre">make</span></tt> version number.</td>
    556555</tr>
     
    588587</tbody>
    589588</table>
    590 <p>The following variables reflects <tt class="docutils literal"><span class="pre">kmk</span></tt> options. Do not set these.</p>
     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="#id80" id="id15" name="id15">[1]</a></p>
    591590<table border="1" class="docutils">
    592591<colgroup>
     
    633632<div class="section">
    634633<h1><a id="commands" name="commands">Commands</a></h1>
    635 <p>Builtin commands all start with <tt class="docutils literal"><span class="pre">kmk_builtin_</span></tt>, so in order to save space
    636 this prefix has been omitted in the table below. All commands comes in an
     634<p>Builtin commands <a class="footnote-reference" href="#id80" id="id16" name="id16">[1]</a> all start with <tt class="docutils literal"><span class="pre">kmk_builtin_</span></tt>, so in order to save
     635space this prefix has been omitted in the table below. All commands comes in an
    637636external edition that can be used by/in the shell, these are prefixed <tt class="docutils literal"><span class="pre">kmk_</span></tt>.</p>
    638637<table border="1" class="docutils">
     
    744743<div class="section">
    745744<h1><a id="kmk-expression" name="kmk-expression">kmk-expression</a></h1>
    746 <p><tt class="docutils literal"><span class="pre">kmk</span></tt>-expressions are related to the C/C++ preprocessor in some ways as well
    747 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 because of
    748 the way GNU <tt class="docutils literal"><span class="pre">make</span></tt> choose to represent booleans in its function library, so,
    749 strings can be turned into boolean by taking any non-empty string as true.</p>
     745<p><tt class="docutils literal"><span class="pre">kmk</span></tt>-expressions <a class="footnote-reference" href="#id80" id="id17" name="id17">[1]</a> are related to the C/C++ preprocessor in some ways as
     746well 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
     747because of the way GNU <tt class="docutils literal"><span class="pre">make</span></tt> choose to represent booleans in its function
     748library, so, strings can be turned into boolean by taking any non-empty string
     749as true.</p>
    750750<p>Quoting using single quotes results in hard strings, while double quotes and
    751751unquoted string results in soft strings that can be converted to number or
     
    897897</pre>
    898898<p>Sort the words in <tt class="docutils literal"><span class="pre">list</span></tt> lexicographically in reserve order, removing
    899 duplicates:</p>
     899duplicates <a class="footnote-reference" href="#id80" id="id18" name="id18">[1]</a>:</p>
    900900<pre class="literal-block">
    901901$(rsort list)
     
    925925$(join list1,list2)
    926926</pre>
    927 <p>Fold <tt class="docutils literal"><span class="pre">text</span></tt> to upper case:</p>
     927<p>Fold <tt class="docutils literal"><span class="pre">text</span></tt> to upper case <a class="footnote-reference" href="#id80" id="id19" name="id19">[1]</a>:</p>
    928928<pre class="literal-block">
    929929$(toupper text)
    930930</pre>
    931 <p>Fold <tt class="docutils literal"><span class="pre">text</span></tt> to lower case:</p>
     931<p>Fold <tt class="docutils literal"><span class="pre">text</span></tt> to lower case <a class="footnote-reference" href="#id80" id="id20" name="id20">[1]</a>:</p>
    932932<pre class="literal-block">
    933933$(tolower text)
    934934</pre>
    935 <p>String formatting a la the unix <tt class="docutils literal"><span class="pre">printf</span></tt> command:</p>
     935<p>String formatting a la the unix <tt class="docutils literal"><span class="pre">printf</span></tt> command <a class="footnote-reference" href="#id80" id="id21" name="id21">[1]</a>:</p>
    936936<pre class="literal-block">
    937937$(printf fmt, arg...)
    938938</pre>
    939 <p>Return the length of a string or a (unexpanded) variable:</p>
     939<p>Return the length of a string or a (unexpanded) variable <a class="footnote-reference" href="#id80" id="id22" name="id22">[1]</a>:</p>
    940940<pre class="literal-block">
    941941$(length string)
     
    944944<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.
    945945Negative <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
    946 positive ones are one based:</p>
     946positive ones are one based <a class="footnote-reference" href="#id80" id="id23" name="id23">[1]</a>:</p>
    947947<pre class="literal-block">
    948948$(pos needle, haystack[, start])
     
    951951<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>.
    952952If the substring is partially outside the <tt class="docutils literal"><span class="pre">string</span></tt> the result will be
    953 padded with <tt class="docutils literal"><span class="pre">pad</span></tt> if present:</p>
     953padded with <tt class="docutils literal"><span class="pre">pad</span></tt> if present <a class="footnote-reference" href="#id80" id="id24" name="id24">[1]</a>:</p>
    954954<pre class="literal-block">
    955955$(substr string, start[, length[, pad]])
    956956</pre>
    957957<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
    958 <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:</p>
     958<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="#id80" id="id25" name="id25">[1]</a>:</p>
    959959<pre class="literal-block">
    960960$(insert in, str[, n[, length[, pad]]])
     
    962962<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>,
    963963optionally 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
    964 <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:</p>
     964<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="#id80" id="id26" name="id26">[1]</a>:</p>
    965965<pre class="literal-block">
    966966$(translate string, from-set[, to-set[, pad-char]])
     
    10101010</pre>
    10111011<p>Same as <tt class="docutils literal"><span class="pre">$(abspath</span> <span class="pre">)</span></tt> except that the current directory can be
    1012 specified as <tt class="docutils literal"><span class="pre">curdir</span></tt>:</p>
     1012specified as <tt class="docutils literal"><span class="pre">curdir</span></tt> <a class="footnote-reference" href="#id80" id="id27" name="id27">[1]</a>:</p>
    10131013<pre class="literal-block">
    10141014$(abspathex names...[, curdir])
     
    10171017<p>Arithmetic Functions:</p>
    10181018<blockquote>
    1019 <p>Returns the sum of the arguments:</p>
     1019<p>Returns the sum of the arguments <a class="footnote-reference" href="#id80" id="id28" name="id28">[1]</a>:</p>
    10201020<pre class="literal-block">
    10211021$(int-add addend1, addend2[, addendN])
    10221022</pre>
    1023 <p>Returns the difference between the first argument and the sum of the rest:</p>
     1023<p>Returns the difference between the first argument and the sum of the
     1024rest <a class="footnote-reference" href="#id80" id="id29" name="id29">[1]</a>:</p>
    10241025<pre class="literal-block">
    10251026$(int-sub minuend, subtrahend[, subtrahendN])
    10261027</pre>
    1027 <p>Returns the product of the arguments:</p>
     1028<p>Returns the product of the arguments <a class="footnote-reference" href="#id80" id="id30" name="id30">[1]</a>:</p>
    10281029<pre class="literal-block">
    10291030$(int-mul factor1, factor2[, factorN])
    10301031</pre>
    1031 <p>Returns the quotient of first argument and the rest:</p>
     1032<p>Returns the quotient of first argument and the rest <a class="footnote-reference" href="#id80" id="id31" name="id31">[1]</a>:</p>
    10321033<pre class="literal-block">
    10331034$(int-div dividend, divisor[, divisorN])
    10341035</pre>
    1035 <p>Returns the modulus of the two arguments:</p>
     1036<p>Returns the modulus of the two arguments <a class="footnote-reference" href="#id80" id="id32" name="id32">[1]</a>:</p>
    10361037<pre class="literal-block">
    10371038$(int-mod dividend, divisor)
    10381039</pre>
    1039 <p>Returns the bitwise two-complement of argument:</p>
     1040<p>Returns the bitwise two-complement of argument <a class="footnote-reference" href="#id80" id="id33" name="id33">[1]</a>:</p>
    10401041<pre class="literal-block">
    10411042$(int-not val)
    10421043</pre>
    1043 <p>Returns the result of a bitwise AND of the arguments:</p>
     1044<p>Returns the result of a bitwise AND of the arguments <a class="footnote-reference" href="#id80" id="id34" name="id34">[1]</a>:</p>
    10441045<pre class="literal-block">
    10451046$(int-and val1, val2[, valN])
    10461047</pre>
    1047 <p>Returns the result of a bitwise OR of the arguments:</p>
     1048<p>Returns the result of a bitwise OR of the arguments <a class="footnote-reference" href="#id80" id="id35" name="id35">[1]</a>:</p>
    10481049<pre class="literal-block">
    10491050$(int-or val1, val2[, valN])
    10501051</pre>
    1051 <p>Returns the result of a bitwise XOR of the arguments:</p>
     1052<p>Returns the result of a bitwise XOR of the arguments <a class="footnote-reference" href="#id80" id="id36" name="id36">[1]</a>:</p>
    10521053<pre class="literal-block">
    10531054$(int-xor val1, val2[, valN])
    10541055</pre>
    10551056<p>Returns the <tt class="docutils literal"><span class="pre">kmk</span></tt> boolean (true = non-empty, false = empty) result
    1056 of <tt class="docutils literal"><span class="pre">val1</span> <span class="pre">==</span> <span class="pre">val2</span></tt>:</p>
     1057of <tt class="docutils literal"><span class="pre">val1</span> <span class="pre">==</span> <span class="pre">val2</span></tt> <a class="footnote-reference" href="#id80" id="id37" name="id37">[1]</a>:</p>
    10571058<pre class="literal-block">
    10581059$(int-eq val1, val2)
    10591060</pre>
    1060 <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>:</p>
     1061<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="#id80" id="id38" name="id38">[1]</a>:</p>
    10611062<pre class="literal-block">
    10621063$(int-ne val1, val2)
    10631064</pre>
    1064 <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>:</p>
     1065<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="#id80" id="id39" name="id39">[1]</a>:</p>
    10651066<pre class="literal-block">
    10661067$(int-gt val1, val2)
    10671068</pre>
    1068 <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>:</p>
     1069<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="#id80" id="id40" name="id40">[1]</a>:</p>
    10691070<pre class="literal-block">
    10701071$(int-ge val1, val2)
    10711072</pre>
    1072 <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>:</p>
     1073<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="#id80" id="id41" name="id41">[1]</a>:</p>
    10731074<pre class="literal-block">
    10741075$(int-lt val1, val2)
    10751076</pre>
    1076 <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>:</p>
     1077<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="#id80" id="id42" name="id42">[1]</a>:</p>
    10771078<pre class="literal-block">
    10781079$(int-le val1, val2)
     
    10981099</pre>
    10991100<p>Test if the two strings are identical, returning <tt class="docutils literal"><span class="pre">kmk</span></tt> boolean (true =
    1100 non-empty, false = empty):</p>
     1101non-empty, false = empty) <a class="footnote-reference" href="#id81" id="id43" name="id43">[2]</a>:</p>
    11011102<pre class="literal-block">
    11021103$(eq str1, str2)
    11031104</pre>
    1104 <p>Invert a <tt class="docutils literal"><span class="pre">kmk</span></tt> boolean value:</p>
     1105<p>Invert a <tt class="docutils literal"><span class="pre">kmk</span></tt> boolean value <a class="footnote-reference" href="#id81" id="id44" name="id44">[2]</a>:</p>
    11051106<pre class="literal-block">
    11061107$(not val)
    11071108</pre>
    1108 <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:</p>
     1109<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="#id80" id="id45" name="id45">[1]</a>:</p>
    11091110<pre class="literal-block">
    11101111$(defined variable)
    11111112</pre>
    11121113<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
    1113 value:</p>
     1114value <a class="footnote-reference" href="#id80" id="id46" name="id46">[1]</a>:</p>
    11141115<pre class="literal-block">
    11151116$(intersects set-a, set-b)
    11161117</pre>
    1117 <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:</p>
     1118<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="#id80" id="id47" name="id47">[1]</a>:</p>
    11181119<pre class="literal-block">
    11191120$(if-expr kmk-expression,true-part[,false-part])
    11201121</pre>
    11211122<p>Select the first true condition (<tt class="docutils literal"><span class="pre">kmk</span></tt>-expression) and expand the
    1122 following body. Special condition strings <tt class="docutils literal"><span class="pre">default</span></tt> and <tt class="docutils literal"><span class="pre">otherwise</span></tt>:</p>
     1123following body. Special condition strings <tt class="docutils literal"><span class="pre">default</span></tt> and
     1124<tt class="docutils literal"><span class="pre">otherwise</span></tt> <a class="footnote-reference" href="#id80" id="id48" name="id48">[1]</a>:</p>
    11231125<pre class="literal-block">
    11241126$(select when1-cond, when1-body[, whenN-cond, whenN-body])
    11251127</pre>
    11261128<p>Evalutate the <tt class="docutils literal"><span class="pre">kmk-expression</span></tt> returning what it evalues as. This is
    1127 the preferred way of doing arithmentic now:</p>
     1129the preferred way of doing arithmentic now <a class="footnote-reference" href="#id80" id="id49" name="id49">[1]</a>:</p>
    11281130<pre class="literal-block">
    11291131$(expr kmk-expression)
     
    11321134<p>Stack Fuctions:</p>
    11331135<blockquote>
    1134 <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:</p>
     1136<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="#id80" id="id50" name="id50">[1]</a>:</p>
    11351137<pre class="literal-block">
    11361138$(stack-push stack-var, item)
    11371139</pre>
    1138 <p>Pop the top item off the <tt class="docutils literal"><span class="pre">stack-var</span></tt>:</p>
     1140<p>Pop the top item off the <tt class="docutils literal"><span class="pre">stack-var</span></tt> <a class="footnote-reference" href="#id80" id="id51" name="id51">[1]</a>:</p>
    11391141<pre class="literal-block">
    11401142$(stack-pop stack-var)
    11411143</pre>
    1142 <p>Pop the top item off the <tt class="docutils literal"><span class="pre">stack-var</span></tt>, returning the empty string:</p>
     1144<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="#id80" id="id52" name="id52">[1]</a>:</p>
    11431145<pre class="literal-block">
    11441146$(stack-popv stack-var)
    11451147</pre>
    1146 <p>Get the top item of the <tt class="docutils literal"><span class="pre">stack-var</span></tt>, returning the empty string:</p>
     1148<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="#id80" id="id53" name="id53">[1]</a>:</p>
    11471149<pre class="literal-block">
    11481150$(stack-top stack-var)
     
    11641166first 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,
    11651167then expand <tt class="docutils literal"><span class="pre">body</span></tt> concatenating the result to the previous iterations
    1166 (spaced), and finally evaluate <tt class="docutils literal"><span class="pre">next</span></tt>:</p>
     1168(spaced), and finally evaluate <tt class="docutils literal"><span class="pre">next</span></tt> <a class="footnote-reference" href="#id80" id="id54" name="id54">[1]</a>:</p>
    11671169<pre class="literal-block">
    11681170$(for init,conditions,next,body)
     
    11701172<p>C-style while-loop. Each iteration will check whether the <tt class="docutils literal"><span class="pre">condition</span></tt>
    11711173(<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
    1172 result to the previous iterations:</p>
     1174result to the previous iterations <a class="footnote-reference" href="#id80" id="id55" name="id55">[1]</a>:</p>
    11731175<pre class="literal-block">
    11741176$(while conditions,body)
     
    11851187</pre>
    11861188<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
    1187 own variable context:</p>
     1189own variable context <a class="footnote-reference" href="#id80" id="id56" name="id56">[1]</a>:</p>
    11881190<pre class="literal-block">
    11891191$(evalctx text)
    11901192</pre>
    1191 <p>Same as <tt class="docutils literal"><span class="pre">$(eval</span> <span class="pre">$(value</span> <span class="pre">var))</span></tt>:</p>
     1193<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="#id80" id="id57" name="id57">[1]</a>:</p>
    11921194<pre class="literal-block">
    11931195$(evalval var)
    11941196</pre>
    1195 <p>Same as <tt class="docutils literal"><span class="pre">$(evalctx</span> <span class="pre">$(value</span> <span class="pre">var))</span></tt>:</p>
     1197<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="#id80" id="id58" name="id58">[1]</a>:</p>
    11961198<pre class="literal-block">
    11971199$(evalvalctx var)
    11981200</pre>
    1199 <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>:</p>
     1201<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="#id80" id="id59" name="id59">[1]</a>:</p>
    12001202<pre class="literal-block">
    12011203$(evalcall var)
    12021204</pre>
    1203 <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>:</p>
     1205<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="#id80" id="id60" name="id60">[1]</a>:</p>
    12041206<pre class="literal-block">
    12051207$(evalcall var)
    12061208</pre>
    12071209<p>Remove comments and blank lines from the variable <tt class="docutils literal"><span class="pre">var</span></tt>. Expands to
    1208 the empty string:</p>
     1210the empty string <a class="footnote-reference" href="#id80" id="id61" name="id61">[1]</a>:</p>
    12091211<pre class="literal-block">
    12101212$(eval-opt-var var)
    12111213</pre>
    12121214<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
    1213 or the file at <tt class="docutils literal"><span class="pre">pos</span></tt> (one-origin):</p>
     1215or the file at <tt class="docutils literal"><span class="pre">pos</span></tt> (one-origin) <a class="footnote-reference" href="#id80" id="id62" name="id62">[1]</a>:</p>
    12141216<pre class="literal-block">
    12151217$(deps target[, pos])
    12161218</pre>
    12171219<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
    1218 retriving the whole thing or the file at <tt class="docutils literal"><span class="pre">pos</span></tt> (one-origin):</p>
     1220retriving the whole thing or the file at <tt class="docutils literal"><span class="pre">pos</span></tt> (one-origin) <a class="footnote-reference" href="#id80" id="id63" name="id63">[1]</a>:</p>
    12191221<pre class="literal-block">
    12201222$(deps-all target[, pos])
    12211223</pre>
    12221224<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
    1223 thing or the file at <tt class="docutils literal"><span class="pre">pos</span></tt> (one-origin):</p>
     1225thing or the file at <tt class="docutils literal"><span class="pre">pos</span></tt> (one-origin) <a class="footnote-reference" href="#id80" id="id64" name="id64">[1]</a>:</p>
    12241226<pre class="literal-block">
    12251227$(deps-newer target[, pos])
    12261228</pre>
    12271229<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
    1228 whole thing or the file at <tt class="docutils literal"><span class="pre">pos</span></tt> (one-origin):</p>
     1230whole thing or the file at <tt class="docutils literal"><span class="pre">pos</span></tt> (one-origin) <a class="footnote-reference" href="#id80" id="id65" name="id65">[1]</a>:</p>
    12291231<pre class="literal-block">
    12301232$(deps-oo target[, pos])
     
    12341236<blockquote>
    12351237<p>Create one or more command lines avoiding the max argument
    1236 length restriction of the host OS:</p>
     1238length restriction of the host OS <a class="footnote-reference" href="#id80" id="id66" name="id66">[1]</a>:</p>
    12371239<pre class="literal-block">
    12381240$(xargs ar cas mylib.a,$(objects))
     
    12411243<p>Returns the commands for the specified target separated by new-line, space,
    12421244or a user defined string. Note that this might not produce the 100% correct
    1243 result if any of the prerequisite automatic variables are used:</p>
     1245result if any of the prerequisite automatic variables are used <a class="footnote-reference" href="#id80" id="id67" name="id67">[1]</a>:</p>
    12441246<pre class="literal-block">
    12451247$(commands target)
     
    12501252argument 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
    12511253line by line is stripped of leading spaces, command prefixes and
    1252 trailing spaces before comparing:</p>
     1254trailing spaces before comparing <a class="footnote-reference" href="#id80" id="id68" name="id68">[1]</a>:</p>
    12531255<pre class="literal-block">
    12541256$(comp-cmds cmds-var1, cmds-var2, ne)
     
    12561258</pre>
    12571259<p>Compares the values of the two variables returning the empty string if
    1258 equal and the 3rd argument if not. Leading and trailing spaces is ignored:</p>
     1260equal and the 3rd argument if not. Leading and trailing spaces is
     1261ignored <a class="footnote-reference" href="#id80" id="id69" name="id69">[1]</a>:</p>
    12591262<pre class="literal-block">
    12601263$(comp-var var1, var2, ne)
     
    12921295<p>Returns the current local time and date formatted in the <tt class="docutils literal"><span class="pre">strftime</span></tt>
    12931296style 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
    1294 not specified:</p>
     1297not specified <a class="footnote-reference" href="#id80" id="id70" name="id70">[1]</a>:</p>
    12951298<pre class="literal-block">
    12961299$(date fmt)
     
    12981301<p>Returns the current UTC time and date formatted in the <tt class="docutils literal"><span class="pre">strftime</span></tt>
    12991302style 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
    1300 not specified:</p>
     1303not specified <a class="footnote-reference" href="#id80" id="id71" name="id71">[1]</a>:</p>
    13011304<pre class="literal-block">
    13021305$(date-utc fmt)
     
    13041307<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
    13051308to <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
    1306 <tt class="docutils literal"><span class="pre">%Y-%m-%dT%H:%M:%SZ</span></tt> if not specified:</p>
     1309<tt class="docutils literal"><span class="pre">%Y-%m-%dT%H:%M:%SZ</span></tt> if not specified <a class="footnote-reference" href="#id80" id="id72" name="id72">[1]</a>:</p>
    13071310<pre class="literal-block">
    13081311$(date-utc fmt,time,in-fmt)
    13091312</pre>
    1310 <p>Returns the current nanosecond timestamp (monotonic when possible):</p>
     1313<p>Returns the current nanosecond timestamp (monotonic when possible) <a class="footnote-reference" href="#id80" id="id73" name="id73">[1]</a>:</p>
    13111314<pre class="literal-block">
    13121315$(nanots )
    13131316</pre>
    13141317<p>Returns the size of the specified file, or -1 if the size could not
    1315 be obtained. This can be used to check if a file exist or not:</p>
     1318be obtained. This can be used to check if a file exist or not <a class="footnote-reference" href="#id80" id="id74" name="id74">[1]</a>:</p>
    13161319<pre class="literal-block">
    13171320$(file-size file)
    13181321</pre>
    1319 <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>:</p>
     1322<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="#id80" id="id75" name="id75">[1]</a>:</p>
    13201323<pre class="literal-block">
    13211324$(which files...)
    13221325</pre>
    1323 <p>OS/2: Returns the specified LIBPATH variable value:</p>
     1326<p>OS/2: Returns the specified LIBPATH variable value <a class="footnote-reference" href="#id80" id="id76" name="id76">[1]</a>:</p>
    13241327<pre class="literal-block">
    13251328$(libpath var)
    13261329</pre>
    1327 <p>OS/2: Sets the specified LIBPATH variable value, returning the empty string:</p>
     1330<p>OS/2: Sets the specified LIBPATH variable value, returning the empty
     1331string <a class="footnote-reference" href="#id80" id="id77" name="id77">[1]</a>:</p>
    13281332<pre class="literal-block">
    13291333$(libpath var,value)
     
    13331337<blockquote>
    13341338<p>Returns various make statistics, if no item is specified a default
    1335 selection is returned:</p>
     1339selection is returned <a class="footnote-reference" href="#id80" id="id78" name="id78">[1]</a>:</p>
    13361340<pre class="literal-block">
    13371341$(make-stats item[,itemN])
    13381342</pre>
    1339 <p>Raise a debug breakpoint. Used for debugging <tt class="docutils literal"><span class="pre">kmk</span></tt> makefile parsing:</p>
     1343<p>Raise a debug breakpoint. Used for debugging <tt class="docutils literal"><span class="pre">kmk</span></tt> makefile
     1344parsing <a class="footnote-reference" href="#id80" id="id79" name="id79">[1]</a>:</p>
    13401345<pre class="literal-block">
    13411346$(breakpoint )
     
    13431348</blockquote>
    13441349<hr class="docutils" />
    1345 <table class="docutils footnote" frame="void" id="id15" rules="none">
     1350<table class="docutils footnote" frame="void" id="id80" rules="none">
    13461351<colgroup><col class="label" /><col /></colgroup>
    13471352<tbody valign="top">
    1348 <tr><td class="label"><a name="id15">[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>)</em> <tt class="docutils literal"><span class="pre">kmk</span></tt> only feature.</td></tr>
     1353<tr><td class="label"><a name="id80">[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="#id45">43</a>, <a class="fn-backref" href="#id46">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>)</em> <tt class="docutils literal"><span class="pre">kmk</span></tt> only feature.</td></tr>
     1354</tbody>
     1355</table>
     1356<table class="docutils footnote" frame="void" id="id81" rules="none">
     1357<colgroup><col class="label" /><col /></colgroup>
     1358<tbody valign="top">
     1359<tr><td class="label"><a name="id81">[2]</a></td><td><em>(<a class="fn-backref" href="#id43">1</a>, <a class="fn-backref" href="#id44">2</a>)</em> Experimental GNU <tt class="docutils literal"><span class="pre">make</span></tt> feature that is not enabled by default.</td></tr>
    13491360</tbody>
    13501361</table>
  • trunk/kBuild/doc/QuickReference-kmk.txt

    r2169 r2170  
    88disputed. ;-)
    99
    10 Features that are
     10
    1111
    1212Directives
     
    241241
    242242
    243 The following variables reflects ``kmk`` options. Do not set these.
     243The following variables reflects ``kmk`` options. Do not set these. [1]_
    244244
    245245+-------------------------------------+---------------------------------------+
     
    275275--------
    276276
    277 Builtin commands all start with ``kmk_builtin_``, so in order to save space
    278 this prefix has been omitted in the table below. All commands comes in an
     277Builtin commands [1]_ all start with ``kmk_builtin_``, so in order to save
     278space this prefix has been omitted in the table below. All commands comes in an
    279279external edition that can be used by/in the shell, these are prefixed ``kmk_``.
    280280
     
    347347--------------
    348348
    349 ``kmk``-expressions are related to the C/C++ preprocessor in some ways as well
    350 as ``nmake`` and BSD ``make``. There are however some peculiarities because of
    351 the way GNU ``make`` choose to represent booleans in its function library, so,
    352 strings can be turned into boolean by taking any non-empty string as true.
     349``kmk``-expressions [1]_ are related to the C/C++ preprocessor in some ways as
     350well as ``nmake`` and BSD ``make``. There are however some peculiarities
     351because of the way GNU ``make`` choose to represent booleans in its function
     352library, so, strings can be turned into boolean by taking any non-empty string
     353as true.
    353354
    354355Quoting using single quotes results in hard strings, while double quotes and
     
    455456
    456457    Sort the words in ``list`` lexicographically in reserve order, removing
    457     duplicates::
     458    duplicates [1]_::
    458459
    459460        $(rsort list)
     
    483484        $(join list1,list2)
    484485
    485     Fold ``text`` to upper case::
     486    Fold ``text`` to upper case [1]_::
    486487
    487488        $(toupper text)
    488489
    489     Fold ``text`` to lower case::
     490    Fold ``text`` to lower case [1]_::
    490491
    491492        $(tolower text)
    492493
    493     String formatting a la the unix ``printf`` command::
     494    String formatting a la the unix ``printf`` command [1]_::
    494495
    495496        $(printf fmt, arg...)
    496497
    497     Return the length of a string or a (unexpanded) variable::
     498    Return the length of a string or a (unexpanded) variable [1]_::
    498499
    499500        $(length string)
     
    502503    Find the position of ``needle`` in ``haystack``, returns 0 if not found.
    503504    Negative ``start`` indices are relative to the end of ``haystack``, while
    504     positive ones are one based::
     505    positive ones are one based [1]_::
    505506
    506507        $(pos needle, haystack[, start])
     
    509510    Returns the specified substring. The ``start`` works like with ``$(pos )``.
    510511    If the substring is partially outside the ``string`` the result will be
    511     padded with ``pad`` if present::
     512    padded with ``pad`` if present [1]_::
    512513
    513514        $(substr string, start[, length[, pad]])
    514515
    515516    Insert ``in`` into ``str`` at the specified position. ``n`` works like with
    516     ``$(pos )``, except that ``0`` is the end of the string::
     517    ``$(pos )``, except that ``0`` is the end of the string [1]_::
    517518
    518519        $(insert in, str[, n[, length[, pad]]])
     
    520521    Translate ``string`` exchanging characters in ``from-set`` with ``to-set``,
    521522    optionally completing ``to-set`` with ``pad-char`` if specified. If no
    522     ``pad-char`` characters absent in ``to-set`` will be deleted::
     523    ``pad-char`` characters absent in ``to-set`` will be deleted [1]_::
    523524
    524525        $(translate string, from-set[, to-set[, pad-char]])
     
    568569
    569570    Same as ``$(abspath )`` except that the current directory can be
    570     specified as ``curdir``::
     571    specified as ``curdir`` [1]_::
    571572
    572573        $(abspathex names...[, curdir])
     
    575576Arithmetic Functions:
    576577
    577     Returns the sum of the arguments::
     578    Returns the sum of the arguments [1]_::
    578579
    579580        $(int-add addend1, addend2[, addendN])
    580581
    581     Returns the difference between the first argument and the sum of the rest::
     582    Returns the difference between the first argument and the sum of the
     583    rest [1]_::
    582584
    583585        $(int-sub minuend, subtrahend[, subtrahendN])
    584586
    585     Returns the product of the arguments::
     587    Returns the product of the arguments [1]_::
    586588
    587589        $(int-mul factor1, factor2[, factorN])
    588590
    589     Returns the quotient of first argument and the rest::
     591    Returns the quotient of first argument and the rest [1]_::
    590592
    591593        $(int-div dividend, divisor[, divisorN])
    592594
    593     Returns the modulus of the two arguments::
     595    Returns the modulus of the two arguments [1]_::
    594596
    595597        $(int-mod dividend, divisor)
    596598
    597     Returns the bitwise two-complement of argument::
     599    Returns the bitwise two-complement of argument [1]_::
    598600
    599601        $(int-not val)
    600602
    601     Returns the result of a bitwise AND of the arguments::
     603    Returns the result of a bitwise AND of the arguments [1]_::
    602604
    603605        $(int-and val1, val2[, valN])
    604606
    605     Returns the result of a bitwise OR of the arguments::
     607    Returns the result of a bitwise OR of the arguments [1]_::
    606608
    607609        $(int-or val1, val2[, valN])
    608610
    609     Returns the result of a bitwise XOR of the arguments::
     611    Returns the result of a bitwise XOR of the arguments [1]_::
    610612
    611613        $(int-xor val1, val2[, valN])
    612614
    613615    Returns the ``kmk`` boolean (true = non-empty, false = empty) result
    614     of ``val1 == val2``::
     616    of ``val1 == val2`` [1]_::
    615617
    616618        $(int-eq val1, val2)
    617619
    618     Returns the ``kmk`` boolean result of ``val1 != val2``::
     620    Returns the ``kmk`` boolean result of ``val1 != val2`` [1]_::
    619621
    620622        $(int-ne val1, val2)
    621623
    622     Returns the ``kmk`` boolean result of ``val1 > val2``::
     624    Returns the ``kmk`` boolean result of ``val1 > val2`` [1]_::
    623625
    624626        $(int-gt val1, val2)
    625627
    626     Returns the ``kmk`` boolean result of ``val1 >= val2``::
     628    Returns the ``kmk`` boolean result of ``val1 >= val2`` [1]_::
    627629
    628630        $(int-ge val1, val2)
    629631
    630     Returns the ``kmk`` boolean result of ``val1 < val2``::
     632    Returns the ``kmk`` boolean result of ``val1 < val2`` [1]_::
    631633
    632634        $(int-lt val1, val2)
    633635
    634     Returns the ``kmk`` boolean result of ``val1 <= val2``::
     636    Returns the ``kmk`` boolean result of ``val1 <= val2`` [1]_::
    635637
    636638        $(int-le val1, val2)
     
    657659
    658660    Test if the two strings are identical, returning ``kmk`` boolean (true =
    659     non-empty, false = empty)::
     661    non-empty, false = empty) [2]_::
    660662
    661663        $(eq str1, str2)
    662664
    663     Invert a ``kmk`` boolean value::
     665    Invert a ``kmk`` boolean value [2]_::
    664666
    665667        $(not val)
    666668
    667     Test if ``variable`` is defined, returning a ``kmk`` boolean value::
     669    Test if ``variable`` is defined, returning a ``kmk`` boolean value [1]_::
    668670
    669671        $(defined variable)
    670672
    671673    Test if ``set-a`` and ``set-b`` intersects, returning a ``kmk`` boolean
    672     value::
     674    value [1]_::
    673675
    674676        $(intersects set-a, set-b)
    675677
    676     Same as ``$(if )`` execpt that the condition is a ``kmk``-expression::
     678    Same as ``$(if )`` execpt that the condition is a ``kmk``-expression [1]_::
    677679
    678680        $(if-expr kmk-expression,true-part[,false-part])
    679681
    680682    Select the first true condition (``kmk``-expression) and expand the
    681     following body. Special condition strings ``default`` and ``otherwise``::
     683    following body. Special condition strings ``default`` and
     684    ``otherwise`` [1]_::
    682685
    683686        $(select when1-cond, when1-body[, whenN-cond, whenN-body])
    684687
    685688    Evalutate the ``kmk-expression`` returning what it evalues as. This is
    686     the preferred way of doing arithmentic now::
     689    the preferred way of doing arithmentic now [1]_::
    687690
    688691        $(expr kmk-expression)
     
    691694Stack Fuctions:
    692695
    693       Push ``item`` onto the ``stack-var``, returning the empty string::
     696      Push ``item`` onto the ``stack-var``, returning the empty string [1]_::
    694697
    695698            $(stack-push stack-var, item)
    696699
    697       Pop the top item off the ``stack-var``::
     700      Pop the top item off the ``stack-var`` [1]_::
    698701
    699702            $(stack-pop stack-var)
    700703
    701       Pop the top item off the ``stack-var``, returning the empty string::
     704      Pop the top item off the ``stack-var``, returning the empty string [1]_::
    702705
    703706            $(stack-popv stack-var)
    704707
    705       Get the top item of the ``stack-var``, returning the empty string::
     708      Get the top item of the ``stack-var``, returning the empty string [1]_::
    706709
    707710            $(stack-top stack-var)
     
    723726    first check whether the ``condition`` (``kmk``-expression) is true,
    724727    then expand ``body`` concatenating the result to the previous iterations
    725     (spaced), and finally evaluate ``next``::
     728    (spaced), and finally evaluate ``next`` [1]_::
    726729
    727730        $(for init,conditions,next,body)
     
    729732    C-style while-loop. Each iteration will check whether the ``condition``
    730733    (``kmk``-expression) is true, then expand ``body`` concatenating the
    731     result to the previous iterations::
     734    result to the previous iterations [1]_::
    732735
    733736        $(while conditions,body)
     
    744747
    745748    Same as ``$(eval text)`` except that the ``text`` is expanded in its
    746     own variable context::
     749    own variable context [1]_::
    747750
    748751        $(evalctx text)
    749752
    750     Same as ``$(eval $(value var))``::
     753    Same as ``$(eval $(value var))`` [1]_::
    751754
    752755        $(evalval var)
    753756
    754     Same as ``$(evalctx $(value var))``::
     757    Same as ``$(evalctx $(value var))`` [1]_::
    755758
    756759        $(evalvalctx var)
    757760
    758     A combination of ``$(eval )``, ``$(call )`` and ``$(value )``::
     761    A combination of ``$(eval )``, ``$(call )`` and ``$(value )`` [1]_::
    759762
    760763        $(evalcall var)
    761764
    762     A combination of ``$(eval )`` and ``$(call )``::
     765    A combination of ``$(eval )`` and ``$(call )`` [1]_::
    763766
    764767        $(evalcall var)
    765768
    766769    Remove comments and blank lines from the variable ``var``. Expands to
    767     the empty string::
     770    the empty string [1]_::
    768771
    769772        $(eval-opt-var var)
    770773
    771774    Returns accessing ``$<`` of ``target``, either retriving the whole thing
    772     or the file at ``pos`` (one-origin)::
     775    or the file at ``pos`` (one-origin) [1]_::
    773776
    774777        $(deps target[, pos])
    775778
    776779    Returns accessing ``$+`` (order + duplicates) of ``target``, either
    777     retriving the whole thing or the file at ``pos`` (one-origin)::
     780    retriving the whole thing or the file at ``pos`` (one-origin) [1]_::
    778781
    779782        $(deps-all target[, pos])
    780783
    781784    Returns accessing ``$?``  of ``target``, either retriving the whole
    782     thing or the file at ``pos`` (one-origin)::
     785    thing or the file at ``pos`` (one-origin) [1]_::
    783786
    784787        $(deps-newer target[, pos])
    785788
    786789    Returns accessing ``$|`` (order only)  of ``target``, either retriving the
    787     whole thing or the file at ``pos`` (one-origin)::
     790    whole thing or the file at ``pos`` (one-origin) [1]_::
    788791
    789792        $(deps-oo target[, pos])
     
    793796
    794797    Create one or more command lines avoiding the max argument
    795     length restriction of the host OS::
     798    length restriction of the host OS [1]_::
    796799
    797800        $(xargs ar cas mylib.a,$(objects))
     
    801804    Returns the commands for the specified target separated by new-line, space,
    802805    or a user defined string. Note that this might not produce the 100% correct
    803     result if any of the prerequisite automatic variables are used::
     806    result if any of the prerequisite automatic variables are used [1]_::
    804807
    805808        $(commands target)
     
    810813    argument if not. This differs from ``$(comp-vars v1,v2,ne)`` in that
    811814    line by line is stripped of leading spaces, command prefixes and
    812     trailing spaces before comparing::
     815    trailing spaces before comparing [1]_::
    813816
    814817        $(comp-cmds cmds-var1, cmds-var2, ne)
     
    817820
    818821    Compares the values of the two variables returning the empty string if
    819     equal and the 3rd argument if not. Leading and trailing spaces is ignored::
     822    equal and the 3rd argument if not. Leading and trailing spaces is
     823    ignored [1]_::
    820824
    821825        $(comp-var var1, var2, ne)
     
    853857    Returns the current local time and date formatted in the ``strftime``
    854858    style specifier ``fmt``. ``fmt`` defaults to ``%Y-%m-%dT%H:%M:%S`` when
    855     not specified::
     859    not specified [1]_::
    856860
    857861        $(date fmt)
     
    859863    Returns the current UTC time and date formatted in the ``strftime``
    860864    style specifier ``fmt``. ``fmt`` defaults to ``%Y-%m-%dT%H:%M:%SZ`` when
    861     not specified::
     865    not specified [1]_::
    862866
    863867        $(date-utc fmt)
     
    865869    Reformats the ``in`` time and date using ``fmt``. The ``in-fmt`` defaults
    866870    to ``fmt`` if not specified. While ``fmt`` defaults to
    867     ``%Y-%m-%dT%H:%M:%SZ`` if not specified::
     871    ``%Y-%m-%dT%H:%M:%SZ`` if not specified [1]_::
    868872
    869873        $(date-utc fmt,time,in-fmt)
    870874
    871     Returns the current nanosecond timestamp (monotonic when possible)::
     875    Returns the current nanosecond timestamp (monotonic when possible) [1]_::
    872876
    873877        $(nanots )
    874878
    875879    Returns the size of the specified file, or -1 if the size could not
    876     be obtained. This can be used to check if a file exist or not::
     880    be obtained. This can be used to check if a file exist or not [1]_::
    877881
    878882        $(file-size file)
    879883
    880     Searches the ``PATH`` ``kmk`` variable for the specified ``files``::
     884    Searches the ``PATH`` ``kmk`` variable for the specified ``files`` [1]_::
    881885
    882886        $(which files...)
    883887
    884     OS/2: Returns the specified LIBPATH variable value::
     888    OS/2: Returns the specified LIBPATH variable value [1]_::
    885889
    886890        $(libpath var)
    887891
    888     OS/2: Sets the specified LIBPATH variable value, returning the empty string::
     892    OS/2: Sets the specified LIBPATH variable value, returning the empty
     893    string [1]_::
    889894
    890895        $(libpath var,value)
     
    894899
    895900    Returns various make statistics, if no item is specified a default
    896     selection is returned::
     901    selection is returned [1]_::
    897902
    898903        $(make-stats item[,itemN])
    899904
    900     Raise a debug breakpoint. Used for debugging ``kmk`` makefile parsing::
     905    Raise a debug breakpoint. Used for debugging ``kmk`` makefile
     906    parsing [1]_::
    901907
    902908        $(breakpoint )
     
    906912
    907913.. [1] ``kmk`` only feature.
     914.. [2] Experimental GNU ``make`` feature that is not enabled by default.
    908915
    909916-----
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette