2015-07-17 08:27:52 +08:00
|
|
|
KATI ?= $(HOST_OUT_EXECUTABLES)/ckati
|
|
|
|
|
|
|
|
KATI_OUTPUTS := $(PRODUCT_OUT)/build.ninja $(PRODUCT_OUT)/ninja.sh
|
|
|
|
NINJA_GOALS := fastincremental generateonly droid showcommands
|
|
|
|
|
2015-07-29 08:57:45 +08:00
|
|
|
ANDROID_TARGETS := $(filter-out $(KATI_OUTPUTS) $(NINJA_GOALS),$(ORIGINAL_MAKECMDGOALS))
|
2015-07-17 08:27:52 +08:00
|
|
|
|
|
|
|
ifeq (,$(NINJA_STATUS))
|
|
|
|
NINJA_STATUS := [%p %s/%t]$(space)
|
|
|
|
endif
|
|
|
|
|
2015-07-29 08:57:45 +08:00
|
|
|
ifneq (,$(filter showcommands,$(ORIGINAL_MAKECMDGOALS)))
|
2015-07-17 08:27:52 +08:00
|
|
|
NINJA_ARGS += "-v"
|
|
|
|
PHONY: showcommands
|
|
|
|
showcommands: droid
|
|
|
|
endif
|
|
|
|
|
2015-07-29 08:57:45 +08:00
|
|
|
ifeq (,$(filter generateonly,$(ORIGINAL_MAKECMDGOALS)))
|
2015-07-17 08:27:52 +08:00
|
|
|
fastincremental droid $(ANDROID_TARGETS): ninja.intermediate
|
|
|
|
@#empty
|
|
|
|
|
|
|
|
.INTERMEDIATE: ninja.intermediate
|
|
|
|
ninja.intermediate: $(KATI_OUTPUTS)
|
|
|
|
@echo Starting build with ninja
|
2015-07-29 08:57:45 +08:00
|
|
|
$(hide) PATH=prebuilts/ninja/$(HOST_PREBUILT_TAG)/:$$PATH NINJA_STATUS="$(NINJA_STATUS)" $(PRODUCT_OUT)/ninja.sh -C $(TOP) $(NINJA_ARGS) $(ANDROID_TARGETS)
|
2015-07-17 08:27:52 +08:00
|
|
|
else
|
|
|
|
generateonly droid $(ANDROID_TARGETS): $(KATI_OUTPUTS)
|
|
|
|
@#empty
|
|
|
|
endif
|
|
|
|
|
2015-07-29 08:57:45 +08:00
|
|
|
ifeq (,$(filter fastincremental,$(ORIGINAL_MAKECMDGOALS)))
|
2015-07-17 08:27:52 +08:00
|
|
|
KATI_FORCE := FORCE
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(KATI_OUTPUTS): kati.intermediate $(KATI_FORCE)
|
|
|
|
|
|
|
|
.INTERMEDIATE: kati.intermediate
|
|
|
|
kati.intermediate: $(KATI)
|
|
|
|
@echo Running kati to generate build.ninja...
|
|
|
|
@#TODO: use separate ninja file for mm or single target build
|
2015-07-29 08:57:45 +08:00
|
|
|
$(hide) $(KATI) --ninja --ninja_dir=$(PRODUCT_OUT) --ignore_optional_include=$(OUT_DIR)/%.P --detect_android_echo --use_find_emulator -f build/core/main.mk $(ANDROID_TARGETS) USE_NINJA=false
|
2015-07-17 08:27:52 +08:00
|
|
|
|
|
|
|
KATI_CXX := $(CLANG_CXX) $(CLANG_HOST_GLOBAL_CPPFLAGS)
|
|
|
|
KATI_LD := $(CLANG_CXX) $(CLANG_HOST_GLOBAL_LDFLAGS)
|
2015-08-04 09:15:43 +08:00
|
|
|
# Build static ckati. Unfortunately Mac OS X doesn't officially support static exectuables.
|
|
|
|
ifeq ($(BUILD_OS),linux)
|
|
|
|
KATI_LD += -static
|
|
|
|
endif
|
|
|
|
|
2015-07-17 08:27:52 +08:00
|
|
|
KATI_INTERMEDIATES_PATH := $(HOST_OUT_INTERMEDIATES)/EXECUTABLES/ckati_intermediates
|
|
|
|
KATI_BIN_PATH := $(HOST_OUT_EXECUTABLES)
|
|
|
|
include build/kati/Makefile.ckati
|
|
|
|
|
|
|
|
.PHONY: FORCE
|
|
|
|
FORCE:
|