table of contents
ckati - experimental GNU make clone
ckati [OPTION]... [TARGET]...
ckati is a C++ implementation of kati, an experimental make clone.
The motivation of kati was to speed up Android platform build. The Android platform’s build system is built on GNU make and allows developers to write build rules in a descriptive way.
ckati is a complete rewrite of GNU make from scratch, focused on speeding up incremental builds.
ckati supports two modes of execution. It can directly execute the commands specified in the Makefile, or it can generate a ninja file corresponding to the Makefile.
The ninja generator mode is the main mode of operation, since the built-in executor of ckati lacks important features for a build system like parallel builds.
The ninja generator mode is not fully compatible with GNU make due to a feature mismatch between make and ninja. Since ninja only allows one command per a rule, when the Makefile has multiple commands, ckati generates a rule with the commands joined with &&. When $(shell ...) is used, ckati translates it into shell’s $(...). This works in many cases, but doesn’t when the result of $(shell ...) is passed to another function:
echo $(if $(shell echo),FAIL,PASS)
If -\-regen flag is specified, ckati checks if anything in your environment has changed after the previous run. If the ninja file doesn’t need to be regenerated, it finishes quickly.
The following is checked when deciding whether the ninja file should be regenerated or not:
- The command line flags passed to ckati
- Timestamps of the Makefiles used to generate the previous ninja file
- Environment variables used while evaluating Makefiles
- Results of $(wildcard ...)
- Results of $(shell ...)
Ckati doesn’t run $(shell date ...) and $(shell echo ...) during these checks.
Ckati optimises $(shell find ...) calls, since the Android’s build system uses a lot of them to create a list of all .java/.mk files under a directory, and they are slow. Ckati has a built-in emulator of GNU find. The find emulator traverse the directory tree and creates an in-memory directory tree. When $(shell find ...) is used, the find emulator returns results of find commands using the cached tree, giving a performance boost.
- Print debugging information.
- Print ckati warnings.
- -f FILE
- Use FILE as a Makefile.
- Do not run anything, only perform a syntax check.
- Dry run mode: print the commands that would be executed, but do not execute them.
- Silent operation; do not print the commands as they are executed.
- -j JOBS
- Specifies the number of JOBS (commands) to run simultaneously.
- Do not provide any built-in rules.
- Ninja generator mode: do not execute commands directly, but generate a ninja file. By default, the ninja file is saved as build.ninja, and a shell script to execute ninja is saved as ninja.sh. An optional suffix can be added to the file names by using --ninja_suffix option.
- The directory where the ninja file will be generated; the default is the current directory.
- The ninja file suffix; the default is no suffix.
- Emulate find command calls to improve build performance.
- Regenerate the ninja file only when necessary.
- Detect the use of $(shell echo ...) in Android build system.
- Detect dependency files.
The following options can emit warnings or errors if certain Makefile features are used:
- Fail when overriding commands for a previously defined target.
- --warn_implicit_rules, --werror_implicit_rules
- Warn or fail when implicit rules are used.
- --warn_suffix_rules, --werror_suffix_rules
- Warn or fail when suffix rules are used.
- --warn_real_to_phony, --werror_real_to_phony
- Warn or fail when a real target depends on a PHONY target.
- --warn_phony_looks_real, --werror_phony_looks_real
- Warn or fail when a PHONY target contains slashes.
- Fail when writing to a read-only directory.
SUPPORTED MAKE FUNCTIONS¶
File name functions:
Make control functions:
ckati exits with a status of zero if all Makefiles were successfully parsed and no targets that were built failed.
This manual page was written by Andrej Shadura for the Debian project.