From bb1da5e614a26fb9d973c88db2c56a1f294f332d Mon Sep 17 00:00:00 2001 From: Ying Wang Date: Tue, 28 Jul 2015 17:57:45 -0700 Subject: [PATCH] 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 --- core/config.mk | 2 +- core/definitions.mk | 2 -- core/main.mk | 2 ++ core/ninja.mk | 12 ++++++------ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/config.mk b/core/config.mk index 7a90a0ef60..882ab0c31c 100644 --- a/core/config.mk +++ b/core/config.mk @@ -104,7 +104,7 @@ BUILD_HOST_DALVIK_STATIC_JAVA_LIBRARY := $(BUILD_SYSTEM)/host_dalvik_static_java # lines being executed, instead of a short message about # the kind of operation being done. SHOW_COMMANDS:= $(filter showcommands,$(MAKECMDGOALS)) - +hide := $(if $(SHOW_COMMANDS),,@) # ############################################################### # Set common values diff --git a/core/definitions.mk b/core/definitions.mk index 80c6b4aac3..f688f41123 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -802,11 +802,9 @@ ifeq ($(strip $(SHOW_COMMANDS)),) define pretty @echo $1 endef -hide := @ else define pretty endef -hide := endif ########################################################### diff --git a/core/main.mk b/core/main.mk index 38fe994558..b290ce1a95 100644 --- a/core/main.mk +++ b/core/main.mk @@ -86,6 +86,8 @@ ifneq ($(filter $(dont_bother_goals), $(MAKECMDGOALS)),) dont_bother := true endif +ORIGINAL_MAKECMDGOALS := $(MAKECMDGOALS) + # Targets that provide quick help on the build system. include $(BUILD_SYSTEM)/help.mk diff --git a/core/ninja.mk b/core/ninja.mk index 05498d8bed..e68ae12f85 100644 --- a/core/ninja.mk +++ b/core/ninja.mk @@ -3,32 +3,32 @@ KATI ?= $(HOST_OUT_EXECUTABLES)/ckati KATI_OUTPUTS := $(PRODUCT_OUT)/build.ninja $(PRODUCT_OUT)/ninja.sh NINJA_GOALS := fastincremental generateonly droid showcommands -ANDROID_TARGETS := $(filter-out $(KATI_OUTPUTS) $(NINJA_GOALS),$(MAKECMDGOALS)) +ANDROID_TARGETS := $(filter-out $(KATI_OUTPUTS) $(NINJA_GOALS),$(ORIGINAL_MAKECMDGOALS)) ifeq (,$(NINJA_STATUS)) NINJA_STATUS := [%p %s/%t]$(space) endif -ifneq (,$(filter showcommands,$(MAKECMDGOALS))) +ifneq (,$(filter showcommands,$(ORIGINAL_MAKECMDGOALS))) NINJA_ARGS += "-v" PHONY: showcommands showcommands: droid endif -ifeq (,$(filter generateonly,$(MAKECMDGOALS))) +ifeq (,$(filter generateonly,$(ORIGINAL_MAKECMDGOALS))) fastincremental droid $(ANDROID_TARGETS): ninja.intermediate @#empty .INTERMEDIATE: ninja.intermediate ninja.intermediate: $(KATI_OUTPUTS) @echo Starting build with ninja - @PATH=prebuilts/ninja/$(HOST_PREBUILT_TAG)/:$$PATH NINJA_STATUS="$(NINJA_STATUS)" $(PRODUCT_OUT)/ninja.sh -C $(TOP) $(NINJA_ARGS) $(ANDROID_TARGETS) + $(hide) PATH=prebuilts/ninja/$(HOST_PREBUILT_TAG)/:$$PATH NINJA_STATUS="$(NINJA_STATUS)" $(PRODUCT_OUT)/ninja.sh -C $(TOP) $(NINJA_ARGS) $(ANDROID_TARGETS) else generateonly droid $(ANDROID_TARGETS): $(KATI_OUTPUTS) @#empty endif -ifeq (,$(filter fastincremental,$(MAKECMDGOALS))) +ifeq (,$(filter fastincremental,$(ORIGINAL_MAKECMDGOALS))) KATI_FORCE := FORCE endif @@ -38,7 +38,7 @@ $(KATI_OUTPUTS): kati.intermediate $(KATI_FORCE) kati.intermediate: $(KATI) @echo Running kati to generate build.ninja... @#TODO: use separate ninja file for mm or single target build - @$(KATI) --ninja --ninja_dir=$(PRODUCT_OUT) --ignore_optional_include=out/%.P --detect_android_echo --use_find_emulator -f build/core/main.mk $(ANDROID_TARGETS) USE_NINJA=false + $(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 KATI_CXX := $(CLANG_CXX) $(CLANG_HOST_GLOBAL_CPPFLAGS) KATI_LD := $(CLANG_CXX) $(CLANG_HOST_GLOBAL_LDFLAGS)