Allow building Kati with Soong for Android

Currently, Android sets some cflags and uses make to build kati. This
still uses some of the system headers and libraries instead of the
hermetic ones in the tree. Kati and makeparallel are the two remaining
binaries being built outside of ninja.

In order to fix all of these, define an Android.bp file for Soong, then
when enabled, Android will ask Soong to build kati instead of including
Makefile.ckati.

And I'm hardcoding the version to unknown for now, Soong's genrule is
not yet flexible enough to handle the optional dependency.
3 files changed
tree: 5a135e9d3fcb49cc6167334dfe91ea2a33cda2e4
  1. cmd/
  2. make-c/
  3. testcase/
  4. .gitignore
  5. .travis.yml
  6. Android.bp
  7. ast.go
  8. AUTHORS
  9. bootstrap.go
  10. buf.go
  11. buf_test.go
  12. command.cc
  13. command.h
  14. CONTRIBUTING.md
  15. CONTRIBUTORS
  16. dep.cc
  17. dep.go
  18. dep.h
  19. depgraph.go
  20. doc.go
  21. eval.cc
  22. eval.go
  23. eval.h
  24. evalcmd.go
  25. exec.cc
  26. exec.go
  27. exec.h
  28. expr.cc
  29. expr.go
  30. expr.h
  31. expr_test.go
  32. file.cc
  33. file.h
  34. file_cache.cc
  35. file_cache.h
  36. fileutil.cc
  37. fileutil.go
  38. fileutil.h
  39. find.cc
  40. find.h
  41. find_test.cc
  42. flags.cc
  43. flags.go
  44. flags.h
  45. func.cc
  46. func.go
  47. func.h
  48. func_test.go
  49. INTERNALS.md
  50. io.cc
  51. io.h
  52. LICENSE
  53. loc.h
  54. log.cc
  55. log.go
  56. log.h
  57. m2n
  58. main.cc
  59. make-c.sh
  60. Makefile
  61. Makefile.ckati
  62. Makefile.kati
  63. ninja.cc
  64. ninja.go
  65. ninja.h
  66. ninja_test.cc
  67. ninja_test.go
  68. pack.sh
  69. parser.cc
  70. parser.go
  71. parser.h
  72. pathutil.go
  73. pathutil_test.go
  74. query.go
  75. README.md
  76. rule.cc
  77. rule.h
  78. rule_parser.go
  79. rule_parser_test.go
  80. run_integration_test.rb
  81. runtest.rb
  82. serialize.go
  83. shellutil.go
  84. shellutil_test.go
  85. stats.cc
  86. stats.go
  87. stats.h
  88. stmt.cc
  89. stmt.h
  90. string_piece.cc
  91. string_piece.h
  92. string_piece_test.cc
  93. stringprintf.cc
  94. stringprintf.h
  95. strutil.cc
  96. strutil.go
  97. strutil.h
  98. strutil_test.cc
  99. strutil_test.go
  100. symtab.cc
  101. symtab.go
  102. symtab.h
  103. testutil.h
  104. timeutil.cc
  105. timeutil.h
  106. var.cc
  107. var.go
  108. var.h
  109. version.go
  110. version.h
  111. version_unknown.cc
  112. worker.go
README.md

kati

Build Status

kati is an experimental GNU make clone. The main goal of this tool is to speed-up incremental build of Android.

Currently, kati does not offer a faster build by itself. It instead converts your Makefile to a ninja file.

How to use for Android

Now AOSP has kati and ninja, so all you have to do is

% export USE_NINJA=true

All Android's build commands (m, mmm, mmma, etc.) should just work.

How to use for Android (deprecated way)

Set up kati:

% cd ~/src
% git clone https://github.com/google/kati
% cd kati
% make

Build Android:

% cd <android-directory>
% source build/envsetup.sh
% lunch <your-choice>
% ~/src/kati/m2n --kati_stats  # Use --goma if you are a Googler.
% ./ninja.sh

You need ninja in your $PATH.

More usage examples (deprecated way)

"make clean"

% ./ninja.sh -t clean

Note ./ninja.sh passes all parameters to ninja.

Build a specific target

For example, the following is equivalent to "make cts":

% ./ninja.sh cts

Or, if you know the path you want, you can do:

% ./ninja.sh out/host/linux-x86/bin/adb