{{{kmk}}} is the {{{make}}} program in [wiki:kBuild kBuild], e.g. it is what you invoke from the commandline or editor to perform the actual build. {{{kmk}}} is based on the latest [wiki:'GNU make'] release, currently 3.81, but provides a bunch of additional features required by the [wiki:kBuild kBuild] makefile scripts. Why not use vanilla [wiki:'GNU make']? There are several reasons: * When [wiki:kBuild kBuild] was reborn using [wiki:'GNU make'] (an earlier incarnation of the project was based on FreeBSD make) the 3.81 release was about 2 years ahead. [wiki:kBuild kBuild] relies on many features introduced after 3.80. Requiring 3.81 to be installed still isn't a viable option. * Be able to add new features without having trouble getting them accepted or having to wait 3-4 years until the next [wiki:'GNU make'] version is released and makes it out to all the corners of the world. * Be able to fix bugs fast, same reasoning as above. * Not having to require a specific, perhaps even unreleased, [wiki:'GNU make'] version. * Not having to deal with missing features and bugs specific to various [wiki:'GNU make'] versions and ports. * Finally, because we can. :-) The current {{{kmk}}} code contains the following changes from [wiki:'GNU make']: * It has some extra predefined variables: * {{{KMK}}} (similar to {{{MAKE}}}) * {{{KMK_VERSION}}} * {{{KMK_FEATURES}}} * {{{KBUILD_VERSION}}} * {{{KBUILD_VERSION_MAJOR}}} * {{{KBUILD_VERSION_MINOR}}} * {{{KBUILD_VERSION_PATCH}}} * {{{PATH_KBUILD}}} * {{{PATH_KBUILD_BIN}}} * It has a few new builtin functions: * {{{abspathex}}} * {{{compcmds}}} * {{{compvar}}} * {{{int-add}}} * {{{int-sub}}} * {{{int-mul}}} * {{{int-div}}} * {{{int-mod}}} * {{{int-not}}} * {{{int-and}}} * {{{int-or}}} * {{{int-xor}}} * {{{int-eq}}} * {{{int-ne}}} * {{{int-gt}}} * {{{int-ge}}} * {{{int-lt}}} * {{{int-le}}} * {{{rsort}}} * {{{stack-push}}} * {{{stack-pop}}} * {{{stack-popv}}} * {{{stack-top}}} * {{{toupper}}} * {{{tolower}}} * {{{xargs}}} * {{{eq}}} ("experimental" GNU make code) * {{{not}}} ("experimental" GNU make code) * {{{kb-src-tool}}} (kBuild internal) * {{{kb-obj-base}}} (kBuild internal) * {{{kb-obj-suff}}} (kBuild internal) * {{{kb-src-prop}}} (kBuild internal) * {{{kb-src-one}}} (kBuild internal) * Explicit multi-target rules, e.i. explicit make rules that output more than one file. * Prepend assignment operator, {{{<=}}}. * It contains bugfixes for several bugs in the Windows and OS/2 ports, most importantly path case mixups, broken shell invocation, and abspath. * It has several performance improvements with respect to the kind of work [wiki:kBuild kBuild] puts make thru. Most notably, keeping name and value lengths for variables and thereby skipping a lot of {{{strlen()}}} and being able to use {{{memcpy()}}} instead of {{{strcpy()}}}, and the variable append/prepend optimization ({{{+=}}} and {{{<=}}}). The latter was a major issue with the way [wiki:kBuild kBuild] is scripted. * A bunch of builtin utilities which will be invoked without spawning new process or shell. Most of these are taken from BSD. * kmk_builtin_append * kmk_builtin_cp * kmk_builtin_cat * kmk_builtin_echo * kmk_builtin_install * kmk_builtin_ln * kmk_builtin_mkdir * kmk_builtin_mv * kmk_builtin_rm (clean just wouldn't work without this) * kmk_builtin_rmdir * kmk_builtin_printf * A new argument {{{--priority <1..5>}}} which sets the priority of the [wiki:kmk] process. 1 is idle time, 3 is normal, and 5 is highest priority. * The special {{{.NOTPARALLEL}}} [wiki:goals goal] has been extended to be able to take a list of [wiki:goals] that must be executed without any parallel building going on. If no list is given, it will work like in vanilla [wiki:'GNU make'] which means the entire makefile will be executed without any parallel building. This extension is required to make the {{{-jN}}} argument useful in [wiki:kBuild].