CKATI(1)

πŸ’– CKATI(1) πŸ’–

okay bestie, sit down, hydrate, because we're talking about ckati β€” that's the User Commands girlie, living in section 1 of your manual, and she is so much more than she looks. ✨


🌸 NAME 🌸

ckati β€” an experimental GNU make clone. yes. a make clone. she said "I can do what make does but faster" and honestly? she ate. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

ckati [OPTION]...  [TARGET]...

that's it. options, then targets. iconic, no notes. πŸ‘‘


✨ DESCRIPTION ✨

so ckati is a C++ implementation of kati, which itself is an experimental make clone. it's giving rewrite-of-a-rewrite energy and we love that for her. πŸ¦‹

the whole motivation? speed. kati existed to speed up the Android platform build. the Android platform's build system is built on GNU make, and it lets developers write build rules in a descriptive way. very demure, very mindful, very descriptive. πŸŽ€

ckati is a complete rewrite of GNU make from scratch, and she's laser-focused on one thing: speeding up incremental builds. periodt.

ckati supports two modes of execution:

  • she can directly execute the commands specified in the Makefile, OR
  • she can generate a ninja file corresponding to the Makefile.

and the ninja generator mode? that's the main mode of operation, bestie. why? because the built-in executor of ckati lacks important features for a build system β€” like parallel builds. πŸ’€ yeah. so ninja mode is the main character here.

now the tea: the ninja generator mode is not fully compatible with GNU make, because there's a feature mismatch between make and ninja. specifically:

  • ninja only allows one command per rule. so when your 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 work when the result of $(shell ...) is passed to another function:
all:
    echo $(if $(shell echo),FAIL,PASS)
🫢 so like, heads up: that's a real limitation, not a vibe. don't come for her.

the --regen glow-up: if the --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, she finishes quickly. queen of not doing unnecessary work. 😌

here's the checklist she runs 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 ...)

and plot twist: ckati doesn't run $(shell date ...) and $(shell echo ...) during these checks. πŸ™ˆ noted.


the find emulator arc 🧚: ckati optimises $(shell find ...) calls, because the Android build system uses a lot of them to create a list of all .java/.mk files under a directory, and they are slow. so ckati has a built-in emulator of GNU find. the find emulator traverses the directory tree and creates an in-memory directory tree. then, when $(shell find ...) is used, the find emulator returns results of find commands using the cached tree, giving a performance boost. slay. πŸ“


πŸ’… OPTIONS πŸ’…

  • -d β€” print debugging information.
  • --warn β€” print ckati warnings.
  • -f _FILE_ β€” use _FILE_ as a Makefile.
  • -c β€” do not run anything, only perform a syntax check.
  • -i β€” dry run mode: print the commands that would be executed, but do not execute them.
  • -s β€” silent operation; do not print the commands as they are executed.
  • -j _JOBS_ β€” specifies the number of _JOBS_ (commands) to run simultaneously.
  • --no_builtin_rules β€” do not provide any built-in rules.
  • --ninja β€” 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 the --ninja_suffix option.
  • --ninja_dir β€” the directory where the ninja file will be generated; the default is the current directory.
  • --ninja_suffix β€” the ninja file suffix; the default is no suffix.
  • --use_find_emulator β€” emulate find command calls to improve build performance.
  • --regen β€” regenerate the ninja file only when necessary.
  • --detect_android_echo β€” detect the use of $(shell echo ...) in Android build system.
  • --detect_depfiles β€” detect dependency files.

πŸ”₯ the warning squad πŸ”₯

the following options can emit warnings or errors if certain Makefile features are used. she's watching. πŸ‘€

  • --werror_overriding_commands β€” 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.
  • --werror_writable β€” fail when writing to a read-only directory.

🌈 SUPPORTED MAKE FUNCTIONS 🌈

here's the roster of make functions ckati actually supports. no cap, this is the whole list. πŸ’–

Text functions

  • subst
  • patsubst
  • strip
  • findstring
  • filter
  • filter-out
  • sort
  • word
  • wordlist
  • words
  • firstword
  • lastword

File name functions

  • dir
  • notdir
  • suffix
  • basename
  • addsuffix
  • addprefix
  • join
  • wildcard
  • realpath
  • abspath

Conditional functions

  • if
  • or
  • and

Make control functions

  • info
  • warning
  • error

Miscellaneous

  • value
  • eval
  • shell
  • call
  • foreach
  • origin
  • flavor
  • file

⭐ EXIT STATUS ⭐

ckati exits with a status of zero if all Makefiles were successfully parsed and no targets that were built failed. two conditions, bestie. both of them. 😀


πŸ¦‹ SEE ALSO πŸ¦‹

make(1), ninja(1) β€” go read the classics too, iykyk. πŸ“š


πŸ’œ AUTHOR πŸ’œ

this manual page was written by Andrej Shadura for the Debian project. thank you for your service. 🫢


and that's the whole page, babes β€” it's ckati, it's CKATI(1), and that's a wrap. mwah. πŸ’‹βœ¨

πŸ“¦ where this page comes from