[C++] Add .KATI_RESTAT builtin target

This is an experimental kati-specific expansion for GNU make.
Targets specified by this will have "restat = 1" in generated
ninja files.

Even with this change, kati should be still compatible with
GNU make. GNU make will ignore this but this only means GNU
make will do some extra unnecessary builds. This different
should not change the final output as long as .KATI_RESTAT is
used appropriately.

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