Changeset 2167 for trunk/kBuild/doc/QuickReference-kmk.txt
- Timestamp:
- Dec 30, 2008, 5:45:46 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kBuild/doc/QuickReference-kmk.txt
r2166 r2167 4 4 5 5 This is an attempt at summarizing all directives, functions, special variables, 6 special targets, built-in commands, external commands, and ``kmk`` 6 special targets, built-in commands, external commands, and ``kmk``-expressions. 7 7 Since *all* the features are included, the quickness of this reference can be 8 8 disputed. ;-) … … 518 518 $(intersects set-a, set-b) 519 519 520 Same as ``$(if )`` execpt that the condition is a ``kmk`` 520 Same as ``$(if )`` execpt that the condition is a ``kmk``-expression:: 521 521 522 522 $(if-expr kmk-expression,true-part[,false-part]) 523 523 524 Select the first true condition (``kmk`` 524 Select the first true condition (``kmk``-expression) and expand the 525 525 following body. Special condition strings ``default`` and ``otherwise``:: 526 526 527 527 $(select when1-cond, when1-body[, whenN-cond, whenN-body]) 528 528 529 Evalutate the ``kmk `` expressionreturning what it evalues as. This is529 Evalutate the ``kmk-expression`` returning what it evalues as. This is 530 530 the preferred way of doing arithmentic now:: 531 531 … … 829 829 -------------- 830 830 831 todo 831 ``kmk``-expressions are related to the C/C++ preprocessor in some ways as well 832 as ``nmake`` and BSD ``make``. There are however some peculiarities because of 833 the way GNU ``make`` choose to represent booleans in its function library, so, 834 strings can be turned into boolean by taking any non-empty string as true. 835 836 Quoting using single quotes results in hard strings, while double quotes and 837 unquoted string results in soft strings that can be converted to number or 838 boolean to fit the situation. 839 840 Here's the operator table in decending precedence order: 841 842 +---------------+--------+-----------------------------------------------------+ 843 | Operator | Type | Description | 844 +===============+========+=====================================================+ 845 | ``defined`` | Unary | Checks if the following variable exists. | 846 +---------------+ +-----------------------------------------------------+ 847 | ``exists`` | | Checks if the following file exists. | 848 +---------------+ +-----------------------------------------------------+ 849 | ``target`` | | Checks if the following target exists. | 850 +---------------+ +-----------------------------------------------------+ 851 | ``bool`` | | Casts the following value to boolean. | 852 +---------------+ +-----------------------------------------------------+ 853 | ``num`` | | Casts the following value to a number. | 854 +---------------+ +-----------------------------------------------------+ 855 | ``str`` | | Casts the following value to a string. | 856 +---------------+--------+-----------------------------------------------------+ 857 | ``!`` | Unary | Logical NOT. | 858 +---------------+ +-----------------------------------------------------+ 859 | ``+`` | | Pluss prefix. | 860 +---------------+ +-----------------------------------------------------+ 861 | ``-`` | | Minus prefix. | 862 +---------------+ +-----------------------------------------------------+ 863 | ``~`` | | Bitwise one's complement. | 864 +---------------+--------+-----------------------------------------------------+ 865 | ``*`` | Binary | Multiplication (product). | 866 +---------------+ +-----------------------------------------------------+ 867 | ``/`` | | Division (quotient). | 868 +---------------+ +-----------------------------------------------------+ 869 | ``%`` | | Modulus (remainder). | 870 +---------------+--------+-----------------------------------------------------+ 871 | ``+`` | Binary | Addition (sum). | 872 +---------------+ +-----------------------------------------------------+ 873 | ``-`` | | Subtraction (difference). | 874 +---------------+--------+-----------------------------------------------------+ 875 | ``<<`` | Binary | Bitwise left shift. | 876 +---------------+ +-----------------------------------------------------+ 877 | ``>>`` | | Bitwise right shift. | 878 +---------------+--------+-----------------------------------------------------+ 879 | ``<=`` | Binary | Less or equal than. | 880 +---------------+ +-----------------------------------------------------+ 881 | ``<`` | | Less than. | 882 +---------------+ +-----------------------------------------------------+ 883 | ``>=`` | | Greater or equal than. | 884 +---------------+ +-----------------------------------------------------+ 885 | ``>`` | | Greater than. | 886 +---------------+--------+-----------------------------------------------------+ 887 | ``==`` | Binary | Equal to. | 888 +---------------+ +-----------------------------------------------------+ 889 | ``!=`` | | Not equal to. | 890 +---------------+--------+-----------------------------------------------------+ 891 | ``&`` | Binary | Bitwise AND. | 892 +---------------+--------+-----------------------------------------------------+ 893 | ``^`` | Binary | Bitwise XOR. | 894 +---------------+--------+-----------------------------------------------------+ 895 | ``|`` | Binary | Bitwise OR. | 896 +---------------+--------+-----------------------------------------------------+ 897 | ``&&`` | Binary | Logical AND. | 898 +---------------+--------+-----------------------------------------------------+ 899 | ``||`` | Binary | Logical OR. | 900 +---------------+--------+-----------------------------------------------------+ 832 901 833 902
Note:
See TracChangeset
for help on using the changeset viewer.