From 3126def8a22a8bb0a445c05925d954322eb1fc12 Mon Sep 17 00:00:00 2001 From: Tom Marshall Date: Wed, 28 Oct 2015 11:04:01 -0700 Subject: [PATCH] build: Introduce ainfo, aerror functions envsetup.sh calls make directly to set some build vars. Any "bare" info or error messages interfere with the logic, so they must be guarded with checks for CALLED_FROM_SETUP. This is tedious and error prone, so provide an alternative that handles this logic automagically. Change-Id: I9f9a355a6ae58f2b173cffce796e37be1e68238c --- core/config.mk | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/core/config.mk b/core/config.mk index 47a1e634f..d929c2a68 100644 --- a/core/config.mk +++ b/core/config.mk @@ -3,6 +3,24 @@ # current configuration and platform, which # are not specific to what is being built. +# These may be used to trace makefile issues without interfering with +# envsetup.sh. Usage: +# $(call ainfo,some info message) +# $(call aerror,some error message) +ifdef CALLED_FROM_SETUP +define ainfo +endef +define aerror +endef +else +define ainfo +$(info $(1)) +endef +define aerror +$(error $(1)) +endef +endif + # Only use ANDROID_BUILD_SHELL to wrap around bash. # DO NOT use other shells such as zsh. ifdef ANDROID_BUILD_SHELL -- 2.11.0