Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can kati be used for conversion of ordinary makefiles? #165

Open
zyppe opened this issue May 5, 2019 · 2 comments
Open

Can kati be used for conversion of ordinary makefiles? #165

zyppe opened this issue May 5, 2019 · 2 comments

Comments

@zyppe
Copy link

zyppe commented May 5, 2019

If I have the makefile for some project, can I use kati to convert the makefile to ninja file and make by ninja. If it can works, it can make 'make' more fast.
If it can, could you write to tell us how we convert?

@danw
Copy link
Collaborator

danw commented May 8, 2019

Depending on your makefile, it may be possible, yes. The most likely problem that you may run into is that Kati does not support recursive make when combined with the ninja output.

Android uses a bunch of arguments to kati:

  --ninja
  --ninja_dir=out
  --ninja_suffix=-aosp_arm
  --no_ninja_prelude
  --regen
  --ignore_optional_include=out/%.P
  --detect_android_echo
  --color_warnings
  --gen_all_targets
  --use_find_emulator
  --werror_find_emulator
  --no_builtin_rules
  --werror_suffix_rules
  --warn_real_to_phony
  --warn_phony_looks_real
  --werror_real_to_phony
  --werror_phony_looks_real
  --werror_writable
  --top_level_phony
  --kati_stats
  --writable out/
  --werror_implicit_rules
  --werror_overriding_commands

But you can probably start with something simple, depending on the structure of your build (this assumes you write everything into an out/* directory):

ckati --ninja --ninja_dir=out --regen
out/ninja.sh

If your source tree is large, I'd recommend trying --use_find_emulator to see if it works for you, it can be a rather big speedup if you've got expensive find commands that it can get rid of.

--color_warnings is nice, as is --detect_android_echo if your rules begin with an echo command.

Many of the rest are for extra warnings / errors that help bring sanity to large & diverse codebases.

If you do move to Kati, there are a number of extensions to the make language as well -- .KATI_DEPFILE is the most important to use, .KATI_RESTAT can be useful in some cases too, and .KATI_IMPLICIT_OUTPUTS to support multiple outputs of a single command (that requires a custom ninja currently). There are a number of others that can help with large codebase sanity as well (readonly / deprecated / obsolete variables)

@rulatir
Copy link

rulatir commented Oct 8, 2020

I don't see any reference to an input makefile in this command:

ckati --ninja --ninja_dir=out --regen

Does it mean that ckati does not take input arguments, and instead it crawls my project looking for makefiles? Or does the makefile have to be in the current directory and named Makefile or something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants