- Timestamp:
- Dec 31, 2008 12:03:02 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kBuild/doc/QuickReference-kmk.html
r2171 r2172 328 328 sinclude file 329 329 </pre> 330 <p>Include another dependency file <a class="footnote-reference" href="#id8 2" id="id1" name="id1">[1]</a>:</p>330 <p>Include another dependency file <a class="footnote-reference" href="#id83" 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 2" 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="#id83" 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 2" 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 2" id="id4" name="id4">[1]</a></td>511 into individual components. <a class="footnote-reference" href="#id83" 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="#id83" 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 2" 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="#id83" 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 2" 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="#id83" 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 2" 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="#id83" 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 2" 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="#id83" 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 2" id="id9" name="id9">[1]</a>,529 <tr><td><tt class="docutils literal"><span class="pre">KMK</span></tt> <a class="footnote-reference" href="#id83" 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 2" 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="#id83" 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 2" 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="#id83" 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 2" 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="#id83" 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 2" 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="#id83" 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 2" 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="#id83" 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 2" 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="#id83" id="id15" name="id15">[1]</a></p> 590 590 <table border="1" class="docutils"> 591 591 <colgroup> … … 646 646 <tr><td><tt class="docutils literal"><span class="pre">.DELETE_ON_ERROR</span></tt></td> 647 647 <td>If mentioned, <tt class="docutils literal"><span class="pre">kmk</span></tt> will delete the 648 targets of a rule if it has hchanged and its648 targets of a rule if it has changed and its 649 649 recipe fails or is interrupted.</td> 650 650 </tr> … … 658 658 no prequisites all targets are affected.</td> 659 659 </tr> 660 <tr><td><tt class="docutils literal"><span class="pre">.INTERME IDATE</span></tt></td>660 <tr><td><tt class="docutils literal"><span class="pre">.INTERMEDIATE</span></tt></td> 661 661 <td>The prerequisites are treated as 662 662 intermediate files (implicite rules).</td> … … 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 2" 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="#id83" id="id16" name="id16">[1]</a> 672 672 will only do this for the targets among 673 673 them.</td> … … 678 678 </tr> 679 679 <tr><td><tt class="docutils literal"><span class="pre">.PRECIOUS</span></tt></td> 680 <td>The targets which <tt class="docutils literal"><span class="pre">.PRECIOUS</span></tt> depends will681 to be deleted if <tt class="docutils literal"><span class="pre">kmk</span></tt> is killed or680 <td>The targets which <tt class="docutils literal"><span class="pre">.PRECIOUS</span></tt> depends 681 will to be deleted if <tt class="docutils literal"><span class="pre">kmk</span></tt> is killed or 682 682 interrupted while their building.</td> 683 683 </tr> … … 695 695 </tr> 696 696 <tr><td><tt class="docutils literal"><span class="pre">.SECONDTARGETEXPANSION</span></tt> 697 <a class="footnote-reference" href="#id8 2" id="id17" name="id17">[1]</a></td>698 <td>If mentioned, all prerequisite lists after699 it will be expanded a second time after all 700 makefileshave been read.</td>697 <a class="footnote-reference" href="#id83" id="id17" name="id17">[1]</a></td> 698 <td>If mentioned, all targets after it will be 699 expanded a second time after all makefiles 700 have been read.</td> 701 701 </tr> 702 702 <tr><td><tt class="docutils literal"><span class="pre">.SILENT</span></tt></td> … … 707 707 <tr><td><tt class="docutils literal"><span class="pre">.SUFFIXES</span></tt></td> 708 708 <td>The prerequisites are the list of suffixes 709 used in checking for suffix rules.</td> 709 used in checking for suffix rules. If it 710 appears without prerequisites it the suffix 711 will be cleared.</td> 710 712 </tr> 711 713 </tbody> … … 714 716 <div class="section"> 715 717 <h1><a id="commands" name="commands">Commands</a></h1> 716 <p>Builtin commands <a class="footnote-reference" href="#id8 2" 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="#id83" 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 717 719 space this prefix has been omitted in the table below. All commands comes in an 718 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> … … 825 827 <div class="section"> 826 828 <h1><a id="kmk-expression" name="kmk-expression">kmk-expression</a></h1> 827 <p><tt class="docutils literal"><span class="pre">kmk</span></tt>-expressions <a class="footnote-reference" href="#id8 2" 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="#id83" id="id19" name="id19">[1]</a> are related to the C/C++ preprocessor in some ways as 828 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 829 831 because of the way GNU <tt class="docutils literal"><span class="pre">make</span></tt> choose to represent booleans in its function … … 979 981 </pre> 980 982 <p>Sort the words in <tt class="docutils literal"><span class="pre">list</span></tt> lexicographically in reserve order, removing 981 duplicates <a class="footnote-reference" href="#id8 2" id="id20" name="id20">[1]</a>:</p>983 duplicates <a class="footnote-reference" href="#id83" id="id20" name="id20">[1]</a>:</p> 982 984 <pre class="literal-block"> 983 985 $(rsort list) … … 1007 1009 $(join list1,list2) 1008 1010 </pre> 1009 <p>Fold <tt class="docutils literal"><span class="pre">text</span></tt> to upper case <a class="footnote-reference" href="#id8 2" 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="#id83" id="id21" name="id21">[1]</a>:</p> 1010 1012 <pre class="literal-block"> 1011 1013 $(toupper text) 1012 1014 </pre> 1013 <p>Fold <tt class="docutils literal"><span class="pre">text</span></tt> to lower case <a class="footnote-reference" href="#id8 2" 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="#id83" id="id22" name="id22">[1]</a>:</p> 1014 1016 <pre class="literal-block"> 1015 1017 $(tolower text) 1016 1018 </pre> 1017 <p>String formatting a la the unix <tt class="docutils literal"><span class="pre">printf</span></tt> command <a class="footnote-reference" href="#id8 2" 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="#id83" id="id23" name="id23">[1]</a>:</p> 1018 1020 <pre class="literal-block"> 1019 1021 $(printf fmt, arg...) 1020 1022 </pre> 1021 <p>Return the length of a string or a (unexpanded) variable <a class="footnote-reference" href="#id8 2" id="id24" name="id24">[1]</a>:</p>1023 <p>Return the length of a string or a (unexpanded) variable <a class="footnote-reference" href="#id83" id="id24" name="id24">[1]</a>:</p> 1022 1024 <pre class="literal-block"> 1023 1025 $(length string) … … 1026 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. 1027 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 1028 positive ones are one based <a class="footnote-reference" href="#id8 2" id="id25" name="id25">[1]</a>:</p>1030 positive ones are one based <a class="footnote-reference" href="#id83" id="id25" name="id25">[1]</a>:</p> 1029 1031 <pre class="literal-block"> 1030 1032 $(pos needle, haystack[, start]) … … 1033 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>. 1034 1036 If the substring is partially outside the <tt class="docutils literal"><span class="pre">string</span></tt> the result will be 1035 padded with <tt class="docutils literal"><span class="pre">pad</span></tt> if present <a class="footnote-reference" href="#id8 2" 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="#id83" id="id26" name="id26">[1]</a>:</p> 1036 1038 <pre class="literal-block"> 1037 1039 $(substr string, start[, length[, pad]]) 1038 1040 </pre> 1039 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 1040 <tt class="docutils literal"><span class="pre">$(pos</span> <span class="pre">)</span></tt>, except that <tt class="docutils literal"><span class="pre">0</span></tt> is the end of the string <a class="footnote-reference" href="#id8 2" 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="#id83" id="id27" name="id27">[1]</a>:</p> 1041 1043 <pre class="literal-block"> 1042 1044 $(insert in, str[, n[, length[, pad]]]) … … 1044 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>, 1045 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 1046 <tt class="docutils literal"><span class="pre">pad-char</span></tt> characters absent in <tt class="docutils literal"><span class="pre">to-set</span></tt> will be deleted <a class="footnote-reference" href="#id8 2" 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="#id83" id="id28" name="id28">[1]</a>:</p> 1047 1049 <pre class="literal-block"> 1048 1050 $(translate string, from-set[, to-set[, pad-char]]) … … 1068 1070 $(basename names...) 1069 1071 </pre> 1072 <p>Extract the root specification of each file name (a bit complicated on 1073 Windows & OS/2) <a class="footnote-reference" href="#id83" id="id29" name="id29">[1]</a>:</p> 1074 <pre class="literal-block"> 1075 $(root names...) 1076 </pre> 1070 1077 <p>Append <tt class="docutils literal"><span class="pre">suffix</span></tt> to each word in <tt class="docutils literal"><span class="pre">names</span></tt>:</p> 1071 1078 <pre class="literal-block"> … … 1092 1099 </pre> 1093 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 1094 specified as <tt class="docutils literal"><span class="pre">curdir</span></tt> <a class="footnote-reference" href="#id8 2" id="id29" name="id29">[1]</a>:</p>1101 specified as <tt class="docutils literal"><span class="pre">curdir</span></tt> <a class="footnote-reference" href="#id83" id="id30" name="id30">[1]</a>:</p> 1095 1102 <pre class="literal-block"> 1096 1103 $(abspathex names...[, curdir]) … … 1099 1106 <p>Arithmetic Functions:</p> 1100 1107 <blockquote> 1101 <p>Returns the sum of the arguments <a class="footnote-reference" href="#id8 2" id="id30" name="id30">[1]</a>:</p>1108 <p>Returns the sum of the arguments <a class="footnote-reference" href="#id83" id="id31" name="id31">[1]</a>:</p> 1102 1109 <pre class="literal-block"> 1103 1110 $(int-add addend1, addend2[, addendN]) 1104 1111 </pre> 1105 1112 <p>Returns the difference between the first argument and the sum of the 1106 rest <a class="footnote-reference" href="#id8 2" id="id31" name="id31">[1]</a>:</p>1113 rest <a class="footnote-reference" href="#id83" id="id32" name="id32">[1]</a>:</p> 1107 1114 <pre class="literal-block"> 1108 1115 $(int-sub minuend, subtrahend[, subtrahendN]) 1109 1116 </pre> 1110 <p>Returns the product of the arguments <a class="footnote-reference" href="#id8 2" id="id32" name="id32">[1]</a>:</p>1117 <p>Returns the product of the arguments <a class="footnote-reference" href="#id83" id="id33" name="id33">[1]</a>:</p> 1111 1118 <pre class="literal-block"> 1112 1119 $(int-mul factor1, factor2[, factorN]) 1113 1120 </pre> 1114 <p>Returns the quotient of first argument and the rest <a class="footnote-reference" href="#id8 2" id="id33" name="id33">[1]</a>:</p>1121 <p>Returns the quotient of first argument and the rest <a class="footnote-reference" href="#id83" id="id34" name="id34">[1]</a>:</p> 1115 1122 <pre class="literal-block"> 1116 1123 $(int-div dividend, divisor[, divisorN]) 1117 1124 </pre> 1118 <p>Returns the modulus of the two arguments <a class="footnote-reference" href="#id8 2" id="id34" name="id34">[1]</a>:</p>1125 <p>Returns the modulus of the two arguments <a class="footnote-reference" href="#id83" id="id35" name="id35">[1]</a>:</p> 1119 1126 <pre class="literal-block"> 1120 1127 $(int-mod dividend, divisor) 1121 1128 </pre> 1122 <p>Returns the bitwise two-complement of argument <a class="footnote-reference" href="#id8 2" id="id35" name="id35">[1]</a>:</p>1129 <p>Returns the bitwise two-complement of argument <a class="footnote-reference" href="#id83" id="id36" name="id36">[1]</a>:</p> 1123 1130 <pre class="literal-block"> 1124 1131 $(int-not val) 1125 1132 </pre> 1126 <p>Returns the result of a bitwise AND of the arguments <a class="footnote-reference" href="#id8 2" id="id36" name="id36">[1]</a>:</p>1133 <p>Returns the result of a bitwise AND of the arguments <a class="footnote-reference" href="#id83" id="id37" name="id37">[1]</a>:</p> 1127 1134 <pre class="literal-block"> 1128 1135 $(int-and val1, val2[, valN]) 1129 1136 </pre> 1130 <p>Returns the result of a bitwise OR of the arguments <a class="footnote-reference" href="#id8 2" id="id37" name="id37">[1]</a>:</p>1137 <p>Returns the result of a bitwise OR of the arguments <a class="footnote-reference" href="#id83" id="id38" name="id38">[1]</a>:</p> 1131 1138 <pre class="literal-block"> 1132 1139 $(int-or val1, val2[, valN]) 1133 1140 </pre> 1134 <p>Returns the result of a bitwise XOR of the arguments <a class="footnote-reference" href="#id8 2" id="id38" name="id38">[1]</a>:</p>1141 <p>Returns the result of a bitwise XOR of the arguments <a class="footnote-reference" href="#id83" id="id39" name="id39">[1]</a>:</p> 1135 1142 <pre class="literal-block"> 1136 1143 $(int-xor val1, val2[, valN]) 1137 1144 </pre> 1138 1145 <p>Returns the <tt class="docutils literal"><span class="pre">kmk</span></tt> boolean (true = non-empty, false = empty) result 1139 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 2" id="id39" name="id39">[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="#id83" id="id40" name="id40">[1]</a>:</p> 1140 1147 <pre class="literal-block"> 1141 1148 $(int-eq val1, val2) 1142 1149 </pre> 1143 <p>Returns the <tt class="docutils literal"><span class="pre">kmk</span></tt> boolean result of <tt class="docutils literal"><span class="pre">val1</span> <span class="pre">!=</span> <span class="pre">val2</span></tt> <a class="footnote-reference" href="#id8 2" id="id40" name="id40">[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="#id83" id="id41" name="id41">[1]</a>:</p> 1144 1151 <pre class="literal-block"> 1145 1152 $(int-ne val1, val2) 1146 1153 </pre> 1147 <p>Returns the <tt class="docutils literal"><span class="pre">kmk</span></tt> boolean result of <tt class="docutils literal"><span class="pre">val1</span> <span class="pre">></span> <span class="pre">val2</span></tt> <a class="footnote-reference" href="#id8 2" id="id41" name="id41">[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="#id83" id="id42" name="id42">[1]</a>:</p> 1148 1155 <pre class="literal-block"> 1149 1156 $(int-gt val1, val2) 1150 1157 </pre> 1151 <p>Returns the <tt class="docutils literal"><span class="pre">kmk</span></tt> boolean result of <tt class="docutils literal"><span class="pre">val1</span> <span class="pre">>=</span> <span class="pre">val2</span></tt> <a class="footnote-reference" href="#id8 2" id="id42" name="id42">[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="#id83" id="id43" name="id43">[1]</a>:</p> 1152 1159 <pre class="literal-block"> 1153 1160 $(int-ge val1, val2) 1154 1161 </pre> 1155 <p>Returns the <tt class="docutils literal"><span class="pre">kmk</span></tt> boolean result of <tt class="docutils literal"><span class="pre">val1</span> <span class="pre"><</span> <span class="pre">val2</span></tt> <a class="footnote-reference" href="#id8 2" id="id43" name="id43">[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="#id83" id="id44" name="id44">[1]</a>:</p> 1156 1163 <pre class="literal-block"> 1157 1164 $(int-lt val1, val2) 1158 1165 </pre> 1159 <p>Returns the <tt class="docutils literal"><span class="pre">kmk</span></tt> boolean result of <tt class="docutils literal"><span class="pre">val1</span> <span class="pre"><=</span> <span class="pre">val2</span></tt> <a class="footnote-reference" href="#id8 2" id="id44" name="id44">[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="#id83" id="id45" name="id45">[1]</a>:</p> 1160 1167 <pre class="literal-block"> 1161 1168 $(int-le val1, val2) … … 1181 1188 </pre> 1182 1189 <p>Test if the two strings are identical, returning <tt class="docutils literal"><span class="pre">kmk</span></tt> boolean (true = 1183 non-empty, false = empty) <a class="footnote-reference" href="#id8 3" id="id45" name="id45">[2]</a>:</p>1190 non-empty, false = empty) <a class="footnote-reference" href="#id84" id="id46" name="id46">[2]</a>:</p> 1184 1191 <pre class="literal-block"> 1185 1192 $(eq str1, str2) 1186 1193 </pre> 1187 <p>Invert a <tt class="docutils literal"><span class="pre">kmk</span></tt> boolean value <a class="footnote-reference" href="#id8 3" id="id46" name="id46">[2]</a>:</p>1194 <p>Invert a <tt class="docutils literal"><span class="pre">kmk</span></tt> boolean value <a class="footnote-reference" href="#id84" id="id47" name="id47">[2]</a>:</p> 1188 1195 <pre class="literal-block"> 1189 1196 $(not val) 1190 1197 </pre> 1191 <p>Test if <tt class="docutils literal"><span class="pre">variable</span></tt> is defined, returning a <tt class="docutils literal"><span class="pre">kmk</span></tt> boolean value <a class="footnote-reference" href="#id8 2" id="id47" name="id47">[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="#id83" id="id48" name="id48">[1]</a>:</p> 1192 1199 <pre class="literal-block"> 1193 1200 $(defined variable) 1194 1201 </pre> 1195 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 1196 value <a class="footnote-reference" href="#id8 2" id="id48" name="id48">[1]</a>:</p>1203 value <a class="footnote-reference" href="#id83" id="id49" name="id49">[1]</a>:</p> 1197 1204 <pre class="literal-block"> 1198 1205 $(intersects set-a, set-b) 1199 1206 </pre> 1200 <p>Same as <tt class="docutils literal"><span class="pre">$(if</span> <span class="pre">)</span></tt> execpt that the condition is a <tt class="docutils literal"><span class="pre">kmk</span></tt>-expression <a class="footnote-reference" href="#id8 2" id="id49" name="id49">[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="#id83" id="id50" name="id50">[1]</a>:</p> 1201 1208 <pre class="literal-block"> 1202 1209 $(if-expr kmk-expression,true-part[,false-part]) … … 1204 1211 <p>Select the first true condition (<tt class="docutils literal"><span class="pre">kmk</span></tt>-expression) and expand the 1205 1212 following body. Special condition strings <tt class="docutils literal"><span class="pre">default</span></tt> and 1206 <tt class="docutils literal"><span class="pre">otherwise</span></tt> <a class="footnote-reference" href="#id8 2" id="id50" name="id50">[1]</a>:</p>1213 <tt class="docutils literal"><span class="pre">otherwise</span></tt> <a class="footnote-reference" href="#id83" id="id51" name="id51">[1]</a>:</p> 1207 1214 <pre class="literal-block"> 1208 1215 $(select when1-cond, when1-body[, whenN-cond, whenN-body]) 1209 1216 </pre> 1210 1217 <p>Evalutate the <tt class="docutils literal"><span class="pre">kmk-expression</span></tt> returning what it evalues as. This is 1211 the preferred way of doing arithmentic now <a class="footnote-reference" href="#id8 2" id="id51" name="id51">[1]</a>:</p>1218 the preferred way of doing arithmentic now <a class="footnote-reference" href="#id83" id="id52" name="id52">[1]</a>:</p> 1212 1219 <pre class="literal-block"> 1213 1220 $(expr kmk-expression) … … 1216 1223 <p>Stack Fuctions:</p> 1217 1224 <blockquote> 1218 <p>Push <tt class="docutils literal"><span class="pre">item</span></tt> onto the <tt class="docutils literal"><span class="pre">stack-var</span></tt>, returning the empty string <a class="footnote-reference" href="#id8 2" id="id52" name="id52">[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="#id83" id="id53" name="id53">[1]</a>:</p> 1219 1226 <pre class="literal-block"> 1220 1227 $(stack-push stack-var, item) 1221 1228 </pre> 1222 <p>Pop the top item off the <tt class="docutils literal"><span class="pre">stack-var</span></tt> <a class="footnote-reference" href="#id8 2" id="id53" name="id53">[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="#id83" id="id54" name="id54">[1]</a>:</p> 1223 1230 <pre class="literal-block"> 1224 1231 $(stack-pop stack-var) 1225 1232 </pre> 1226 <p>Pop the top item off the <tt class="docutils literal"><span class="pre">stack-var</span></tt>, returning the empty string <a class="footnote-reference" href="#id8 2" id="id54" name="id54">[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="#id83" id="id55" name="id55">[1]</a>:</p> 1227 1234 <pre class="literal-block"> 1228 1235 $(stack-popv stack-var) 1229 1236 </pre> 1230 <p>Get the top item of the <tt class="docutils literal"><span class="pre">stack-var</span></tt>, returning the empty string <a class="footnote-reference" href="#id8 2" id="id55" name="id55">[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="#id83" id="id56" name="id56">[1]</a>:</p> 1231 1238 <pre class="literal-block"> 1232 1239 $(stack-top stack-var) … … 1248 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, 1249 1256 then expand <tt class="docutils literal"><span class="pre">body</span></tt> concatenating the result to the previous iterations 1250 (spaced), and finally evaluate <tt class="docutils literal"><span class="pre">next</span></tt> <a class="footnote-reference" href="#id8 2" id="id56" name="id56">[1]</a>:</p>1257 (spaced), and finally evaluate <tt class="docutils literal"><span class="pre">next</span></tt> <a class="footnote-reference" href="#id83" id="id57" name="id57">[1]</a>:</p> 1251 1258 <pre class="literal-block"> 1252 1259 $(for init,conditions,next,body) … … 1254 1261 <p>C-style while-loop. Each iteration will check whether the <tt class="docutils literal"><span class="pre">condition</span></tt> 1255 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 1256 result to the previous iterations <a class="footnote-reference" href="#id8 2" id="id57" name="id57">[1]</a>:</p>1263 result to the previous iterations <a class="footnote-reference" href="#id83" id="id58" name="id58">[1]</a>:</p> 1257 1264 <pre class="literal-block"> 1258 1265 $(while conditions,body) … … 1269 1276 </pre> 1270 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 1271 own variable context <a class="footnote-reference" href="#id8 2" id="id58" name="id58">[1]</a>:</p>1278 own variable context <a class="footnote-reference" href="#id83" id="id59" name="id59">[1]</a>:</p> 1272 1279 <pre class="literal-block"> 1273 1280 $(evalctx text) 1274 1281 </pre> 1275 <p>Same as <tt class="docutils literal"><span class="pre">$(eval</span> <span class="pre">$(value</span> <span class="pre">var))</span></tt> <a class="footnote-reference" href="#id8 2" id="id59" name="id59">[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="#id83" id="id60" name="id60">[1]</a>:</p> 1276 1283 <pre class="literal-block"> 1277 1284 $(evalval var) 1278 1285 </pre> 1279 <p>Same as <tt class="docutils literal"><span class="pre">$(evalctx</span> <span class="pre">$(value</span> <span class="pre">var))</span></tt> <a class="footnote-reference" href="#id8 2" id="id60" name="id60">[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="#id83" id="id61" name="id61">[1]</a>:</p> 1280 1287 <pre class="literal-block"> 1281 1288 $(evalvalctx var) 1282 1289 </pre> 1283 <p>A combination of <tt class="docutils literal"><span class="pre">$(eval</span> <span class="pre">)</span></tt>, <tt class="docutils literal"><span class="pre">$(call</span> <span class="pre">)</span></tt> and <tt class="docutils literal"><span class="pre">$(value</span> <span class="pre">)</span></tt> <a class="footnote-reference" href="#id8 2" id="id61" name="id61">[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="#id83" id="id62" name="id62">[1]</a>:</p> 1284 1291 <pre class="literal-block"> 1285 1292 $(evalcall var) 1286 1293 </pre> 1287 <p>A combination of <tt class="docutils literal"><span class="pre">$(eval</span> <span class="pre">)</span></tt> and <tt class="docutils literal"><span class="pre">$(call</span> <span class="pre">)</span></tt> <a class="footnote-reference" href="#id8 2" id="id62" name="id62">[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="#id83" id="id63" name="id63">[1]</a>:</p> 1288 1295 <pre class="literal-block"> 1289 1296 $(evalcall var) 1290 1297 </pre> 1291 1298 <p>Remove comments and blank lines from the variable <tt class="docutils literal"><span class="pre">var</span></tt>. Expands to 1292 the empty string <a class="footnote-reference" href="#id8 2" id="id63" name="id63">[1]</a>:</p>1299 the empty string <a class="footnote-reference" href="#id83" id="id64" name="id64">[1]</a>:</p> 1293 1300 <pre class="literal-block"> 1294 1301 $(eval-opt-var var) 1295 1302 </pre> 1296 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 1297 or the file at <tt class="docutils literal"><span class="pre">pos</span></tt> (one-origin) <a class="footnote-reference" href="#id8 2" id="id64" name="id64">[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="#id83" id="id65" name="id65">[1]</a>:</p> 1298 1305 <pre class="literal-block"> 1299 1306 $(deps target[, pos]) 1300 1307 </pre> 1301 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 1302 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 2" id="id65" name="id65">[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="#id83" id="id66" name="id66">[1]</a>:</p> 1303 1310 <pre class="literal-block"> 1304 1311 $(deps-all target[, pos]) 1305 1312 </pre> 1306 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 1307 thing or the file at <tt class="docutils literal"><span class="pre">pos</span></tt> (one-origin) <a class="footnote-reference" href="#id8 2" id="id66" name="id66">[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="#id83" id="id67" name="id67">[1]</a>:</p> 1308 1315 <pre class="literal-block"> 1309 1316 $(deps-newer target[, pos]) 1310 1317 </pre> 1311 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 1312 whole thing or the file at <tt class="docutils literal"><span class="pre">pos</span></tt> (one-origin) <a class="footnote-reference" href="#id8 2" id="id67" name="id67">[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="#id83" id="id68" name="id68">[1]</a>:</p> 1313 1320 <pre class="literal-block"> 1314 1321 $(deps-oo target[, pos]) … … 1318 1325 <blockquote> 1319 1326 <p>Create one or more command lines avoiding the max argument 1320 length restriction of the host OS <a class="footnote-reference" href="#id8 2" id="id68" name="id68">[1]</a>:</p>1327 length restriction of the host OS <a class="footnote-reference" href="#id83" id="id69" name="id69">[1]</a>:</p> 1321 1328 <pre class="literal-block"> 1322 1329 $(xargs ar cas mylib.a,$(objects)) … … 1325 1332 <p>Returns the commands for the specified target separated by new-line, space, 1326 1333 or a user defined string. Note that this might not produce the 100% correct 1327 result if any of the prerequisite automatic variables are used <a class="footnote-reference" href="#id8 2" id="id69" name="id69">[1]</a>:</p>1334 result if any of the prerequisite automatic variables are used <a class="footnote-reference" href="#id83" id="id70" name="id70">[1]</a>:</p> 1328 1335 <pre class="literal-block"> 1329 1336 $(commands target) … … 1334 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 1335 1342 line by line is stripped of leading spaces, command prefixes and 1336 trailing spaces before comparing <a class="footnote-reference" href="#id8 2" id="id70" name="id70">[1]</a>:</p>1343 trailing spaces before comparing <a class="footnote-reference" href="#id83" id="id71" name="id71">[1]</a>:</p> 1337 1344 <pre class="literal-block"> 1338 1345 $(comp-cmds cmds-var1, cmds-var2, ne) … … 1341 1348 <p>Compares the values of the two variables returning the empty string if 1342 1349 equal and the 3rd argument if not. Leading and trailing spaces is 1343 ignored <a class="footnote-reference" href="#id8 2" id="id71" name="id71">[1]</a>:</p>1350 ignored <a class="footnote-reference" href="#id83" id="id72" name="id72">[1]</a>:</p> 1344 1351 <pre class="literal-block"> 1345 1352 $(comp-var var1, var2, ne) … … 1377 1384 <p>Returns the current local time and date formatted in the <tt class="docutils literal"><span class="pre">strftime</span></tt> 1378 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 1379 not specified <a class="footnote-reference" href="#id8 2" id="id72" name="id72">[1]</a>:</p>1386 not specified <a class="footnote-reference" href="#id83" id="id73" name="id73">[1]</a>:</p> 1380 1387 <pre class="literal-block"> 1381 1388 $(date fmt) … … 1383 1390 <p>Returns the current UTC time and date formatted in the <tt class="docutils literal"><span class="pre">strftime</span></tt> 1384 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 1385 not specified <a class="footnote-reference" href="#id8 2" id="id73" name="id73">[1]</a>:</p>1392 not specified <a class="footnote-reference" href="#id83" id="id74" name="id74">[1]</a>:</p> 1386 1393 <pre class="literal-block"> 1387 1394 $(date-utc fmt) … … 1389 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 1390 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 1391 <tt class="docutils literal"><span class="pre">%Y-%m-%dT%H:%M:%SZ</span></tt> if not specified <a class="footnote-reference" href="#id8 2" id="id74" name="id74">[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="#id83" id="id75" name="id75">[1]</a>:</p> 1392 1399 <pre class="literal-block"> 1393 1400 $(date-utc fmt,time,in-fmt) 1394 1401 </pre> 1395 <p>Returns the current nanosecond timestamp (monotonic when possible) <a class="footnote-reference" href="#id8 2" id="id75" name="id75">[1]</a>:</p>1402 <p>Returns the current nanosecond timestamp (monotonic when possible) <a class="footnote-reference" href="#id83" id="id76" name="id76">[1]</a>:</p> 1396 1403 <pre class="literal-block"> 1397 1404 $(nanots ) 1398 1405 </pre> 1399 1406 <p>Returns the size of the specified file, or -1 if the size could not 1400 be obtained. This can be used to check if a file exist or not <a class="footnote-reference" href="#id8 2" id="id76" name="id76">[1]</a>:</p>1407 be obtained. This can be used to check if a file exist or not <a class="footnote-reference" href="#id83" id="id77" name="id77">[1]</a>:</p> 1401 1408 <pre class="literal-block"> 1402 1409 $(file-size file) 1403 1410 </pre> 1404 <p>Searches the <tt class="docutils literal"><span class="pre">PATH</span></tt> <tt class="docutils literal"><span class="pre">kmk</span></tt> variable for the specified <tt class="docutils literal"><span class="pre">files</span></tt> <a class="footnote-reference" href="#id8 2" id="id77" name="id77">[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="#id83" id="id78" name="id78">[1]</a>:</p> 1405 1412 <pre class="literal-block"> 1406 1413 $(which files...) 1407 1414 </pre> 1408 <p>OS/2: Returns the specified LIBPATH variable value <a class="footnote-reference" href="#id8 2" id="id78" name="id78">[1]</a>:</p>1415 <p>OS/2: Returns the specified LIBPATH variable value <a class="footnote-reference" href="#id83" id="id79" name="id79">[1]</a>:</p> 1409 1416 <pre class="literal-block"> 1410 1417 $(libpath var) 1411 1418 </pre> 1412 1419 <p>OS/2: Sets the specified LIBPATH variable value, returning the empty 1413 string <a class="footnote-reference" href="#id8 2" id="id79" name="id79">[1]</a>:</p>1420 string <a class="footnote-reference" href="#id83" id="id80" name="id80">[1]</a>:</p> 1414 1421 <pre class="literal-block"> 1415 1422 $(libpath var,value) … … 1419 1426 <blockquote> 1420 1427 <p>Returns various make statistics, if no item is specified a default 1421 selection is returned <a class="footnote-reference" href="#id8 2" id="id80" name="id80">[1]</a>:</p>1428 selection is returned <a class="footnote-reference" href="#id83" id="id81" name="id81">[1]</a>:</p> 1422 1429 <pre class="literal-block"> 1423 1430 $(make-stats item[,itemN]) 1424 1431 </pre> 1425 1432 <p>Raise a debug breakpoint. Used for debugging <tt class="docutils literal"><span class="pre">kmk</span></tt> makefile 1426 parsing <a class="footnote-reference" href="#id8 2" id="id81" name="id81">[1]</a>:</p>1433 parsing <a class="footnote-reference" href="#id83" id="id82" name="id82">[1]</a>:</p> 1427 1434 <pre class="literal-block"> 1428 1435 $(breakpoint ) … … 1430 1437 </blockquote> 1431 1438 <hr class="docutils" /> 1432 <table class="docutils footnote" frame="void" id="id82" rules="none">1433 <colgroup><col class="label" /><col /></colgroup>1434 <tbody valign="top">1435 <tr><td class="label"><a name="id82">[1]</a></td><td><em>(<a class="fn-backref" href="#id1">1</a>, <a class="fn-backref" href="#id2">2</a>, <a class="fn-backref" href="#id3">3</a>, <a class="fn-backref" href="#id4">4</a>, <a class="fn-backref" href="#id5">5</a>, <a class="fn-backref" href="#id6">6</a>, <a class="fn-backref" href="#id7">7</a>, <a class="fn-backref" href="#id8">8</a>, <a class="fn-backref" href="#id9">9</a>, <a class="fn-backref" href="#id10">10</a>, <a class="fn-backref" href="#id11">11</a>, <a class="fn-backref" href="#id12">12</a>, <a class="fn-backref" href="#id13">13</a>, <a class="fn-backref" href="#id14">14</a>, <a class="fn-backref" href="#id15">15</a>, <a class="fn-backref" href="#id16">16</a>, <a class="fn-backref" href="#id17">17</a>, <a class="fn-backref" href="#id18">18</a>, <a class="fn-backref" href="#id19">19</a>, <a class="fn-backref" href="#id20">20</a>, <a class="fn-backref" href="#id21">21</a>, <a class="fn-backref" href="#id22">22</a>, <a class="fn-backref" href="#id23">23</a>, <a class="fn-backref" href="#id24">24</a>, <a class="fn-backref" href="#id25">25</a>, <a class="fn-backref" href="#id26">26</a>, <a class="fn-backref" href="#id27">27</a>, <a class="fn-backref" href="#id28">28</a>, <a class="fn-backref" href="#id29">29</a>, <a class="fn-backref" href="#id30">30</a>, <a class="fn-backref" href="#id31">31</a>, <a class="fn-backref" href="#id32">32</a>, <a class="fn-backref" href="#id33">33</a>, <a class="fn-backref" href="#id34">34</a>, <a class="fn-backref" href="#id35">35</a>, <a class="fn-backref" href="#id36">36</a>, <a class="fn-backref" href="#id37">37</a>, <a class="fn-backref" href="#id38">38</a>, <a class="fn-backref" href="#id39">39</a>, <a class="fn-backref" href="#id40">40</a>, <a class="fn-backref" href="#id41">41</a>, <a class="fn-backref" href="#id42">42</a>, <a class="fn-backref" href="#id43">43</a>, <a class="fn-backref" href="#id44">44</a>, <a class="fn-backref" href="#id47">45</a>, <a class="fn-backref" href="#id48">46</a>, <a class="fn-backref" href="#id49">47</a>, <a class="fn-backref" href="#id50">48</a>, <a class="fn-backref" href="#id51">49</a>, <a class="fn-backref" href="#id52">50</a>, <a class="fn-backref" href="#id53">51</a>, <a class="fn-backref" href="#id54">52</a>, <a class="fn-backref" href="#id55">53</a>, <a class="fn-backref" href="#id56">54</a>, <a class="fn-backref" href="#id57">55</a>, <a class="fn-backref" href="#id58">56</a>, <a class="fn-backref" href="#id59">57</a>, <a class="fn-backref" href="#id60">58</a>, <a class="fn-backref" href="#id61">59</a>, <a class="fn-backref" href="#id62">60</a>, <a class="fn-backref" href="#id63">61</a>, <a class="fn-backref" href="#id64">62</a>, <a class="fn-backref" href="#id65">63</a>, <a class="fn-backref" href="#id66">64</a>, <a class="fn-backref" href="#id67">65</a>, <a class="fn-backref" href="#id68">66</a>, <a class="fn-backref" href="#id69">67</a>, <a class="fn-backref" href="#id70">68</a>, <a class="fn-backref" href="#id71">69</a>, <a class="fn-backref" href="#id72">70</a>, <a class="fn-backref" href="#id73">71</a>, <a class="fn-backref" href="#id74">72</a>, <a class="fn-backref" href="#id75">73</a>, <a class="fn-backref" href="#id76">74</a>, <a class="fn-backref" href="#id77">75</a>, <a class="fn-backref" href="#id78">76</a>, <a class="fn-backref" href="#id79">77</a>, <a class="fn-backref" href="#id80">78</a>, <a class="fn-backref" href="#id81">79</a>)</em> <tt class="docutils literal"><span class="pre">kmk</span></tt> only feature.</td></tr>1436 </tbody>1437 </table>1438 1439 <table class="docutils footnote" frame="void" id="id83" rules="none"> 1439 1440 <colgroup><col class="label" /><col /></colgroup> 1440 1441 <tbody valign="top"> 1441 <tr><td class="label"><a name="id83">[2]</a></td><td><em>(<a class="fn-backref" href="#id45">1</a>, <a class="fn-backref" href="#id46">2</a>)</em> Experimental GNU <tt class="docutils literal"><span class="pre">make</span></tt> feature that is not enabled by default.</td></tr> 1442 <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 <table class="docutils footnote" frame="void" id="id84" rules="none"> 1446 <colgroup><col class="label" /><col /></colgroup> 1447 <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> 1442 1449 </tbody> 1443 1450 </table> -
trunk/kBuild/doc/QuickReference-kmk.txt
r2171 r2172 605 605 $(basename names...) 606 606 607 Extract the root specification of each file name (a bit complicated on 608 Windows & OS/2) [1]_:: 609 610 $(root names...) 611 607 612 Append ``suffix`` to each word in ``names``:: 608 613 -
trunk/src/kmk/Makefile.am
r2161 r2172 145 145 -DCONFIG_WITH_STRING_FUNCTIONS \ 146 146 -DCONFIG_WITH_LOOP_FUNCTIONS \ 147 -DCONFIG_WITH_ROOT_FUNC \ 147 148 -DCONFIG_PRETTY_COMMAND_PRINTING \ 148 149 -DCONFIG_WITH_PRINT_STATS_SWITCH \ -
trunk/src/kmk/Makefile.kmk
r2161 r2172 171 171 CONFIG_WITH_STRING_FUNCTIONS \ 172 172 CONFIG_WITH_LOOP_FUNCTIONS \ 173 CONFIG_WITH_ROOT_FUNC \ 173 174 CONFIG_PRETTY_COMMAND_PRINTING \ 174 175 CONFIG_WITH_PRINT_STATS_SWITCH \ -
trunk/src/kmk/function.c
r2163 r2172 808 808 } 809 809 810 #ifdef CONFIG_WITH_ROOT_FUNC 811 /* 812 $(root path) 813 814 This is mainly for dealing with drive letters and UNC paths on Windows 815 and OS/2. 816 */ 817 static char * 818 func_root (char *o, char **argv, const char *funcname UNUSED) 819 { 820 const char *paths = argv[0] ? argv[0] : ""; 821 int doneany = 0; 822 const char *p; 823 unsigned int len; 824 825 while ((p = find_next_token (&paths, &len)) != 0) 826 { 827 const char *p2 = p; 828 829 #ifdef HAVE_DOS_PATHS 830 if ( len >= 2 831 && p2[1] == ':' 832 && ( (p2[0] >= 'A' && p2[0] <= 'Z') 833 || (p2[0] >= 'a' && p2[0] <= 'z'))) 834 { 835 p2 += 2; 836 len -= 2; 837 } 838 else if (len >= 4 && IS_PATHSEP(p2[0]) && IS_PATHSEP(p2[1]) 839 && !IS_PATHSEP(p2[2])) 840 { 841 /* Min recognized UNC: "//./" - find the next slash 842 Typical root: "//srv/shr/" */ 843 /* XXX: Check if //./ needs special handling. */ 844 845 p2 += 3; 846 len -= 3; 847 while (len > 0 && !IS_PATHSEP(*p2)) 848 p2++, len--; 849 850 if (len && IS_PATHSEP(p2[0]) && (len == 1 || !IS_PATHSEP(p2[1]))) 851 { 852 p2++; 853 len--; 854 855 if (len) /* optional share */ 856 while (len > 0 && !IS_PATHSEP(*p2)) 857 p2++, len--; 858 } 859 else 860 p2 = NULL; 861 } 862 else if (IS_PATHSEP(*p2)) 863 { 864 p2++; 865 len--; 866 } 867 else 868 p2 = NULL; 869 870 #elif defined (VMS) || defined (AMGIA) 871 /* XXX: VMS and AMGIA */ 872 fatal (NILF, _("$(root ) is not implemented on this platform")); 873 #else 874 if (IS_PATHSEP(*p2)) 875 { 876 p2++; 877 len--; 878 } 879 else 880 p2 = NULL; 881 #endif 882 if (p2 != NULL) 883 { 884 /* Include all subsequent path seperators. */ 885 886 while (len > 0 && IS_PATHSEP(*p2)) 887 p2++, len--; 888 o = variable_buffer_output (o, p, p2 - p); 889 o = variable_buffer_output (o, " ", 1); 890 doneany = 1; 891 } 892 } 893 894 if (doneany) 895 /* Kill last space. */ 896 --o; 897 898 return o; 899 } 900 #endif /* CONFIG_WITH_ROOT_FUNC */ 901 810 902 static char * 811 903 func_addsuffix_addprefix (char *o, char **argv, const char *funcname) … … 4971 5063 { STRING_SIZE_TUPLE("dir"), 0, 1, 1, func_basename_dir}, 4972 5064 { STRING_SIZE_TUPLE("notdir"), 0, 1, 1, func_notdir_suffix}, 5065 #ifdef CONFIG_WITH_ROOT_FUNC 5066 { STRING_SIZE_TUPLE("root"), 0, 1, 1, func_root}, 5067 #endif 4973 5068 { STRING_SIZE_TUPLE("subst"), 3, 3, 1, func_subst}, 4974 5069 { STRING_SIZE_TUPLE("suffix"), 0, 1, 1, func_notdir_suffix}, -
trunk/src/kmk/variable.c
r2164 r2172 1207 1207 && defined (CONFIG_WITH_PRINTF) \ 1208 1208 && defined (CONFIG_WITH_LOOP_FUNCTIONS) \ 1209 && defined (CONFIG_WITH_ROOT_FUNC) \ 1209 1210 && defined (CONFIG_WITH_STRING_FUNCTIONS) \ 1210 1211 && defined (KMK_HELPERS) … … 1232 1233 " printf" 1233 1234 " for while" 1235 " root" 1234 1236 " length insert pos lastpos substr translate" 1235 1237 " kb-src-tool kb-obj-base kb-obj-suff kb-src-prop kb-src-one kb-exp-tmpl " … … 1301 1303 strcat (buf, " for while"); 1302 1304 # endif 1305 # if defined (CONFIG_WITH_ROOT_FUNC) 1306 strcat (buf, " root"); 1307 # endif 1303 1308 # if defined (CONFIG_WITH_STRING_FUNCTIONS) 1304 1309 strcat (buf, " length insert pos lastpos substr translate");
Note:
See TracChangeset
for help on using the changeset viewer.