1ifeq ($(filter address,$(SANITIZE_HOST)),)
2NINJA ?= prebuilts/build-tools/$(HOST_PREBUILT_TAG)/bin/ninja
3else
4NINJA ?= prebuilts/build-tools/$(HOST_PREBUILT_TAG)/asan/bin/ninja
5endif
6
7KATI_OUTPUT_PATTERNS := $(OUT_DIR)/build%.ninja $(OUT_DIR)/ninja%.sh
8
9# Modifier goals we don't need to pass to Ninja.
10NINJA_EXCLUDE_GOALS := all
11
12# A list of goals which affect parsing of makefiles and we need to pass to Kati.
13PARSE_TIME_MAKE_GOALS := \
14	$(PARSE_TIME_MAKE_GOALS) \
15	$(dont_bother_goals) \
16	all \
17	ECLIPSE-% \
18	brillo_tests \
19	btnod \
20	build-art% \
21	build_kernel-nodeps \
22	clean-oat% \
23	continuous_instrumentation_tests \
24	continuous_native_tests \
25	cts \
26	custom_images \
27	dicttool_aosp \
28	dump-products \
29	eng \
30	fusion \
31	oem_image \
32	online-system-api-sdk-docs \
33	pdk \
34	platform \
35	platform-java \
36	product-graph \
37	samplecode \
38	sdk \
39	sdk_addon \
40	sdk_repo \
41	stnod \
42	target-files-package \
43	test-art% \
44	user \
45	userdataimage \
46	userdebug \
47	vts10 \
48	win_sdk \
49	winsdk-tools
50
51include $(wildcard vendor/*/build/ninja_config.mk)
52
53# Any Android goals that need to be built.
54ANDROID_GOALS := $(filter-out $(KATI_OUTPUT_PATTERNS),\
55    $(sort $(ORIGINAL_MAKECMDGOALS) $(MAKECMDGOALS)))
56# Goals we need to pass to Ninja.
57NINJA_GOALS := $(filter-out $(NINJA_EXCLUDE_GOALS), $(ANDROID_GOALS))
58ifndef NINJA_GOALS
59  NINJA_GOALS := droid
60endif
61# Goals we need to pass to Kati.
62KATI_GOALS := $(filter $(PARSE_TIME_MAKE_GOALS), $(ANDROID_GOALS))
63