Changes between Version 2 and Version 3 of kmk Quick Reference
- Timestamp:
- Dec 31, 2008, 1:12:04 AM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
kmk Quick Reference
v2 v3 5 5 =================== 6 6 7 This appendix summarizes the directives, text manipulation functions, and8 special variables which ``kmk`` understands.9 10 .. See section Special Built-in Target Names and Summary of Options, for other 11 summaries. 7 This is an attempt at summarizing all directives, functions, special variables, 8 special targets, built-in commands, external commands, and ``kmk``-expressions. 9 Since *all* the features are included, the quickness of this reference can be 10 disputed. ;-) 11 12 12 13 13 … … 32 32 ifneq "a" "b" 33 33 ifneq 'a' 'b' 34 if1of (set-a,set-b) 35 ifn1of (set-a,set-b) 36 if expression 34 if1of (set-a,set-b) [1] 35 ifn1of (set-a,set-b) [1] 36 if expression [1] 37 37 else 38 38 endif … … 44 44 sinclude file 45 45 46 Include another dependency file ::46 Include another dependency file [1]_:: 47 47 48 48 includedep file … … 54 54 override variable := value 55 55 override variable += value 56 override variable <= value 56 override variable <= value [1] 57 57 override variable ?= value 58 58 override define variable … … 70 70 export variable := value 71 71 export variable += value 72 export variable <= value 72 export variable <= value [1] 73 73 export variable ?= value 74 74 unexport variable 75 75 76 Define a variable in the local context instead of the global one ::76 Define a variable in the local context instead of the global one [1]_:: 77 77 78 78 local variable = value … … 181 181 +--------------------------+--------------------------------------------------+ 182 182 | ``KBUILD_VERSION``, | The kBuild version string and the break down | 183 | ``KBUILD_VERSION_MAJOR``,| into individual components. 183 | ``KBUILD_VERSION_MAJOR``,| into individual components. [1]_ | 184 184 | ``KBUILD_VERSION_MINOR``,| | 185 185 | ``KBUILD_VERSION_PATCH``,| | 186 186 | ``KBUILD_KMK_REVISION`` | | 187 187 +--------------------------+--------------------------------------------------+ 188 | ``KBUILD_HOST`` 189 +--------------------------+--------------------------------------------------+ 190 | ``KBUILD_HOST_ARCH`` 191 +--------------------------+--------------------------------------------------+ 192 | ``KBUILD_HOST_CPU`` 188 | ``KBUILD_HOST`` [1]_ | The host operating system. | 189 +--------------------------+--------------------------------------------------+ 190 | ``KBUILD_HOST_ARCH`` [1]_| The host architecture. | 191 +--------------------------+--------------------------------------------------+ 192 | ``KBUILD_HOST_CPU`` [1]_ | The host CPU ``kmk`` is built for, set to | 193 193 | | ``blend`` if not any particular CPU. | 194 194 +--------------------------+--------------------------------------------------+ 195 | ``KBUILD_PATH`` 196 +--------------------------+--------------------------------------------------+ 197 | ``KBUILD_BIN_PATH`` 198 +--------------------------+--------------------------------------------------+ 199 | ``KMK`` ,| The name with which ``kmk`` was invoked. Using |195 | ``KBUILD_PATH`` [1]_ | Where the kBuild scripts are. | 196 +--------------------------+--------------------------------------------------+ 197 | ``KBUILD_BIN_PATH`` [1]_ | Where the host specific kBuild binaries are. | 198 +--------------------------+--------------------------------------------------+ 199 | ``KMK`` [1]_, | The name with which ``kmk`` was invoked. Using | 200 200 | ``MAKE`` | this variable in recipes has special meaning. | 201 201 +--------------------------+--------------------------------------------------+ 202 | ``KMK_BUILTIN`` 203 +--------------------------+--------------------------------------------------+ 204 | ``KMK_FEATURES`` 205 +--------------------------+--------------------------------------------------+ 206 | ``KMK_FLAGS`` 202 | ``KMK_BUILTIN`` [1]_ | List of built-in commands. | 203 +--------------------------+--------------------------------------------------+ 204 | ``KMK_FEATURES`` [1]_ | List of ``kmk`` specific features. | 205 +--------------------------+--------------------------------------------------+ 206 | ``KMK_FLAGS`` [1]_ | The flags given to ``kmk``. You can set this in | 207 207 | | the environment or a makefile to set flags. | 208 208 | | | … … 213 213 | | through the environment from its parent. | 214 214 +--------------------------+--------------------------------------------------+ 215 | ``KMK_LEVEL`` 216 +--------------------------+--------------------------------------------------+ 217 | ``KMK_VERSION`` 215 | ``KMK_LEVEL`` [1]_ | The number of levels of recursion (sub-makes). | 216 +--------------------------+--------------------------------------------------+ 217 | ``KMK_VERSION`` [1]_ | The GNU ``make`` version number. | 218 218 +--------------------------+--------------------------------------------------+ 219 219 | ``MAKECMDGOALS`` | The targets given to ``kmk`` on the command line.| … … 243 243 244 244 245 The following variables reflects ``kmk`` options. Do not set these. 245 The following variables reflects ``kmk`` options. Do not set these. [1]_ 246 246 247 247 +-------------------------------------+---------------------------------------+ … … 267 267 268 268 269 Special Targets 270 --------------- 271 272 Certain names have special meanings if they appear as targets. 273 274 +-------------------------------+---------------------------------------------+ 275 | Target | Description | 276 +===============================+=============================================+ 277 | ``.DEFAULT`` | The recipe is used for any target for which | 278 | | no rules are found. | 279 +-------------------------------+---------------------------------------------+ 280 | ``.DELETE_ON_ERROR`` | If mentioned, ``kmk`` will delete the | 281 | | targets of a rule if it has changed and its | 282 | | recipe fails or is interrupted. | 283 +-------------------------------+---------------------------------------------+ 284 | ``.EXPORT_ALL_VARIABLES`` | If mentioned, all variables will by default | 285 | | be exported to child processes. | 286 +-------------------------------+---------------------------------------------+ 287 | ``.IGNORE`` | Ignore errors in the execution of the recipe| 288 | | for the targets ``.IGNORE`` depends on, if | 289 | | no prequisites all targets are affected. | 290 +-------------------------------+---------------------------------------------+ 291 | ``.INTERMEDIATE`` | The prerequisites are treated as | 292 | | intermediate files (implicite rules). | 293 +-------------------------------+---------------------------------------------+ 294 | ``.LOW_RESOLUTION_TIME`` | ``kmk`` will assume prerequisite files are | 295 | | created with low resolution time stamps. | 296 +-------------------------------+---------------------------------------------+ 297 | ``.NOTPARALLEL`` | If mentioned without any prerequisites, | 298 | | ``kmk`` will run serially as if -j1 was | 299 | | given. If it has prerequisites ``kmk`` [1]_ | 300 | | will only do this for the targets among | 301 | | them. | 302 +-------------------------------+---------------------------------------------+ 303 | ``.PHONY`` | The prerequisites are considered phony and | 304 | | will be rebuilt unconditionally. | 305 +-------------------------------+---------------------------------------------+ 306 | ``.PRECIOUS`` | The targets which ``.PRECIOUS`` depends | 307 | | will to be deleted if ``kmk`` is killed or | 308 | | interrupted while their building. | 309 +-------------------------------+---------------------------------------------+ 310 | ``.SECONDARY`` | The prerequisites are treated as | 311 | | intermediate files, except that they are | 312 | | never automatically deleted. If used with | 313 | | no prerequisites all targets gets this | 314 | | treatement. | 315 +-------------------------------+---------------------------------------------+ 316 | ``.SECONDEXPANSION`` | If mentioned, all prerequisite lists after | 317 | | it will be expanded a second time after all | 318 | | makefiles have been read. | 319 +-------------------------------+---------------------------------------------+ 320 | ``.SECONDTARGETEXPANSION`` | If mentioned, all targets after it will be | 321 | [1]_ | expanded a second time after all makefiles | 322 | | have been read. | 323 +-------------------------------+---------------------------------------------+ 324 | ``.SILENT`` | ``kmk`` will not print the recipe for | 325 | | targets listed as prerequisites, if none | 326 | | then it applies to all targets. | 327 +-------------------------------+---------------------------------------------+ 328 | ``.SUFFIXES`` | The prerequisites are the list of suffixes | 329 | | used in checking for suffix rules. If it | 330 | | appears without prerequisites it the suffix | 331 | | will be cleared. | 332 +-------------------------------+---------------------------------------------+ 333 334 335 336 Commands 337 -------- 338 339 Builtin commands [1]_ all start with ``kmk_builtin_``, so in order to save 340 space this prefix has been omitted in the table below. All commands comes in an 341 external edition that can be used by/in the shell, these are prefixed ``kmk_``. 342 343 +---------------+-------------------------------------------------------------+ 344 | Command | Description | 345 +===============+=============================================================+ 346 | ``append`` | Append text to a file. The builtin version can output the | 347 | | value of a variable or the commands of a target. | 348 +---------------+-------------------------------------------------------------+ 349 | ``cat`` | The BSD ``cat`` command. | 350 +---------------+-------------------------------------------------------------+ 351 | ``chmod`` | The BSD ``chmod`` command. | 352 +---------------+-------------------------------------------------------------+ 353 | ``cmp`` | The BSD ``cmp`` command. | 354 +---------------+-------------------------------------------------------------+ 355 | ``cp`` | The BSD ``cp`` command with some twaking. | 356 +---------------+-------------------------------------------------------------+ 357 | ``echo`` | The BSD ``echo`` command. | 358 +---------------+-------------------------------------------------------------+ 359 | ``expr`` | The BSD ``expr`` command. | 360 +---------------+-------------------------------------------------------------+ 361 | ``install`` | The BSD ``install`` command with some tweaking. | 362 +---------------+-------------------------------------------------------------+ 363 | ``kDepIDB`` | Extract dependencies from a Visual C++ .IDB file. | 364 +---------------+-------------------------------------------------------------+ 365 | ``ln`` | The BSD ``ln`` command. | 366 +---------------+-------------------------------------------------------------+ 367 | ``md5sum`` | Typical MD5 sum program, custom kBuild version. | 368 +---------------+-------------------------------------------------------------+ 369 | ``mkdir`` | The BSD ``mkdir`` command. | 370 +---------------+-------------------------------------------------------------+ 371 | ``mv`` | The BSD ``mv`` command with some tweaking. | 372 +---------------+-------------------------------------------------------------+ 373 | ``printf`` | The BSD ``printf`` command. | 374 +---------------+-------------------------------------------------------------+ 375 | ``rm`` | The BSD ``rm`` command with some tweaking. | 376 +---------------+-------------------------------------------------------------+ 377 | ``rmdir`` | The BSD ``rmdir`` command with some tweaking. | 378 +---------------+-------------------------------------------------------------+ 379 | ``sleep`` | Typical ``sleep`` program, custom kBuild version. | 380 +---------------+-------------------------------------------------------------+ 381 | ``test`` | The BSD ``test`` program with some tweaking. | 382 +---------------+-------------------------------------------------------------+ 383 384 Some additional external commands are available in the ``kmk`` / ``kBuild`` 385 environment (``kSomething`` command are not prefixed with ``kmk_``): 386 387 +---------------+-------------------------------------------------------------+ 388 | Command | Description | 389 +===============+=============================================================+ 390 | ``kDepPre`` | Extract dependencies from the C/C++ preprocessor output. | 391 +---------------+-------------------------------------------------------------+ 392 | ``kObjCache`` | Simple object file cache program. | 393 +---------------+-------------------------------------------------------------+ 394 | ``ash`` | Almquist's shell (NetBSD variant). | 395 +---------------+-------------------------------------------------------------+ 396 | ``gmake`` | Vanilla GNU ``make`` from same sources as ``kmk``. | 397 +---------------+-------------------------------------------------------------+ 398 | ``redirect`` | Shell avoidance tool. Sets up file descriptors, environment | 399 | | variables and current directory before kicking of program. | 400 +---------------+-------------------------------------------------------------+ 401 | ``sed`` | GNU ``sed`` with some tweaks to avoid involving the shell. | 402 +---------------+-------------------------------------------------------------+ 403 | ``time`` | Stopwatch utility for measuring program execution time(s). | 404 +---------------+-------------------------------------------------------------+ 405 406 407 408 kmk-expression 409 -------------- 410 411 ``kmk``-expressions [1]_ are related to the C/C++ preprocessor in some ways as 412 well as ``nmake`` and BSD ``make``. There are however some peculiarities 413 because of the way GNU ``make`` choose to represent booleans in its function 414 library, so, strings can be turned into boolean by taking any non-empty string 415 as true. 416 417 Quoting using single quotes results in hard strings, while double quotes and 418 unquoted string results in soft strings that can be converted to number or 419 boolean to fit the situation. 420 421 Here's the operator table in decending precedence order: 422 423 +---------------+--------+-----------------------------------------------------+ 424 | Operator | Type | Description | 425 +===============+========+=====================================================+ 426 | ``defined`` | Unary | Checks if the following variable exists. | 427 +---------------+ +-----------------------------------------------------+ 428 | ``exists`` | | Checks if the following file exists. | 429 +---------------+ +-----------------------------------------------------+ 430 | ``target`` | | Checks if the following target exists. | 431 +---------------+ +-----------------------------------------------------+ 432 | ``bool`` | | Casts the following value to boolean. | 433 +---------------+ +-----------------------------------------------------+ 434 | ``num`` | | Casts the following value to a number. | 435 +---------------+ +-----------------------------------------------------+ 436 | ``str`` | | Casts the following value to a string. | 437 +---------------+--------+-----------------------------------------------------+ 438 | ``!`` | Unary | Logical NOT. | 439 +---------------+ +-----------------------------------------------------+ 440 | ``+`` | | Pluss prefix. | 441 +---------------+ +-----------------------------------------------------+ 442 | ``-`` | | Minus prefix. | 443 +---------------+ +-----------------------------------------------------+ 444 | ``~`` | | Bitwise one's complement. | 445 +---------------+--------+-----------------------------------------------------+ 446 | ``*`` | Binary | Multiplication (product). | 447 +---------------+ +-----------------------------------------------------+ 448 | ``/`` | | Division (quotient). | 449 +---------------+ +-----------------------------------------------------+ 450 | ``%`` | | Modulus (remainder). | 451 +---------------+--------+-----------------------------------------------------+ 452 | ``+`` | Binary | Addition (sum). | 453 +---------------+ +-----------------------------------------------------+ 454 | ``-`` | | Subtraction (difference). | 455 +---------------+--------+-----------------------------------------------------+ 456 | ``<<`` | Binary | Bitwise left shift. | 457 +---------------+ +-----------------------------------------------------+ 458 | ``>>`` | | Bitwise right shift. | 459 +---------------+--------+-----------------------------------------------------+ 460 | ``<=`` | Binary | Less or equal than. | 461 +---------------+ +-----------------------------------------------------+ 462 | ``<`` | | Less than. | 463 +---------------+ +-----------------------------------------------------+ 464 | ``>=`` | | Greater or equal than. | 465 +---------------+ +-----------------------------------------------------+ 466 | ``>`` | | Greater than. | 467 +---------------+--------+-----------------------------------------------------+ 468 | ``==`` | Binary | Equal to. | 469 +---------------+ +-----------------------------------------------------+ 470 | ``!=`` | | Not equal to. | 471 +---------------+--------+-----------------------------------------------------+ 472 | ``&`` | Binary | Bitwise AND. | 473 +---------------+--------+-----------------------------------------------------+ 474 | ``^`` | Binary | Bitwise XOR. | 475 +---------------+--------+-----------------------------------------------------+ 476 | ``|`` | Binary | Bitwise OR. | 477 +---------------+--------+-----------------------------------------------------+ 478 | ``&&`` | Binary | Logical AND. | 479 +---------------+--------+-----------------------------------------------------+ 480 | ``||`` | Binary | Logical OR. | 481 +---------------+--------+-----------------------------------------------------+ 482 483 484 269 485 Built-in functions 270 486 ------------------ … … 302 518 303 519 Sort the words in ``list`` lexicographically in reserve order, removing 304 duplicates ::520 duplicates [1]_:: 305 521 306 522 $(rsort list) … … 330 546 $(join list1,list2) 331 547 332 Fold ``text`` to upper case ::548 Fold ``text`` to upper case [1]_:: 333 549 334 550 $(toupper text) 335 551 336 Fold ``text`` to lower case ::552 Fold ``text`` to lower case [1]_:: 337 553 338 554 $(tolower text) 339 555 340 String formatting a la the unix ``printf`` command ::556 String formatting a la the unix ``printf`` command [1]_:: 341 557 342 558 $(printf fmt, arg...) 343 559 344 Return the length of a string or a (unexpanded) variable ::560 Return the length of a string or a (unexpanded) variable [1]_:: 345 561 346 562 $(length string) … … 349 565 Find the position of ``needle`` in ``haystack``, returns 0 if not found. 350 566 Negative ``start`` indices are relative to the end of ``haystack``, while 351 positive ones are one based ::567 positive ones are one based [1]_:: 352 568 353 569 $(pos needle, haystack[, start]) … … 356 572 Returns the specified substring. The ``start`` works like with ``$(pos )``. 357 573 If the substring is partially outside the ``string`` the result will be 358 padded with ``pad`` if present ::574 padded with ``pad`` if present [1]_:: 359 575 360 576 $(substr string, start[, length[, pad]]) 361 577 362 578 Insert ``in`` into ``str`` at the specified position. ``n`` works like with 363 ``$(pos )``, except that ``0`` is the end of the string ::579 ``$(pos )``, except that ``0`` is the end of the string [1]_:: 364 580 365 581 $(insert in, str[, n[, length[, pad]]]) … … 367 583 Translate ``string`` exchanging characters in ``from-set`` with ``to-set``, 368 584 optionally completing ``to-set`` with ``pad-char`` if specified. If no 369 ``pad-char`` characters absent in ``to-set`` will be deleted ::585 ``pad-char`` characters absent in ``to-set`` will be deleted [1]_:: 370 586 371 587 $(translate string, from-set[, to-set[, pad-char]]) … … 391 607 $(basename names...) 392 608 609 Extract the root specification of each file name (a bit complicated on 610 Windows & OS/2) [1]_:: 611 612 $(root names...) 613 393 614 Append ``suffix`` to each word in ``names``:: 394 615 … … 415 636 416 637 Same as ``$(abspath )`` except that the current directory can be 417 specified as ``curdir`` ::638 specified as ``curdir`` [1]_:: 418 639 419 640 $(abspathex names...[, curdir]) … … 422 643 Arithmetic Functions: 423 644 424 Returns the sum of the arguments ::645 Returns the sum of the arguments [1]_:: 425 646 426 647 $(int-add addend1, addend2[, addendN]) 427 648 428 Returns the difference between the first argument and the sum of the rest:: 649 Returns the difference between the first argument and the sum of the 650 rest [1]_:: 429 651 430 652 $(int-sub minuend, subtrahend[, subtrahendN]) 431 653 432 Returns the product of the arguments ::654 Returns the product of the arguments [1]_:: 433 655 434 656 $(int-mul factor1, factor2[, factorN]) 435 657 436 Returns the quotient of first argument and the rest ::658 Returns the quotient of first argument and the rest [1]_:: 437 659 438 660 $(int-div dividend, divisor[, divisorN]) 439 661 440 Returns the modulus of the two arguments ::662 Returns the modulus of the two arguments [1]_:: 441 663 442 664 $(int-mod dividend, divisor) 443 665 444 Returns the bitwise two-complement of argument ::666 Returns the bitwise two-complement of argument [1]_:: 445 667 446 668 $(int-not val) 447 669 448 Returns the result of a bitwise AND of the arguments ::670 Returns the result of a bitwise AND of the arguments [1]_:: 449 671 450 672 $(int-and val1, val2[, valN]) 451 673 452 Returns the result of a bitwise OR of the arguments ::674 Returns the result of a bitwise OR of the arguments [1]_:: 453 675 454 676 $(int-or val1, val2[, valN]) 455 677 456 Returns the result of a bitwise XOR of the arguments ::678 Returns the result of a bitwise XOR of the arguments [1]_:: 457 679 458 680 $(int-xor val1, val2[, valN]) 459 681 460 682 Returns the ``kmk`` boolean (true = non-empty, false = empty) result 461 of ``val1 == val2`` ::683 of ``val1 == val2`` [1]_:: 462 684 463 685 $(int-eq val1, val2) 464 686 465 Returns the ``kmk`` boolean result of ``val1 != val2`` ::687 Returns the ``kmk`` boolean result of ``val1 != val2`` [1]_:: 466 688 467 689 $(int-ne val1, val2) 468 690 469 Returns the ``kmk`` boolean result of ``val1 > val2`` ::691 Returns the ``kmk`` boolean result of ``val1 > val2`` [1]_:: 470 692 471 693 $(int-gt val1, val2) 472 694 473 Returns the ``kmk`` boolean result of ``val1 >= val2`` ::695 Returns the ``kmk`` boolean result of ``val1 >= val2`` [1]_:: 474 696 475 697 $(int-ge val1, val2) 476 698 477 Returns the ``kmk`` boolean result of ``val1 < val2`` ::699 Returns the ``kmk`` boolean result of ``val1 < val2`` [1]_:: 478 700 479 701 $(int-lt val1, val2) 480 702 481 Returns the ``kmk`` boolean result of ``val1 <= val2`` ::703 Returns the ``kmk`` boolean result of ``val1 <= val2`` [1]_:: 482 704 483 705 $(int-le val1, val2) … … 504 726 505 727 Test if the two strings are identical, returning ``kmk`` boolean (true = 506 non-empty, false = empty) ::728 non-empty, false = empty) [2]_:: 507 729 508 730 $(eq str1, str2) 509 731 510 Invert a ``kmk`` boolean value ::732 Invert a ``kmk`` boolean value [2]_:: 511 733 512 734 $(not val) 513 735 514 Test if ``variable`` is defined, returning a ``kmk`` boolean value ::736 Test if ``variable`` is defined, returning a ``kmk`` boolean value [1]_:: 515 737 516 738 $(defined variable) 517 739 518 740 Test if ``set-a`` and ``set-b`` intersects, returning a ``kmk`` boolean 519 value ::741 value [1]_:: 520 742 521 743 $(intersects set-a, set-b) 522 744 523 Same as ``$(if )`` execpt that the condition is a ``kmk`` expression::745 Same as ``$(if )`` execpt that the condition is a ``kmk``-expression [1]_:: 524 746 525 747 $(if-expr kmk-expression,true-part[,false-part]) 526 748 527 Select the first true condition (``kmk`` expression) and expand the 528 following body. Special condition strings ``default`` and ``otherwise``:: 749 Select the first true condition (``kmk``-expression) and expand the 750 following body. Special condition strings ``default`` and 751 ``otherwise`` [1]_:: 529 752 530 753 $(select when1-cond, when1-body[, whenN-cond, whenN-body]) 531 754 532 Evalutate the ``kmk `` expressionreturning what it evalues as. This is533 the preferred way of doing arithmentic now ::755 Evalutate the ``kmk-expression`` returning what it evalues as. This is 756 the preferred way of doing arithmentic now [1]_:: 534 757 535 758 $(expr kmk-expression) … … 538 761 Stack Fuctions: 539 762 540 Push ``item`` onto the ``stack-var``, returning the empty string ::763 Push ``item`` onto the ``stack-var``, returning the empty string [1]_:: 541 764 542 765 $(stack-push stack-var, item) 543 766 544 Pop the top item off the ``stack-var`` ::767 Pop the top item off the ``stack-var`` [1]_:: 545 768 546 769 $(stack-pop stack-var) 547 770 548 Pop the top item off the ``stack-var``, returning the empty string ::771 Pop the top item off the ``stack-var``, returning the empty string [1]_:: 549 772 550 773 $(stack-popv stack-var) 551 774 552 Get the top item of the ``stack-var``, returning the empty string ::775 Get the top item of the ``stack-var``, returning the empty string [1]_:: 553 776 554 777 $(stack-top stack-var) … … 570 793 first check whether the ``condition`` (``kmk``-expression) is true, 571 794 then expand ``body`` concatenating the result to the previous iterations 572 (spaced), and finally evaluate ``next`` ::795 (spaced), and finally evaluate ``next`` [1]_:: 573 796 574 797 $(for init,conditions,next,body) … … 576 799 C-style while-loop. Each iteration will check whether the ``condition`` 577 800 (``kmk``-expression) is true, then expand ``body`` concatenating the 578 result to the previous iterations ::801 result to the previous iterations [1]_:: 579 802 580 803 $(while conditions,body) … … 591 814 592 815 Same as ``$(eval text)`` except that the ``text`` is expanded in its 593 own variable context ::816 own variable context [1]_:: 594 817 595 818 $(evalctx text) 596 819 597 Same as ``$(eval $(value var))`` ::820 Same as ``$(eval $(value var))`` [1]_:: 598 821 599 822 $(evalval var) 600 823 601 Same as ``$(evalctx $(value var))`` ::824 Same as ``$(evalctx $(value var))`` [1]_:: 602 825 603 826 $(evalvalctx var) 604 827 605 A combination of ``$(eval )``, ``$(call )`` and ``$(value )`` ::828 A combination of ``$(eval )``, ``$(call )`` and ``$(value )`` [1]_:: 606 829 607 830 $(evalcall var) 608 831 609 A combination of ``$(eval )`` and ``$(call )`` ::832 A combination of ``$(eval )`` and ``$(call )`` [1]_:: 610 833 611 834 $(evalcall var) 612 835 613 836 Remove comments and blank lines from the variable ``var``. Expands to 614 the empty string ::837 the empty string [1]_:: 615 838 616 839 $(eval-opt-var var) 617 840 618 841 Returns accessing ``$<`` of ``target``, either retriving the whole thing 619 or the file at ``pos`` (one-origin) ::842 or the file at ``pos`` (one-origin) [1]_:: 620 843 621 844 $(deps target[, pos]) 622 845 623 846 Returns accessing ``$+`` (order + duplicates) of ``target``, either 624 retriving the whole thing or the file at ``pos`` (one-origin) ::847 retriving the whole thing or the file at ``pos`` (one-origin) [1]_:: 625 848 626 849 $(deps-all target[, pos]) 627 850 628 851 Returns accessing ``$?`` of ``target``, either retriving the whole 629 thing or the file at ``pos`` (one-origin) ::852 thing or the file at ``pos`` (one-origin) [1]_:: 630 853 631 854 $(deps-newer target[, pos]) 632 855 633 856 Returns accessing ``$|`` (order only) of ``target``, either retriving the 634 whole thing or the file at ``pos`` (one-origin) ::857 whole thing or the file at ``pos`` (one-origin) [1]_:: 635 858 636 859 $(deps-oo target[, pos]) … … 640 863 641 864 Create one or more command lines avoiding the max argument 642 length restriction of the host OS ::865 length restriction of the host OS [1]_:: 643 866 644 867 $(xargs ar cas mylib.a,$(objects)) … … 648 871 Returns the commands for the specified target separated by new-line, space, 649 872 or a user defined string. Note that this might not produce the 100% correct 650 result if any of the prerequisite automatic variables are used ::873 result if any of the prerequisite automatic variables are used [1]_:: 651 874 652 875 $(commands target) … … 657 880 argument if not. This differs from ``$(comp-vars v1,v2,ne)`` in that 658 881 line by line is stripped of leading spaces, command prefixes and 659 trailing spaces before comparing ::882 trailing spaces before comparing [1]_:: 660 883 661 884 $(comp-cmds cmds-var1, cmds-var2, ne) … … 664 887 665 888 Compares the values of the two variables returning the empty string if 666 equal and the 3rd argument if not. Leading and trailing spaces is ignored:: 889 equal and the 3rd argument if not. Leading and trailing spaces is 890 ignored [1]_:: 667 891 668 892 $(comp-var var1, var2, ne) … … 700 924 Returns the current local time and date formatted in the ``strftime`` 701 925 style specifier ``fmt``. ``fmt`` defaults to ``%Y-%m-%dT%H:%M:%S`` when 702 not specified ::926 not specified [1]_:: 703 927 704 928 $(date fmt) … … 706 930 Returns the current UTC time and date formatted in the ``strftime`` 707 931 style specifier ``fmt``. ``fmt`` defaults to ``%Y-%m-%dT%H:%M:%SZ`` when 708 not specified ::932 not specified [1]_:: 709 933 710 934 $(date-utc fmt) … … 712 936 Reformats the ``in`` time and date using ``fmt``. The ``in-fmt`` defaults 713 937 to ``fmt`` if not specified. While ``fmt`` defaults to 714 ``%Y-%m-%dT%H:%M:%SZ`` if not specified ::938 ``%Y-%m-%dT%H:%M:%SZ`` if not specified [1]_:: 715 939 716 940 $(date-utc fmt,time,in-fmt) 717 941 718 Returns the current nanosecond timestamp (monotonic when possible) ::942 Returns the current nanosecond timestamp (monotonic when possible) [1]_:: 719 943 720 944 $(nanots ) 721 945 722 946 Returns the size of the specified file, or -1 if the size could not 723 be obtained. This can be used to check if a file exist or not ::947 be obtained. This can be used to check if a file exist or not [1]_:: 724 948 725 949 $(file-size file) 726 950 727 Searches the ``PATH`` ``kmk`` variable for the specified ``files`` ::951 Searches the ``PATH`` ``kmk`` variable for the specified ``files`` [1]_:: 728 952 729 953 $(which files...) 730 954 731 OS/2: Returns the specified LIBPATH variable value ::955 OS/2: Returns the specified LIBPATH variable value [1]_:: 732 956 733 957 $(libpath var) 734 958 735 OS/2: Sets the specified LIBPATH variable value, returning the empty string:: 959 OS/2: Sets the specified LIBPATH variable value, returning the empty 960 string [1]_:: 736 961 737 962 $(libpath var,value) … … 741 966 742 967 Returns various make statistics, if no item is specified a default 743 selection is returned ::968 selection is returned [1]_:: 744 969 745 970 $(make-stats item[,itemN]) 746 971 747 Raise a debug breakpoint. Used for debugging ``kmk`` makefile parsing:: 972 Raise a debug breakpoint. Used for debugging ``kmk`` makefile 973 parsing [1]_:: 748 974 749 975 $(breakpoint ) 750 976 751 977 752 753 Special Targets754 ---------------755 756 todo757 758 759 760 Built-in Commands761 -----------------762 763 todo764 765 766 767 kmk-expression768 --------------769 770 todo771 772 773 774 978 ----- 775 979 776 :Status: $Id: QuickReference-kmk.txt 2163 2008-12-30 00:57:13Z bird $ 980 .. [1] ``kmk`` only feature. 981 .. [2] Experimental GNU ``make`` feature that is not enabled by default. 982 983 ----- 984 985 :Status: $Id: QuickReference-kmk.txt 2172 2008-12-31 00:03:02Z bird $ 777 986 :Copyright: Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 778 987 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006,