From 660e750b122b546760ade1a792248fc1d2c09b1b Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 28 Aug 2014 20:44:20 -0700 Subject: [PATCH] Build the optional 'r' tool separately. You can't use $(TARGET_BUILD_VARIANT) to change how a module is built like this makefile used to. Change-Id: Ie6a274cab9a77eb2376a9494e9c17aae8ba0ee0b Signed-off-by: Olivier Fourdan Signed-off-by: Guilhem IMBERTON --- toolbox/Android.mk | 14 ++++++++++---- toolbox/r.c | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/toolbox/Android.mk b/toolbox/Android.mk index 734404079..3304e2aca 100644 --- a/toolbox/Android.mk +++ b/toolbox/Android.mk @@ -213,10 +213,6 @@ OUR_TOOLS := \ watchprops \ wipe \ -ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) -OUR_TOOLS += r -endif - ALL_TOOLS = $(BSD_TOOLS) $(OUR_TOOLS) LOCAL_SRC_FILES := \ @@ -277,3 +273,13 @@ ALL_DEFAULT_INSTALLED_MODULES += $(SYMLINKS) # local module name ALL_MODULES.$(LOCAL_MODULE).INSTALLED := \ $(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(SYMLINKS) + + +# We only want 'r' on userdebug and eng builds. +include $(CLEAR_VARS) +LOCAL_SRC_FILES := r.c +LOCAL_CFLAGS += $(common_cflags) +LOCAL_MODULE := r +LOCAL_MODULE_TAGS := debug +LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk +include $(BUILD_EXECUTABLE) diff --git a/toolbox/r.c b/toolbox/r.c index 3b80db778..618367726 100644 --- a/toolbox/r.c +++ b/toolbox/r.c @@ -18,7 +18,7 @@ static int usage() return -1; } -int r_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { if(argc < 2) return usage();