Changeset 2340
- Timestamp:
- Apr 18, 2009, 2:05:47 PM (16 years ago)
- Location:
- trunk/kBuild/doc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kBuild/doc/QuickReference-kmk.html
r2243 r2340 328 328 sinclude file 329 329 </pre> 330 <p>Include another dependency file <a class="footnote-reference" href="#id8 3" id="id1" name="id1">[1]</a>:</p>330 <p>Include another dependency file <a class="footnote-reference" href="#id84" id="id1" name="id1">[1]</a>:</p> 331 331 <pre class="literal-block"> 332 332 includedep file … … 358 358 unexport variable 359 359 </pre> 360 <p>Define a variable in the local context instead of the global one <a class="footnote-reference" href="#id8 3" 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="#id84" id="id2" name="id2">[1]</a>:</p> 361 361 <pre class="literal-block"> 362 362 local variable = value … … 509 509 <tt class="docutils literal"><span class="pre">KBUILD_KMK_REVISION</span></tt></td> 510 510 <td>The kBuild version string and the break down 511 into individual components. <a class="footnote-reference" href="#id8 3" 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="#id8 3" id="id4" name="id4">[1]</a></td>511 into individual components. <a class="footnote-reference" href="#id84" 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="#id84" id="id4" name="id4">[1]</a></td> 514 514 <td>The host operating system.</td> 515 515 </tr> 516 <tr><td><tt class="docutils literal"><span class="pre">KBUILD_HOST_ARCH</span></tt> <a class="footnote-reference" href="#id8 3" 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="#id84" id="id5" name="id5">[1]</a></td> 517 517 <td>The host architecture.</td> 518 518 </tr> 519 <tr><td><tt class="docutils literal"><span class="pre">KBUILD_HOST_CPU</span></tt> <a class="footnote-reference" href="#id8 3" 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="#id84" id="id6" name="id6">[1]</a></td> 520 520 <td>The host CPU <tt class="docutils literal"><span class="pre">kmk</span></tt> is built for, set to 521 521 <tt class="docutils literal"><span class="pre">blend</span></tt> if not any particular CPU.</td> 522 522 </tr> 523 <tr><td><tt class="docutils literal"><span class="pre">KBUILD_PATH</span></tt> <a class="footnote-reference" href="#id8 3" 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="#id84" id="id7" name="id7">[1]</a></td> 524 524 <td>Where the kBuild scripts are.</td> 525 525 </tr> 526 <tr><td><tt class="docutils literal"><span class="pre">KBUILD_BIN_PATH</span></tt> <a class="footnote-reference" href="#id8 3" 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="#id84" id="id8" name="id8">[1]</a></td> 527 527 <td>Where the host specific kBuild binaries are.</td> 528 528 </tr> 529 <tr><td><tt class="docutils literal"><span class="pre">KMK</span></tt> <a class="footnote-reference" href="#id8 3" id="id9" name="id9">[1]</a>,529 <tr><td><tt class="docutils literal"><span class="pre">KMK</span></tt> <a class="footnote-reference" href="#id84" id="id9" name="id9">[1]</a>, 530 530 <tt class="docutils literal"><span class="pre">MAKE</span></tt></td> 531 531 <td>The name with which <tt class="docutils literal"><span class="pre">kmk</span></tt> was invoked. Using 532 532 this variable in recipes has special meaning.</td> 533 533 </tr> 534 <tr><td><tt class="docutils literal"><span class="pre">KMK_BUILTIN</span></tt> <a class="footnote-reference" href="#id8 3" 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="#id84" id="id10" name="id10">[1]</a></td> 535 535 <td>List of built-in commands.</td> 536 536 </tr> 537 <tr><td><tt class="docutils literal"><span class="pre">KMK_FEATURES</span></tt> <a class="footnote-reference" href="#id8 3" 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="#id84" id="id11" name="id11">[1]</a></td> 538 538 <td>List of <tt class="docutils literal"><span class="pre">kmk</span></tt> specific features.</td> 539 539 </tr> 540 <tr><td><tt class="docutils literal"><span class="pre">KMK_FLAGS</span></tt> <a class="footnote-reference" href="#id8 3" 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="#id84" id="id12" name="id12">[1]</a></td> 541 541 <td><p class="first">The flags given to <tt class="docutils literal"><span class="pre">kmk</span></tt>. You can set this in 542 542 the environment or a makefile to set flags.</p> … … 548 548 </td> 549 549 </tr> 550 <tr><td><tt class="docutils literal"><span class="pre">KMK_LEVEL</span></tt> <a class="footnote-reference" href="#id8 3" 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="#id84" id="id13" name="id13">[1]</a></td> 551 551 <td>The number of levels of recursion (sub-makes).</td> 552 552 </tr> 553 <tr><td><tt class="docutils literal"><span class="pre">KMK_VERSION</span></tt> <a class="footnote-reference" href="#id8 3" 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="#id84" id="id14" name="id14">[1]</a></td> 554 554 <td>The GNU <tt class="docutils literal"><span class="pre">make</span></tt> version number.</td> 555 555 </tr> … … 587 587 </tbody> 588 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="#id8 3" id="id15" name="id15">[1]</a></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="#id84" id="id15" name="id15">[1]</a></p> 590 590 <table border="1" class="docutils"> 591 591 <colgroup> … … 669 669 <td>If mentioned without any prerequisites, 670 670 <tt class="docutils literal"><span class="pre">kmk</span></tt> will run serially as if -j1 was 671 given. If it has prerequisites <tt class="docutils literal"><span class="pre">kmk</span></tt> <a class="footnote-reference" href="#id8 3" id="id16" name="id16">[1]</a>671 given. If it has prerequisites <tt class="docutils literal"><span class="pre">kmk</span></tt> <a class="footnote-reference" href="#id84" id="id16" name="id16">[1]</a> 672 672 will only do this for the targets among 673 673 them.</td> … … 695 695 </tr> 696 696 <tr><td><tt class="docutils literal"><span class="pre">.SECONDTARGETEXPANSION</span></tt> 697 <a class="footnote-reference" href="#id8 3" id="id17" name="id17">[1]</a></td>697 <a class="footnote-reference" href="#id84" id="id17" name="id17">[1]</a></td> 698 698 <td>If mentioned, all targets after it will be 699 699 expanded a second time after all makefiles … … 716 716 <div class="section"> 717 717 <h1><a id="commands" name="commands">Commands</a></h1> 718 <p>Builtin commands <a class="footnote-reference" href="#id8 3" id="id18" name="id18">[1]</a> all start with <tt class="docutils literal"><span class="pre">kmk_builtin_</span></tt>, so in order to save718 <p>Builtin commands <a class="footnote-reference" href="#id84" 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 719 719 space this prefix has been omitted in the table below. All commands comes in an 720 720 external edition that can be used by/in the shell, these are prefixed <tt class="docutils literal"><span class="pre">kmk_</span></tt>.</p> … … 827 827 <div class="section"> 828 828 <h1><a id="kmk-expression" name="kmk-expression">kmk-expression</a></h1> 829 <p><tt class="docutils literal"><span class="pre">kmk</span></tt>-expressions <a class="footnote-reference" href="#id8 3" id="id19" name="id19">[1]</a> are related to the C/C++ preprocessor in some ways as829 <p><tt class="docutils literal"><span class="pre">kmk</span></tt>-expressions <a class="footnote-reference" href="#id84" id="id19" name="id19">[1]</a> are related to the C/C++ preprocessor in some ways as 830 830 well 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 831 831 because of the way GNU <tt class="docutils literal"><span class="pre">make</span></tt> choose to represent booleans in its function … … 981 981 </pre> 982 982 <p>Sort the words in <tt class="docutils literal"><span class="pre">list</span></tt> lexicographically in reserve order, removing 983 duplicates <a class="footnote-reference" href="#id8 3" id="id20" name="id20">[1]</a>:</p>983 duplicates <a class="footnote-reference" href="#id84" id="id20" name="id20">[1]</a>:</p> 984 984 <pre class="literal-block"> 985 985 $(rsort list) … … 1009 1009 $(join list1,list2) 1010 1010 </pre> 1011 <p>Fold <tt class="docutils literal"><span class="pre">text</span></tt> to upper case <a class="footnote-reference" href="#id8 3" id="id21" name="id21">[1]</a>:</p>1011 <p>Fold <tt class="docutils literal"><span class="pre">text</span></tt> to upper case <a class="footnote-reference" href="#id84" id="id21" name="id21">[1]</a>:</p> 1012 1012 <pre class="literal-block"> 1013 1013 $(toupper text) 1014 1014 </pre> 1015 <p>Fold <tt class="docutils literal"><span class="pre">text</span></tt> to lower case <a class="footnote-reference" href="#id8 3" id="id22" name="id22">[1]</a>:</p>1015 <p>Fold <tt class="docutils literal"><span class="pre">text</span></tt> to lower case <a class="footnote-reference" href="#id84" id="id22" name="id22">[1]</a>:</p> 1016 1016 <pre class="literal-block"> 1017 1017 $(tolower text) 1018 1018 </pre> 1019 <p>String formatting a la the unix <tt class="docutils literal"><span class="pre">printf</span></tt> command <a class="footnote-reference" href="#id8 3" id="id23" name="id23">[1]</a>:</p>1019 <p>String formatting a la the unix <tt class="docutils literal"><span class="pre">printf</span></tt> command <a class="footnote-reference" href="#id84" id="id23" name="id23">[1]</a>:</p> 1020 1020 <pre class="literal-block"> 1021 1021 $(printf fmt, arg...) 1022 1022 </pre> 1023 <p>Return the length of a string or a (unexpanded) variable <a class="footnote-reference" href="#id8 3" id="id24" name="id24">[1]</a>:</p>1023 <p>Return the length of a string or a (unexpanded) variable <a class="footnote-reference" href="#id84" id="id24" name="id24">[1]</a>:</p> 1024 1024 <pre class="literal-block"> 1025 1025 $(length string) … … 1028 1028 <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. 1029 1029 Negative <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 1030 positive ones are one based <a class="footnote-reference" href="#id8 3" id="id25" name="id25">[1]</a>:</p>1030 positive ones are one based <a class="footnote-reference" href="#id84" id="id25" name="id25">[1]</a>:</p> 1031 1031 <pre class="literal-block"> 1032 1032 $(pos needle, haystack[, start]) … … 1035 1035 <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>. 1036 1036 If the substring is partially outside the <tt class="docutils literal"><span class="pre">string</span></tt> the result will be 1037 padded with <tt class="docutils literal"><span class="pre">pad</span></tt> if present <a class="footnote-reference" href="#id8 3" id="id26" name="id26">[1]</a>:</p>1037 padded with <tt class="docutils literal"><span class="pre">pad</span></tt> if present <a class="footnote-reference" href="#id84" id="id26" name="id26">[1]</a>:</p> 1038 1038 <pre class="literal-block"> 1039 1039 $(substr string, start[, length[, pad]]) 1040 1040 </pre> 1041 1041 <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 1042 <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="#id8 3" id="id27" name="id27">[1]</a>:</p>1042 <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="#id84" id="id27" name="id27">[1]</a>:</p> 1043 1043 <pre class="literal-block"> 1044 1044 $(insert in, str[, n[, length[, pad]]]) … … 1046 1046 <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>, 1047 1047 optionally 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 1048 <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="#id8 3" id="id28" name="id28">[1]</a>:</p>1048 <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="#id84" id="id28" name="id28">[1]</a>:</p> 1049 1049 <pre class="literal-block"> 1050 1050 $(translate string, from-set[, to-set[, pad-char]]) … … 1071 1071 </pre> 1072 1072 <p>Extract the root specification of each file name (a bit complicated on 1073 Windows & OS/2) <a class="footnote-reference" href="#id8 3" id="id29" name="id29">[1]</a>:</p>1073 Windows & OS/2) <a class="footnote-reference" href="#id84" id="id29" name="id29">[1]</a>:</p> 1074 1074 <pre class="literal-block"> 1075 1075 $(root names...) … … 1099 1099 </pre> 1100 1100 <p>Same as <tt class="docutils literal"><span class="pre">$(abspath</span> <span class="pre">)</span></tt> except that the current directory can be 1101 specified as <tt class="docutils literal"><span class="pre">curdir</span></tt> <a class="footnote-reference" href="#id8 3" id="id30" name="id30">[1]</a>:</p>1101 specified as <tt class="docutils literal"><span class="pre">curdir</span></tt> <a class="footnote-reference" href="#id84" id="id30" name="id30">[1]</a>:</p> 1102 1102 <pre class="literal-block"> 1103 1103 $(abspathex names...[, curdir]) … … 1106 1106 <p>Arithmetic Functions:</p> 1107 1107 <blockquote> 1108 <p>Returns the sum of the arguments <a class="footnote-reference" href="#id8 3" id="id31" name="id31">[1]</a>:</p>1108 <p>Returns the sum of the arguments <a class="footnote-reference" href="#id84" id="id31" name="id31">[1]</a>:</p> 1109 1109 <pre class="literal-block"> 1110 1110 $(int-add addend1, addend2[, addendN]) 1111 1111 </pre> 1112 1112 <p>Returns the difference between the first argument and the sum of the 1113 rest <a class="footnote-reference" href="#id8 3" id="id32" name="id32">[1]</a>:</p>1113 rest <a class="footnote-reference" href="#id84" id="id32" name="id32">[1]</a>:</p> 1114 1114 <pre class="literal-block"> 1115 1115 $(int-sub minuend, subtrahend[, subtrahendN]) 1116 1116 </pre> 1117 <p>Returns the product of the arguments <a class="footnote-reference" href="#id8 3" id="id33" name="id33">[1]</a>:</p>1117 <p>Returns the product of the arguments <a class="footnote-reference" href="#id84" id="id33" name="id33">[1]</a>:</p> 1118 1118 <pre class="literal-block"> 1119 1119 $(int-mul factor1, factor2[, factorN]) 1120 1120 </pre> 1121 <p>Returns the quotient of first argument and the rest <a class="footnote-reference" href="#id8 3" id="id34" name="id34">[1]</a>:</p>1121 <p>Returns the quotient of first argument and the rest <a class="footnote-reference" href="#id84" id="id34" name="id34">[1]</a>:</p> 1122 1122 <pre class="literal-block"> 1123 1123 $(int-div dividend, divisor[, divisorN]) 1124 1124 </pre> 1125 <p>Returns the modulus of the two arguments <a class="footnote-reference" href="#id8 3" id="id35" name="id35">[1]</a>:</p>1125 <p>Returns the modulus of the two arguments <a class="footnote-reference" href="#id84" id="id35" name="id35">[1]</a>:</p> 1126 1126 <pre class="literal-block"> 1127 1127 $(int-mod dividend, divisor) 1128 1128 </pre> 1129 <p>Returns the bitwise two-complement of argument <a class="footnote-reference" href="#id8 3" id="id36" name="id36">[1]</a>:</p>1129 <p>Returns the bitwise two-complement of argument <a class="footnote-reference" href="#id84" id="id36" name="id36">[1]</a>:</p> 1130 1130 <pre class="literal-block"> 1131 1131 $(int-not val) 1132 1132 </pre> 1133 <p>Returns the result of a bitwise AND of the arguments <a class="footnote-reference" href="#id8 3" id="id37" name="id37">[1]</a>:</p>1133 <p>Returns the result of a bitwise AND of the arguments <a class="footnote-reference" href="#id84" id="id37" name="id37">[1]</a>:</p> 1134 1134 <pre class="literal-block"> 1135 1135 $(int-and val1, val2[, valN]) 1136 1136 </pre> 1137 <p>Returns the result of a bitwise OR of the arguments <a class="footnote-reference" href="#id8 3" id="id38" name="id38">[1]</a>:</p>1137 <p>Returns the result of a bitwise OR of the arguments <a class="footnote-reference" href="#id84" id="id38" name="id38">[1]</a>:</p> 1138 1138 <pre class="literal-block"> 1139 1139 $(int-or val1, val2[, valN]) 1140 1140 </pre> 1141 <p>Returns the result of a bitwise XOR of the arguments <a class="footnote-reference" href="#id8 3" id="id39" name="id39">[1]</a>:</p>1141 <p>Returns the result of a bitwise XOR of the arguments <a class="footnote-reference" href="#id84" id="id39" name="id39">[1]</a>:</p> 1142 1142 <pre class="literal-block"> 1143 1143 $(int-xor val1, val2[, valN]) 1144 1144 </pre> 1145 1145 <p>Returns the <tt class="docutils literal"><span class="pre">kmk</span></tt> boolean (true = non-empty, false = empty) result 1146 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="#id8 3" id="id40" name="id40">[1]</a>:</p>1146 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="#id84" id="id40" name="id40">[1]</a>:</p> 1147 1147 <pre class="literal-block"> 1148 1148 $(int-eq val1, val2) 1149 1149 </pre> 1150 <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="#id8 3" id="id41" name="id41">[1]</a>:</p>1150 <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="#id84" id="id41" name="id41">[1]</a>:</p> 1151 1151 <pre class="literal-block"> 1152 1152 $(int-ne val1, val2) 1153 1153 </pre> 1154 <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="#id8 3" id="id42" name="id42">[1]</a>:</p>1154 <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="#id84" id="id42" name="id42">[1]</a>:</p> 1155 1155 <pre class="literal-block"> 1156 1156 $(int-gt val1, val2) 1157 1157 </pre> 1158 <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="#id8 3" id="id43" name="id43">[1]</a>:</p>1158 <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="#id84" id="id43" name="id43">[1]</a>:</p> 1159 1159 <pre class="literal-block"> 1160 1160 $(int-ge val1, val2) 1161 1161 </pre> 1162 <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="#id8 3" id="id44" name="id44">[1]</a>:</p>1162 <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="#id84" id="id44" name="id44">[1]</a>:</p> 1163 1163 <pre class="literal-block"> 1164 1164 $(int-lt val1, val2) 1165 1165 </pre> 1166 <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="#id8 3" id="id45" name="id45">[1]</a>:</p>1166 <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="#id84" id="id45" name="id45">[1]</a>:</p> 1167 1167 <pre class="literal-block"> 1168 1168 $(int-le val1, val2) … … 1188 1188 </pre> 1189 1189 <p>Test if the two strings are identical, returning <tt class="docutils literal"><span class="pre">kmk</span></tt> boolean (true = 1190 non-empty, false = empty) <a class="footnote-reference" href="#id8 4" id="id46" name="id46">[2]</a>:</p>1190 non-empty, false = empty) <a class="footnote-reference" href="#id85" id="id46" name="id46">[2]</a>:</p> 1191 1191 <pre class="literal-block"> 1192 1192 $(eq str1, str2) 1193 1193 </pre> 1194 <p>Invert a <tt class="docutils literal"><span class="pre">kmk</span></tt> boolean value <a class="footnote-reference" href="#id8 4" id="id47" name="id47">[2]</a>:</p>1194 <p>Invert a <tt class="docutils literal"><span class="pre">kmk</span></tt> boolean value <a class="footnote-reference" href="#id85" id="id47" name="id47">[2]</a>:</p> 1195 1195 <pre class="literal-block"> 1196 1196 $(not val) 1197 1197 </pre> 1198 <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="#id8 3" id="id48" name="id48">[1]</a>:</p>1198 <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="#id84" id="id48" name="id48">[1]</a>:</p> 1199 1199 <pre class="literal-block"> 1200 1200 $(defined variable) 1201 1201 </pre> 1202 1202 <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 1203 value <a class="footnote-reference" href="#id8 3" id="id49" name="id49">[1]</a>:</p>1203 value <a class="footnote-reference" href="#id84" id="id49" name="id49">[1]</a>:</p> 1204 1204 <pre class="literal-block"> 1205 1205 $(intersects set-a, set-b) 1206 1206 </pre> 1207 <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="#id8 3" id="id50" name="id50">[1]</a>:</p>1207 <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="#id84" id="id50" name="id50">[1]</a>:</p> 1208 1208 <pre class="literal-block"> 1209 1209 $(if-expr kmk-expression,true-part[,false-part]) … … 1211 1211 <p>Select the first true condition (<tt class="docutils literal"><span class="pre">kmk</span></tt>-expression) and expand the 1212 1212 following body. Special condition strings <tt class="docutils literal"><span class="pre">default</span></tt> and 1213 <tt class="docutils literal"><span class="pre">otherwise</span></tt> <a class="footnote-reference" href="#id8 3" id="id51" name="id51">[1]</a>:</p>1213 <tt class="docutils literal"><span class="pre">otherwise</span></tt> <a class="footnote-reference" href="#id84" id="id51" name="id51">[1]</a>:</p> 1214 1214 <pre class="literal-block"> 1215 1215 $(select when1-cond, when1-body[, whenN-cond, whenN-body]) 1216 1216 </pre> 1217 1217 <p>Evalutate the <tt class="docutils literal"><span class="pre">kmk-expression</span></tt> returning what it evalues as. This is 1218 the preferred way of doing arithmentic now <a class="footnote-reference" href="#id8 3" id="id52" name="id52">[1]</a>:</p>1218 the preferred way of doing arithmentic now <a class="footnote-reference" href="#id84" id="id52" name="id52">[1]</a>:</p> 1219 1219 <pre class="literal-block"> 1220 1220 $(expr kmk-expression) … … 1223 1223 <p>Stack Fuctions:</p> 1224 1224 <blockquote> 1225 <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="#id8 3" id="id53" name="id53">[1]</a>:</p>1225 <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="#id84" id="id53" name="id53">[1]</a>:</p> 1226 1226 <pre class="literal-block"> 1227 1227 $(stack-push stack-var, item) 1228 1228 </pre> 1229 <p>Pop the top item off the <tt class="docutils literal"><span class="pre">stack-var</span></tt> <a class="footnote-reference" href="#id8 3" id="id54" name="id54">[1]</a>:</p>1229 <p>Pop the top item off the <tt class="docutils literal"><span class="pre">stack-var</span></tt> <a class="footnote-reference" href="#id84" id="id54" name="id54">[1]</a>:</p> 1230 1230 <pre class="literal-block"> 1231 1231 $(stack-pop stack-var) 1232 1232 </pre> 1233 <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="#id8 3" id="id55" name="id55">[1]</a>:</p>1233 <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="#id84" id="id55" name="id55">[1]</a>:</p> 1234 1234 <pre class="literal-block"> 1235 1235 $(stack-popv stack-var) 1236 1236 </pre> 1237 <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="#id8 3" id="id56" name="id56">[1]</a>:</p>1237 <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="#id84" id="id56" name="id56">[1]</a>:</p> 1238 1238 <pre class="literal-block"> 1239 1239 $(stack-top stack-var) … … 1255 1255 first 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, 1256 1256 then expand <tt class="docutils literal"><span class="pre">body</span></tt> concatenating the result to the previous iterations 1257 (spaced), and finally evaluate <tt class="docutils literal"><span class="pre">next</span></tt> <a class="footnote-reference" href="#id8 3" id="id57" name="id57">[1]</a>:</p>1257 (spaced), and finally evaluate <tt class="docutils literal"><span class="pre">next</span></tt> <a class="footnote-reference" href="#id84" id="id57" name="id57">[1]</a>:</p> 1258 1258 <pre class="literal-block"> 1259 1259 $(for init,conditions,next,body) … … 1261 1261 <p>C-style while-loop. Each iteration will check whether the <tt class="docutils literal"><span class="pre">condition</span></tt> 1262 1262 (<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 1263 result to the previous iterations <a class="footnote-reference" href="#id8 3" id="id58" name="id58">[1]</a>:</p>1263 result to the previous iterations <a class="footnote-reference" href="#id84" id="id58" name="id58">[1]</a>:</p> 1264 1264 <pre class="literal-block"> 1265 1265 $(while conditions,body) … … 1276 1276 </pre> 1277 1277 <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 1278 own variable context <a class="footnote-reference" href="#id8 3" id="id59" name="id59">[1]</a>:</p>1278 own variable context <a class="footnote-reference" href="#id84" id="id59" name="id59">[1]</a>:</p> 1279 1279 <pre class="literal-block"> 1280 1280 $(evalctx text) 1281 1281 </pre> 1282 <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="#id8 3" id="id60" name="id60">[1]</a>:</p>1282 <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="#id84" id="id60" name="id60">[1]</a>:</p> 1283 1283 <pre class="literal-block"> 1284 1284 $(evalval var) 1285 1285 </pre> 1286 <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="#id8 3" id="id61" name="id61">[1]</a>:</p>1286 <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="#id84" id="id61" name="id61">[1]</a>:</p> 1287 1287 <pre class="literal-block"> 1288 1288 $(evalvalctx var) 1289 1289 </pre> 1290 <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="#id8 3" id="id62" name="id62">[1]</a>:</p>1290 <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="#id84" id="id62" name="id62">[1]</a>:</p> 1291 1291 <pre class="literal-block"> 1292 1292 $(evalcall var) 1293 1293 </pre> 1294 <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="#id8 3" id="id63" name="id63">[1]</a>:</p>1294 <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="#id84" id="id63" name="id63">[1]</a>:</p> 1295 1295 <pre class="literal-block"> 1296 1296 $(evalcall var) 1297 1297 </pre> 1298 1298 <p>Remove comments and blank lines from the variable <tt class="docutils literal"><span class="pre">var</span></tt>. Expands to 1299 the empty string <a class="footnote-reference" href="#id8 3" id="id64" name="id64">[1]</a>:</p>1299 the empty string <a class="footnote-reference" href="#id84" id="id64" name="id64">[1]</a>:</p> 1300 1300 <pre class="literal-block"> 1301 1301 $(eval-opt-var var) 1302 1302 </pre> 1303 1303 <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 thing 1304 or the file at <tt class="docutils literal"><span class="pre">pos</span></tt> (one-origin) <a class="footnote-reference" href="#id8 3" id="id65" name="id65">[1]</a>:</p>1304 or the file at <tt class="docutils literal"><span class="pre">pos</span></tt> (one-origin) <a class="footnote-reference" href="#id84" id="id65" name="id65">[1]</a>:</p> 1305 1305 <pre class="literal-block"> 1306 1306 $(deps target[, pos]) 1307 1307 </pre> 1308 1308 <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 1309 retriving the whole thing or the file at <tt class="docutils literal"><span class="pre">pos</span></tt> (one-origin) <a class="footnote-reference" href="#id8 3" id="id66" name="id66">[1]</a>:</p>1309 retriving the whole thing or the file at <tt class="docutils literal"><span class="pre">pos</span></tt> (one-origin) <a class="footnote-reference" href="#id84" id="id66" name="id66">[1]</a>:</p> 1310 1310 <pre class="literal-block"> 1311 1311 $(deps-all target[, pos]) 1312 1312 </pre> 1313 1313 <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 1314 thing or the file at <tt class="docutils literal"><span class="pre">pos</span></tt> (one-origin) <a class="footnote-reference" href="#id8 3" id="id67" name="id67">[1]</a>:</p>1314 thing or the file at <tt class="docutils literal"><span class="pre">pos</span></tt> (one-origin) <a class="footnote-reference" href="#id84" id="id67" name="id67">[1]</a>:</p> 1315 1315 <pre class="literal-block"> 1316 1316 $(deps-newer target[, pos]) 1317 1317 </pre> 1318 1318 <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 1319 whole thing or the file at <tt class="docutils literal"><span class="pre">pos</span></tt> (one-origin) <a class="footnote-reference" href="#id8 3" id="id68" name="id68">[1]</a>:</p>1319 whole thing or the file at <tt class="docutils literal"><span class="pre">pos</span></tt> (one-origin) <a class="footnote-reference" href="#id84" id="id68" name="id68">[1]</a>:</p> 1320 1320 <pre class="literal-block"> 1321 1321 $(deps-oo target[, pos]) … … 1325 1325 <blockquote> 1326 1326 <p>Create one or more command lines avoiding the max argument 1327 length restriction of the host OS <a class="footnote-reference" href="#id8 3" id="id69" name="id69">[1]</a>:</p>1327 length restriction of the host OS <a class="footnote-reference" href="#id84" id="id69" name="id69">[1]</a>:</p> 1328 1328 <pre class="literal-block"> 1329 1329 $(xargs ar cas mylib.a,$(objects)) … … 1332 1332 <p>Returns the commands for the specified target separated by new-line, space, 1333 1333 or a user defined string. Note that this might not produce the 100% correct 1334 result if any of the prerequisite automatic variables are used <a class="footnote-reference" href="#id8 3" id="id70" name="id70">[1]</a>:</p>1334 result if any of the prerequisite automatic variables are used <a class="footnote-reference" href="#id84" id="id70" name="id70">[1]</a>:</p> 1335 1335 <pre class="literal-block"> 1336 1336 $(commands target) … … 1341 1341 argument 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 1342 1342 line by line is stripped of leading spaces, command prefixes and 1343 trailing spaces before comparing <a class="footnote-reference" href="#id8 3" id="id71" name="id71">[1]</a>:</p>1343 trailing spaces before comparing <a class="footnote-reference" href="#id84" id="id71" name="id71">[1]</a>:</p> 1344 1344 <pre class="literal-block"> 1345 1345 $(comp-cmds cmds-var1, cmds-var2, ne) … … 1348 1348 <p>Compares the values of the two variables returning the empty string if 1349 1349 equal and the 3rd argument if not. Leading and trailing spaces is 1350 ignored <a class="footnote-reference" href="#id8 3" id="id72" name="id72">[1]</a>:</p>1350 ignored <a class="footnote-reference" href="#id84" id="id72" name="id72">[1]</a>:</p> 1351 1351 <pre class="literal-block"> 1352 1352 $(comp-var var1, var2, ne) … … 1384 1384 <p>Returns the current local time and date formatted in the <tt class="docutils literal"><span class="pre">strftime</span></tt> 1385 1385 style 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 1386 not specified <a class="footnote-reference" href="#id8 3" id="id73" name="id73">[1]</a>:</p>1386 not specified <a class="footnote-reference" href="#id84" id="id73" name="id73">[1]</a>:</p> 1387 1387 <pre class="literal-block"> 1388 1388 $(date fmt) … … 1390 1390 <p>Returns the current UTC time and date formatted in the <tt class="docutils literal"><span class="pre">strftime</span></tt> 1391 1391 style 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 1392 not specified <a class="footnote-reference" href="#id8 3" id="id74" name="id74">[1]</a>:</p>1392 not specified <a class="footnote-reference" href="#id84" id="id74" name="id74">[1]</a>:</p> 1393 1393 <pre class="literal-block"> 1394 1394 $(date-utc fmt) … … 1396 1396 <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 1397 1397 to <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 1398 <tt class="docutils literal"><span class="pre">%Y-%m-%dT%H:%M:%SZ</span></tt> if not specified <a class="footnote-reference" href="#id8 3" id="id75" name="id75">[1]</a>:</p>1398 <tt class="docutils literal"><span class="pre">%Y-%m-%dT%H:%M:%SZ</span></tt> if not specified <a class="footnote-reference" href="#id84" id="id75" name="id75">[1]</a>:</p> 1399 1399 <pre class="literal-block"> 1400 1400 $(date-utc fmt,time,in-fmt) 1401 1401 </pre> 1402 <p>Returns the current nanosecond timestamp (monotonic when possible) <a class="footnote-reference" href="#id8 3" id="id76" name="id76">[1]</a>:</p>1402 <p>Returns the current nanosecond timestamp (monotonic when possible) <a class="footnote-reference" href="#id84" id="id76" name="id76">[1]</a>:</p> 1403 1403 <pre class="literal-block"> 1404 1404 $(nanots ) 1405 1405 </pre> 1406 1406 <p>Returns the size of the specified file, or -1 if the size could not 1407 be obtained. This can be used to check if a file exist or not <a class="footnote-reference" href="#id8 3" id="id77" name="id77">[1]</a>:</p>1407 be obtained. This can be used to check if a file exist or not <a class="footnote-reference" href="#id84" id="id77" name="id77">[1]</a>:</p> 1408 1408 <pre class="literal-block"> 1409 1409 $(file-size file) 1410 1410 </pre> 1411 <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="#id8 3" id="id78" name="id78">[1]</a>:</p>1411 <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="#id84" id="id78" name="id78">[1]</a>:</p> 1412 1412 <pre class="literal-block"> 1413 1413 $(which files...) 1414 1414 </pre> 1415 <p>OS/2: Returns the specified LIBPATH variable value <a class="footnote-reference" href="#id8 3" id="id79" name="id79">[1]</a>:</p>1415 <p>OS/2: Returns the specified LIBPATH variable value <a class="footnote-reference" href="#id84" id="id79" name="id79">[1]</a>:</p> 1416 1416 <pre class="literal-block"> 1417 1417 $(libpath var) 1418 1418 </pre> 1419 1419 <p>OS/2: Sets the specified LIBPATH variable value, returning the empty 1420 string <a class="footnote-reference" href="#id8 3" id="id80" name="id80">[1]</a>:</p>1420 string <a class="footnote-reference" href="#id84" id="id80" name="id80">[1]</a>:</p> 1421 1421 <pre class="literal-block"> 1422 1422 $(libpath var,value) … … 1426 1426 <blockquote> 1427 1427 <p>Returns various make statistics, if no item is specified a default 1428 selection is returned <a class="footnote-reference" href="#id8 3" id="id81" name="id81">[1]</a>:</p>1428 selection is returned <a class="footnote-reference" href="#id84" id="id81" name="id81">[1]</a>:</p> 1429 1429 <pre class="literal-block"> 1430 1430 $(make-stats item[,itemN]) 1431 1431 </pre> 1432 1432 <p>Raise a debug breakpoint. Used for debugging <tt class="docutils literal"><span class="pre">kmk</span></tt> makefile 1433 parsing <a class="footnote-reference" href="#id8 3" id="id82" name="id82">[1]</a>:</p>1433 parsing <a class="footnote-reference" href="#id84" id="id82" name="id82">[1]</a>:</p> 1434 1434 <pre class="literal-block"> 1435 1435 $(breakpoint ) 1436 1436 </pre> 1437 </blockquote> 1438 </div> 1439 <div class="section"> 1440 <h1><a id="recipes" name="recipes">Recipes</a></h1> 1441 <blockquote> 1442 <p>A typical recipe takes one of the two following forms:</p> 1443 <pre class="literal-block"> 1444 targets : normal-prerequisites | order-only-prerequisites 1445 command 1446 ... 1447 1448 targets : normal-prerequisites | order-only-prerequisites ; command 1449 command 1450 ... 1451 </pre> 1452 <p>Specifying more than one file in the <tt class="docutils literal"><span class="pre">targets</span></tt> lists is the same as 1453 repeating the recipe for each of the files.</p> 1454 <p>Use <tt class="docutils literal"><span class="pre">+</span></tt> and <tt class="docutils literal"><span class="pre">+|</span></tt> in the list of <tt class="docutils literal"><span class="pre">targets</span></tt> to tell <tt class="docutils literal"><span class="pre">kmk</span></tt> that the 1455 recipe has more than one output. <a class="footnote-reference" href="#id84" id="id83" name="id83">[1]</a> The files after a <tt class="docutils literal"><span class="pre">+</span></tt> will 1456 always be remade, while the files after a <tt class="docutils literal"><span class="pre">+|</span></tt> don't have to be remade. 1457 The latter is frequently employed to update files which prerequisites 1458 change wihtout the output files necessarily changing. See also 1459 <tt class="docutils literal"><span class="pre">kmk_cp</span> <span class="pre">--changed</span></tt>.</p> 1460 </blockquote> 1461 <p>Double colon recipes</p> 1462 <blockquote> 1463 Double colon recipes are written with <tt class="docutils literal"><span class="pre">::</span></tt> instead of <tt class="docutils literal"><span class="pre">:</span></tt> and are 1464 handled differently from ordinary recipes if the target appears in more 1465 than one recipe. First, all the recipes must be of the double colon type. 1466 Second, the recipes are executed individually and may be omitted depending 1467 on the state of their prerequisites. Double colon recipes without any 1468 prerequisites will always be executed.</blockquote> 1469 <p>Pattern rules</p> 1470 <blockquote> 1471 <p>A couple of examples:</p> 1472 <pre class="literal-block"> 1473 %.o : %.c 1474 gcc -o $@ $< 1475 %.tab.c %.tab.h : %.y 1476 bison -d $< 1477 </pre> 1478 <p>The latter has two outputs.</p> 1437 1479 </blockquote> 1438 1480 <hr class="docutils" /> 1439 <table class="docutils footnote" frame="void" id="id83" rules="none">1440 <colgroup><col class="label" /><col /></colgroup>1441 <tbody valign="top">1442 <tr><td class="label"><a name="id83">[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="#id45">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>, <a class="fn-backref" href="#id82">80</a>)</em> <tt class="docutils literal"><span class="pre">kmk</span></tt> only feature.</td></tr>1443 </tbody>1444 </table>1445 1481 <table class="docutils footnote" frame="void" id="id84" rules="none"> 1446 1482 <colgroup><col class="label" /><col /></colgroup> 1447 1483 <tbody valign="top"> 1448 <tr><td class="label"><a name="id84">[2]</a></td><td><em>(<a class="fn-backref" href="#id46">1</a>, <a class="fn-backref" href="#id47">2</a>)</em> Experimental GNU <tt class="docutils literal"><span class="pre">make</span></tt> feature that is not enabled by default.</td></tr> 1484 <tr><td class="label"><a name="id84">[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="#id45">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>, <a class="fn-backref" href="#id82">80</a>, <a class="fn-backref" href="#id83">81</a>)</em> <tt class="docutils literal"><span class="pre">kmk</span></tt> only feature.</td></tr> 1485 </tbody> 1486 </table> 1487 <table class="docutils footnote" frame="void" id="id85" rules="none"> 1488 <colgroup><col class="label" /><col /></colgroup> 1489 <tbody valign="top"> 1490 <tr><td class="label"><a name="id85">[2]</a></td><td><em>(<a class="fn-backref" href="#id46">1</a>, <a class="fn-backref" href="#id47">2</a>)</em> Experimental GNU <tt class="docutils literal"><span class="pre">make</span></tt> feature that is not enabled by default.</td></tr> 1449 1491 </tbody> 1450 1492 </table> -
trunk/kBuild/doc/QuickReference-kmk.txt
r2243 r2340 974 974 975 975 976 Recipes 977 ------- 978 979 A typical recipe takes one of the two following forms:: 980 981 targets : normal-prerequisites | order-only-prerequisites 982 command 983 ... 984 985 targets : normal-prerequisites | order-only-prerequisites ; command 986 command 987 ... 988 989 Specifying more than one file in the ``targets`` lists is the same as 990 repeating the recipe for each of the files. 991 992 Use ``+`` and ``+|`` in the list of ``targets`` to tell ``kmk`` that the 993 recipe has more than one output. [1]_ The files after a ``+`` will 994 always be remade, while the files after a ``+|`` don't have to be remade. 995 The latter is frequently employed to update files which prerequisites 996 change wihtout the output files necessarily changing. See also 997 ``kmk_cp --changed``. 998 999 1000 Double colon recipes 1001 1002 Double colon recipes are written with ``::`` instead of ``:`` and are 1003 handled differently from ordinary recipes if the target appears in more 1004 than one recipe. First, all the recipes must be of the double colon type. 1005 Second, the recipes are executed individually and may be omitted depending 1006 on the state of their prerequisites. Double colon recipes without any 1007 prerequisites will always be executed. 1008 1009 1010 Pattern rules 1011 1012 A couple of examples:: 1013 1014 %.o : %.c 1015 gcc -o $@ $< 1016 %.tab.c %.tab.h : %.y 1017 bison -d $< 1018 1019 The latter has two outputs. 1020 1021 976 1022 ----- 977 1023
Note:
See TracChangeset
for help on using the changeset viewer.