From 909e7f40ae6a80c589ca0d03ccd4d2ea1044ccdb Mon Sep 17 00:00:00 2001 From: Shinichiro Hamaji Date: Fri, 4 Sep 2015 11:41:33 +0900 Subject: [PATCH] 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 --- core/ninja.mk | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/core/ninja.mk b/core/ninja.mk index 33b32f091..492549355 100644 --- a/core/ninja.mk +++ b/core/ninja.mk @@ -5,12 +5,19 @@ NINJA_GOALS := fastincremental generateonly droid showcommands ANDROID_TARGETS := $(filter-out $(KATI_OUTPUT_PATTERNS) $(NINJA_GOALS),$(ORIGINAL_MAKECMDGOALS)) +define replace_space_and_slash +$(subst /,_,$(subst $(space),_,$(sort $1))) +endef + KATI_NINJA_SUFFIX := ifneq ($(ANDROID_TARGETS),) -KATI_NINJA_SUFFIX := $(KATI_NINJA_SUFFIX)-$(subst $(space),_,$(sort $(ANDROID_TARGETS))) +KATI_NINJA_SUFFIX := $(KATI_NINJA_SUFFIX)-$(call replace_space_and_slash,$(ANDROID_TARGETS)) endif ifneq ($(ONE_SHOT_MAKEFILE),) -KATI_NINJA_SUFFIX := $(KATI_NINJA_SUFFIX)-mmm-$(subst /,_,$(strip $(ONE_SHOT_MAKEFILE))) +KATI_NINJA_SUFFIX := $(KATI_NINJA_SUFFIX)-mmm-$(call replace_space_and_slash,$(ONE_SHOT_MAKEFILE)) +endif +ifneq ($(BUILD_MODULES_IN_PATHS),) +KATI_NINJA_SUFFIX := $(KATI_NINJA_SUFFIX)-mmma-$(call replace_space_and_slash,$(BUILD_MODULES_IN_PATHS)) endif KATI_BUILD_NINJA := $(PRODUCT_OUT)/build$(KATI_NINJA_SUFFIX).ninja