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
This commit is contained in:
Ying Wang 2015-07-28 17:57:45 -07:00
parent d864f43932
commit bb1da5e614
4 changed files with 9 additions and 9 deletions

View file

@ -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

View file

@ -802,11 +802,9 @@ ifeq ($(strip $(SHOW_COMMANDS)),)
define pretty
@echo $1
endef
hide := @
else
define pretty
endef
hide :=
endif
###########################################################

View file

@ -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

View file

@ -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)