From: Colin Cross Date: Wed, 30 Sep 2015 00:11:42 +0000 (-0700) Subject: Move the dist-as-droid handling from make to ninja X-Git-Tag: android-x86-7.1-r1~608^2~19^2~97^2^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=80e46c7c5cb7b1d80114876d301798a8624b4200;p=android-x86%2Fbuild.git Move the dist-as-droid handling from make to ninja dist is a strange dual-use target, as both a flag and a goal. make dist means build , but copy any dist-for-goals files to $DIST_DIR. make dist without a target means build droid with dist-for-goals files. This requires special handling of MAKECMDGOALS to detect the case where dist is the only goal, which breaks when ninja.mk doesn't pass all the goals to kati. Instead, let ninja handle the default goal. Pass dist to kati if it is specified in order to turn on the dist-for-goal rules, but filter it out of the goals passed to ninja. If there are any other goals, ninja will build them. If there are no goals, ninja will fall back to the default goal, which is droid. Change-Id: Iafb184d28cb312cb7c5682cd3ff4f310b2d9f7e9 --- diff --git a/core/distdir.mk b/core/distdir.mk index 51ec46efe..24beddc53 100644 --- a/core/distdir.mk +++ b/core/distdir.mk @@ -22,11 +22,6 @@ dist: ; dist_goal := $(strip $(filter dist,$(MAKECMDGOALS))) MAKECMDGOALS := $(strip $(filter-out dist,$(MAKECMDGOALS))) -ifeq (,$(strip $(filter-out $(INTERNAL_MODIFIER_TARGETS),$(MAKECMDGOALS)))) -# The commandline was something like "make dist" or "make dist showcommands". -# Add a dependency on a real target. -dist: $(DEFAULT_GOAL) -endif ifdef dist_goal diff --git a/core/ninja.mk b/core/ninja.mk index 9187f23c1..ad278e607 100644 --- a/core/ninja.mk +++ b/core/ninja.mk @@ -121,7 +121,7 @@ fastincremental droid $(ANDROID_TARGETS) $(EXTRA_TARGETS): ninja.intermediate .INTERMEDIATE: ninja.intermediate ninja.intermediate: $(KATI_OUTPUTS) $(MAKEPARALLEL) @echo Starting build with ninja - +$(hide) PATH=prebuilts/ninja/$(HOST_PREBUILT_TAG)/:$$PATH NINJA_STATUS="$(NINJA_STATUS)" $(NINJA_MAKEPARALLEL) $(KATI_NINJA_SH) -C $(TOP) $(NINJA_ARGS) $(ANDROID_TARGETS) + +$(hide) PATH=prebuilts/ninja/$(HOST_PREBUILT_TAG)/:$$PATH NINJA_STATUS="$(NINJA_STATUS)" $(NINJA_MAKEPARALLEL) $(KATI_NINJA_SH) -C $(TOP) $(NINJA_ARGS) $(filter-out dist,$(ANDROID_TARGETS)) else generateonly droid $(ANDROID_TARGETS) $(EXTRA_TARGETS): $(KATI_OUTPUTS) @#empty