Commit graph

17 commits

Author SHA1 Message Date
Colin Cross
87e0e8a764 Merge "Revert "Only put PARSE_TIME_MAKE_GOALS into KATI_TARGETS"" 2015-09-23 21:53:08 +00:00
Colin Cross
84a8ca3173 Revert "Only put PARSE_TIME_MAKE_GOALS into KATI_TARGETS"
If there are any goals on the command line, kati hides targets that are
not dependencies of those goals.  Revert this until kati is modified to
include all targets.

This reverts commit b71d24931c.

Bug: 24339367
Change-Id: I7c3a950aef8efc9a0eb72bd29ee07710d2faca99
2015-09-23 21:49:27 +00:00
Colin Cross
f8579330a5 Merge "Only put PARSE_TIME_MAKE_GOALS into KATI_TARGETS" 2015-09-23 20:54:16 +00:00
Ying Wang
127da9e4aa Use md5sum as the build.ninja filename suffix if the suffix gets too long.
Use md5sum as the build.ninja filename suffix if the suffix is longer
than 64 characters. Also store the original suffix in a corresponding
.suf file for human lookup.
This fixes the "File name too long" error when kati tries to write to
build.ninja with the long original suffix.

Bug: 24302576
Change-Id: Ie04b0c14e1a9d593aa5c2a6b357b19a9e8a7158e
2015-09-22 16:16:12 -07:00
Colin Cross
b71d24931c Only put PARSE_TIME_MAKE_GOALS into KATI_TARGETS
Only goals that modify the parsing need to be passed to kati, filter out
everything else and only pass it to ninja.

Change-Id: I28788a3409d601fe838749bcf15394bc8f3d775b
2015-09-22 14:24:00 -07:00
Colin Cross
af6c071a5f Pass --ninja to makeparallel for ninja
When parallelism is being handled by ninja, pass --ninja to makeparallel
to have it translate -j with no number to default ninja parallelism, and
-k to -k0.

Bug: 24199503
Change-Id: Ic1be7572f93b33e4a71ed23e9e73dea1d4255703
2015-09-18 15:02:40 -07:00
Dan Willemsen
b384eb84c3 Merge "kati: Handle MAKECMDGOALS modifications" 2015-09-15 00:28:42 +00:00
Dan Willemsen
cb1bd116ed kati: Handle MAKECMDGOALS modifications
For some special targets (PRODUCT-%), the MAKECMDGOALS variable is
modified. Before this change, using one would result in a "no rule to
make target" error, since the new target was not stubbed out.

Change-Id: I879642a48b84a66789d4bdb7db1b6fd1130819b7
2015-09-14 16:30:51 -07:00
Colin Cross
f7ca64faa0 Use makeparallel to propagate -j flag to ninja or kati
When USE_NINJA=true is set, use makeparallel to claim all jobs from make and
pass them to ninja with -j.  If USE_GOMA is set, pass the -j flag to
kati instead so the parallelism can be set in the local_pool instead.

Change-Id: I6e4f957c65683b74533ecb6d33e25de858922823
2015-09-14 14:41:00 -07:00
Shinichiro Hamaji
d762bcae25 Use the same build.ninja for normal make targets
$(PARSE_TIME_MAKE_GOALS) is a list of known goals which affect
parsing of make (e.g., there is $(filter XXX,$(MAKECMDGOALS))).
If the make targets contain one of them, we keep using a
different build.ninja for each combination of make targets.
Otherwise, we use the same build.ninja which has all phony
targets.

Also load vendor/google/build/ninja_config.mk so it can add
Google-specific goals to $(PARSE_TIME_MAKE_GOALS).

Bug: 23685536
Change-Id: I3da5c76fa7644a05a55c374a754212f4fb794818
2015-09-09 15:48:10 +09:00
Shinichiro Hamaji
909e7f40ae Use $(BUILD_MODULES_IN_PATHS) as a part of ninja suffix
So that switching between two different mmma targets won't
need regenerating ninja files.

Change-Id: Ifddd75ec49abd3ab2a54c6afbb902b0b32359db8
2015-09-05 09:00:19 +09:00
Shinichiro Hamaji
bfd01872cb Set --ninja_suffix based on make/mm/mmm targets
This fixes two issues:

- Switching make target didn't work well when the latter
  make target is not a subset of the first make target.
- Switching between m and mm/mmm forced build.ninja to be
  regenerated.

Bug: 23685536

Change-Id: I3c3550d6cca3007d166a13367d6bc22cc3feede2
2015-09-02 07:37:39 +09:00
Shinichiro Hamaji
ee482fd521 Use goma when USE_GOMA=true is set
With USE_GOMA, the path to gomacc in $GOMA_DIR or $HOME/goma
will be appended to CC_WRAPPER and CXX_WRAPPER.

Note this works only with USE_NINJA. Unlike ninja, GNU make
cannot change the parallelism depending on targets. Specifying
-j500 to GNU make would mean you may run 500 local jobs in
parallel, but with -j32 goma will just slow down the build.

Change-Id: I0f571454fd2a5b525ee29b445f7ab8715927ca00
2015-08-20 14:33:44 +09:00
Shinichiro Hamaji
5b6b6bb974 Add two flags for the latest ckati
* --regen

Re-generate build.ninja only when necessary. If either

1. .mk file is updated,
2. environment variable is updated,
3. $(wildcard) result is changed, or
4. $(shell) result is changed,

ckati will regenerate ninja file. This check takes only ~1
second, so incremental build will become much faster even
without "fastincremental" target.

* --ignore_dirty=out/%:

Some .mk files in out/ (e.g.,
out/target/product/generic/previous_build_config.mk)
are updated while ckati is running. With this flag, ckati
does not regenerate build.ninja when they look modified.
This should be OK for ninja based build, as ninja handles
command line changes nicely.

Change-Id: I7a2fca0e327d999599d6b16f06358e8a5e657565
2015-08-17 20:20:20 +09:00
Ying Wang
0a0e6eae3f Build static ckati on Linux.
Bug: 22798670
Change-Id: I3aaf127627c1c478ab3af2549e49506d4d1f19df
2015-08-04 12:23:27 -07:00
Ying Wang
bb1da5e614 Use unmodified MAKECMDGOALS in ninja.mk.
The build system removes targets like "PRODUCT-full-eng" from
MAKECMDGOALS in build/core/product_config.mk.
Without this change, such target isn't passed to kati.

Change-Id: I0b3949ed1f5557445d7f5d5bd59b7875c0b2ea7f
2015-07-29 12:21:54 -07:00
Colin Cross
3b324cb32e Build with kati+ninja when USE_NINJA=true
If USE_NINJA=true, use kati to translate makefiles into ninja files,
and then execute them with ninja.

Builds kati from source using simplified versions of the rules
in binary.mk and definitions.mk.

Adds two new goals when USE_NINJA=true: generateonly will regenerate
build.ninja but not rebuild (useful for comparing build.ninja output
between runs), and fastincremental will skip regenerating build.ninja
and go directly to running ninja, providing ~5 second incremental
builds.

Change-Id: Ib85399e730f1fbb1be7371fafeee7d1c31080771
2015-07-23 17:29:01 -07:00