Ignore:
Timestamp:
Dec 30, 2008, 5:52:13 PM (17 years ago)
Author:
bird
Message:

kmk-qr: reorg

File:
1 edited

Legend:

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

    r2167 r2168  
    264264
    265265
     266Special Targets
     267---------------
     268
     269todo
     270
     271
     272
     273Commands
     274--------
     275
     276Builtin commands all start with ``kmk_builtin_``, so in order to save space
     277this prefix has been omitted in the table below. All commands comes in an
     278external edition that can be used by/in the shell, these are prefixed ``kmk_``.
     279
     280+---------------+-------------------------------------------------------------+
     281| Command       | Description                                                 |
     282+===============+=============================================================+
     283| ``append``    | Append text to a file. The builtin version can output the   |
     284|               | value of a variable or the commands of a target.            |
     285+---------------+-------------------------------------------------------------+
     286| ``cat``       | The BSD ``cat`` command.                                    |
     287+---------------+-------------------------------------------------------------+
     288| ``chmod``     | The BSD ``chmod`` command.                                  |
     289+---------------+-------------------------------------------------------------+
     290| ``cmp``       | The BSD ``cmp`` command.                                    |
     291+---------------+-------------------------------------------------------------+
     292| ``cp``        | The BSD ``cp`` command with some twaking.                   |
     293+---------------+-------------------------------------------------------------+
     294| ``echo``      | The BSD ``echo`` command.                                   |
     295+---------------+-------------------------------------------------------------+
     296| ``expr``      | The BSD ``expr`` command.                                   |
     297+---------------+-------------------------------------------------------------+
     298| ``install``   | The BSD ``install`` command with some tweaking.             |
     299+---------------+-------------------------------------------------------------+
     300| ``kDepIDB``   | Extract dependencies from a Visual C++ .IDB file.           |
     301+---------------+-------------------------------------------------------------+
     302| ``ln``        | The BSD ``ln`` command.                                     |
     303+---------------+-------------------------------------------------------------+
     304| ``md5sum``    | Typical MD5 sum program, custom kBuild version.             |
     305+---------------+-------------------------------------------------------------+
     306| ``mkdir``     | The BSD ``mkdir`` command.                                  |
     307+---------------+-------------------------------------------------------------+
     308| ``mv``        | The BSD ``mv`` command with some tweaking.                  |
     309+---------------+-------------------------------------------------------------+
     310| ``printf``    | The BSD ``printf`` command.                                 |
     311+---------------+-------------------------------------------------------------+
     312| ``rm``        | The BSD ``rm`` command with some tweaking.                  |
     313+---------------+-------------------------------------------------------------+
     314| ``rmdir``     | The BSD ``rmdir`` command with some tweaking.               |
     315+---------------+-------------------------------------------------------------+
     316| ``sleep``     | Typical ``sleep`` program, custom kBuild version.           |
     317+---------------+-------------------------------------------------------------+
     318| ``test``      | The BSD ``test`` program with some tweaking.                |
     319+---------------+-------------------------------------------------------------+
     320
     321Some additional external commands are available in the ``kmk`` / ``kBuild``
     322environment (``kSomething`` command are not prefixed with ``kmk_``):
     323
     324+---------------+-------------------------------------------------------------+
     325| Command       | Description                                                 |
     326+===============+=============================================================+
     327| ``kDepPre``   | Extract dependencies from the C/C++ preprocessor output.    |
     328+---------------+-------------------------------------------------------------+
     329| ``kObjCache`` | Simple object file cache program.                           |
     330+---------------+-------------------------------------------------------------+
     331| ``ash``       | Almquist's shell (NetBSD variant).                          |
     332+---------------+-------------------------------------------------------------+
     333| ``gmake``     | Vanilla GNU ``make`` from same sources as ``kmk``.          |
     334+---------------+-------------------------------------------------------------+
     335| ``redirect``  | Shell avoidance tool. Sets up file descriptors, environment |
     336|               | variables and current directory before kicking of program.  |
     337+---------------+-------------------------------------------------------------+
     338| ``sed``       | GNU ``sed`` with some tweaks to avoid involving the shell.  |
     339+---------------+-------------------------------------------------------------+
     340| ``time``      | Stopwatch utility for measuring program execution time(s).  |
     341+---------------+-------------------------------------------------------------+
     342
     343
     344
     345kmk-expression
     346--------------
     347
     348``kmk``-expressions are related to the C/C++ preprocessor in some ways as well
     349as ``nmake`` and BSD ``make``. There are however some peculiarities because of
     350the way GNU ``make`` choose to represent booleans in its function library, so,
     351strings can be turned into boolean by taking any non-empty string as true.
     352
     353Quoting using single quotes results in hard strings, while double quotes and
     354unquoted string results in soft strings that can be converted to number or
     355boolean to fit the situation.
     356
     357Here's the operator table in decending precedence order:
     358
     359+---------------+--------+-----------------------------------------------------+
     360| Operator      | Type   | Description                                         |
     361+===============+========+=====================================================+
     362| ``defined``   | Unary  | Checks if the following variable exists.            |
     363+---------------+        +-----------------------------------------------------+
     364| ``exists``    |        | Checks if the following file exists.                |
     365+---------------+        +-----------------------------------------------------+
     366| ``target``    |        | Checks if the following target exists.              |
     367+---------------+        +-----------------------------------------------------+
     368| ``bool``      |        | Casts the following value to boolean.               |
     369+---------------+        +-----------------------------------------------------+
     370| ``num``       |        | Casts the following value to a number.              |
     371+---------------+        +-----------------------------------------------------+
     372| ``str``       |        | Casts the following value to a string.              |
     373+---------------+--------+-----------------------------------------------------+
     374| ``!``         | Unary  | Logical NOT.                                        |
     375+---------------+        +-----------------------------------------------------+
     376| ``+``         |        | Pluss prefix.                                       |
     377+---------------+        +-----------------------------------------------------+
     378| ``-``         |        | Minus prefix.                                       |
     379+---------------+        +-----------------------------------------------------+
     380| ``~``         |        | Bitwise one's complement.                           |
     381+---------------+--------+-----------------------------------------------------+
     382| ``*``         | Binary | Multiplication (product).                           |
     383+---------------+        +-----------------------------------------------------+
     384| ``/``         |        | Division (quotient).                                |
     385+---------------+        +-----------------------------------------------------+
     386| ``%``         |        | Modulus (remainder).                                |
     387+---------------+--------+-----------------------------------------------------+
     388| ``+``         | Binary | Addition (sum).                                     |
     389+---------------+        +-----------------------------------------------------+
     390| ``-``         |        | Subtraction (difference).                           |
     391+---------------+--------+-----------------------------------------------------+
     392| ``<<``        | Binary | Bitwise left shift.                                 |
     393+---------------+        +-----------------------------------------------------+
     394| ``>>``        |        | Bitwise right shift.                                |
     395+---------------+--------+-----------------------------------------------------+
     396| ``<=``        | Binary | Less or equal than.                                 |
     397+---------------+        +-----------------------------------------------------+
     398| ``<``         |        | Less than.                                          |
     399+---------------+        +-----------------------------------------------------+
     400| ``>=``        |        | Greater or equal than.                              |
     401+---------------+        +-----------------------------------------------------+
     402| ``>``         |        | Greater than.                                       |
     403+---------------+--------+-----------------------------------------------------+
     404| ``==``        | Binary | Equal to.                                           |
     405+---------------+        +-----------------------------------------------------+
     406| ``!=``        |        | Not equal to.                                       |
     407+---------------+--------+-----------------------------------------------------+
     408| ``&``         | Binary | Bitwise AND.                                        |
     409+---------------+--------+-----------------------------------------------------+
     410| ``^``         | Binary | Bitwise XOR.                                        |
     411+---------------+--------+-----------------------------------------------------+
     412| ``|``         | Binary | Bitwise OR.                                         |
     413+---------------+--------+-----------------------------------------------------+
     414| ``&&``        | Binary | Logical AND.                                        |
     415+---------------+--------+-----------------------------------------------------+
     416| ``||``        | Binary | Logical OR.                                         |
     417+---------------+--------+-----------------------------------------------------+
     418
     419
     420
    266421Built-in functions
    267422------------------
     
    747902
    748903
    749 
    750 Special Targets
    751 ---------------
    752 
    753 todo
    754 
    755 
    756 
    757 Commands
    758 --------
    759 
    760 Builtin commands all start with ``kmk_builtin_``, so in order to save space
    761 this prefix has been omitted in the table below. All commands comes in an
    762 external edition that can be used by/in the shell, these are prefixed ``kmk_``.
    763 
    764 +---------------+-------------------------------------------------------------+
    765 | Command       | Description                                                 |
    766 +===============+=============================================================+
    767 | ``append``    | Append text to a file. The builtin version can output the   |
    768 |               | value of a variable or the commands of a target.            |
    769 +---------------+-------------------------------------------------------------+
    770 | ``cat``       | The BSD ``cat`` command.                                    |
    771 +---------------+-------------------------------------------------------------+
    772 | ``chmod``     | The BSD ``chmod`` command.                                  |
    773 +---------------+-------------------------------------------------------------+
    774 | ``cmp``       | The BSD ``cmp`` command.                                    |
    775 +---------------+-------------------------------------------------------------+
    776 | ``cp``        | The BSD ``cp`` command with some twaking.                   |
    777 +---------------+-------------------------------------------------------------+
    778 | ``echo``      | The BSD ``echo`` command.                                   |
    779 +---------------+-------------------------------------------------------------+
    780 | ``expr``      | The BSD ``expr`` command.                                   |
    781 +---------------+-------------------------------------------------------------+
    782 | ``install``   | The BSD ``install`` command with some tweaking.             |
    783 +---------------+-------------------------------------------------------------+
    784 | ``kDepIDB``   | Extract dependencies from a Visual C++ .IDB file.           |
    785 +---------------+-------------------------------------------------------------+
    786 | ``ln``        | The BSD ``ln`` command.                                     |
    787 +---------------+-------------------------------------------------------------+
    788 | ``md5sum``    | Typical MD5 sum program, custom kBuild version.             |
    789 +---------------+-------------------------------------------------------------+
    790 | ``mkdir``     | The BSD ``mkdir`` command.                                  |
    791 +---------------+-------------------------------------------------------------+
    792 | ``mv``        | The BSD ``mv`` command with some tweaking.                  |
    793 +---------------+-------------------------------------------------------------+
    794 | ``printf``    | The BSD ``printf`` command.                                 |
    795 +---------------+-------------------------------------------------------------+
    796 | ``rm``        | The BSD ``rm`` command with some tweaking.                  |
    797 +---------------+-------------------------------------------------------------+
    798 | ``rmdir``     | The BSD ``rmdir`` command with some tweaking.               |
    799 +---------------+-------------------------------------------------------------+
    800 | ``sleep``     | Typical ``sleep`` program, custom kBuild version.           |
    801 +---------------+-------------------------------------------------------------+
    802 | ``test``      | The BSD ``test`` program with some tweaking.                |
    803 +---------------+-------------------------------------------------------------+
    804 
    805 Some additional external commands are available in the ``kmk`` / ``kBuild``
    806 environment (``kSomething`` command are not prefixed with ``kmk_``):
    807 
    808 +---------------+-------------------------------------------------------------+
    809 | Command       | Description                                                 |
    810 +===============+=============================================================+
    811 | ``kDepPre``   | Extract dependencies from the C/C++ preprocessor output.    |
    812 +---------------+-------------------------------------------------------------+
    813 | ``kObjCache`` | Simple object file cache program.                           |
    814 +---------------+-------------------------------------------------------------+
    815 | ``ash``       | Almquist's shell (NetBSD variant).                          |
    816 +---------------+-------------------------------------------------------------+
    817 | ``gmake``     | Vanilla GNU ``make`` from same sources as ``kmk``.          |
    818 +---------------+-------------------------------------------------------------+
    819 | ``redirect``  | Shell avoidance tool. Sets up file descriptors, environment |
    820 |               | variables and current directory before kicking of program.  |
    821 +---------------+-------------------------------------------------------------+
    822 | ``sed``       | GNU ``sed`` with some tweaks to avoid involving the shell.  |
    823 +---------------+-------------------------------------------------------------+
    824 | ``time``      | Stopwatch utility for measuring program execution time(s).  |
    825 +---------------+-------------------------------------------------------------+
    826 
    827 
    828 kmk-expression
    829 --------------
    830 
    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 +---------------+--------+-----------------------------------------------------+
    901 
    902 
    903 
    904904-----
    905905
Note: See TracChangeset for help on using the changeset viewer.