From 2d12ce1d88d8c956fe469a06297175642f345ee1 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Thu, 10 Mar 2016 15:03:41 -0800 Subject: [PATCH] Always run Soong Without switching on USE_SOONG, this lets us verify that all builds have blueprint/soong/go, and can generate a build.ninja file without producing errors. Change-Id: I79451ce24c8b5b6745e41d951153265441c33e8a --- core/ninja.mk | 6 ++---- core/soong.mk | 13 ++++++++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/core/ninja.mk b/core/ninja.mk index afdef7e69..c31ae4eda 100644 --- a/core/ninja.mk +++ b/core/ninja.mk @@ -1,8 +1,6 @@ NINJA ?= prebuilts/ninja/$(HOST_PREBUILT_TAG)/ninja -ifeq ($(USE_SOONG),true) include $(BUILD_SYSTEM)/soong.mk -endif KATI_OUTPUT_PATTERNS := $(OUT_DIR)/build%.ninja $(OUT_DIR)/ninja%.sh @@ -128,7 +126,7 @@ endif ifeq ($(USE_SOONG),true) COMBINED_BUILD_NINJA := $(OUT_DIR)/combined$(KATI_NINJA_SUFFIX).ninja -$(COMBINED_BUILD_NINJA): $(KATI_BUILD_NINJA) $(SOONG_ANDROID_MK) +$(COMBINED_BUILD_NINJA): $(KATI_BUILD_NINJA) $(hide) echo "builddir = $(OUT_DIR)" > $(COMBINED_BUILD_NINJA) $(hide) echo "subninja $(SOONG_BUILD_NINJA)" >> $(COMBINED_BUILD_NINJA) $(hide) echo "subninja $(KATI_BUILD_NINJA)" >> $(COMBINED_BUILD_NINJA) @@ -148,7 +146,7 @@ KATI_FIND_EMULATOR := --use_find_emulator ifeq ($(KATI_EMULATE_FIND),false) KATI_FIND_EMULATOR := endif -$(KATI_BUILD_NINJA): $(CKATI) $(MAKEPARALLEL) $(SOONG_ANDROID_MK) FORCE +$(KATI_BUILD_NINJA): $(CKATI) $(MAKEPARALLEL) run_soong FORCE @echo Running kati to generate build$(KATI_NINJA_SUFFIX).ninja... +$(hide) $(KATI_MAKEPARALLEL) $(CKATI) --ninja --ninja_dir=$(OUT_DIR) --ninja_suffix=$(KATI_NINJA_SUFFIX) --regen --ignore_dirty=$(OUT_DIR)/% --no_ignore_dirty=$(SOONG_ANDROID_MK) --ignore_optional_include=$(OUT_DIR)/%.P --detect_android_echo $(KATI_FIND_EMULATOR) -f build/core/main.mk $(KATI_GOALS) --gen_all_targets BUILDING_WITH_NINJA=true SOONG_ANDROID_MK=$(SOONG_ANDROID_MK) diff --git a/core/soong.mk b/core/soong.mk index e070d6bdf..e3ce46e9d 100644 --- a/core/soong.mk +++ b/core/soong.mk @@ -16,10 +16,15 @@ endif SOONG := $(SOONG_OUT_DIR)/soong SOONG_BUILD_NINJA := $(SOONG_OUT_DIR)/build.ninja -SOONG_ANDROID_MK := $(SOONG_OUT_DIR)/Android.mk SOONG_VARIABLES := $(SOONG_OUT_DIR)/soong.variables SOONG_IN_MAKE := $(SOONG_OUT_DIR)/.soong.in_make +# Only include the Soong-generated Android.mk if we're merging the +# Soong-defined binaries with Kati-defined binaries. +ifeq ($(USE_SOONG),true) +SOONG_ANDROID_MK := $(SOONG_OUT_DIR)/Android.mk +endif + # Bootstrap soong. Run only the first time for clean builds $(SOONG): $(hide) mkdir -p $(dir $@) @@ -67,6 +72,8 @@ $(SOONG_IN_MAKE): $(hide) mkdir -p $(dir $@) $(hide) touch $@ -# Build an Android.mk listing all soong outputs as prebuilts -$(SOONG_ANDROID_MK): $(SOONG) $(SOONG_VARIABLES) $(SOONG_IN_MAKE) FORCE +# Run Soong, this implicitly create an Android.mk listing all soong outputs as +# prebuilts. +.PHONY: run_soong +run_soong: $(SOONG) $(SOONG_VARIABLES) $(SOONG_IN_MAKE) FORCE $(hide) $(SOONG) $(SOONG_BUILD_NINJA) $(NINJA_ARGS)