From 49641ba865074a574436ac44201eca3a8afc2757 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Mon, 22 May 2017 18:08:02 -0700 Subject: [PATCH] libtoolbox_dd / grep: Android.mk -> bp Bug: 37512442 Test: links Change-Id: I98b2b463a69b065eff2bea562ce6be50f8a12341 --- toolbox/Android.bp | 44 ++++++++++++++++++++++++++++++++++++++++++++ toolbox/Android.mk | 36 ------------------------------------ 2 files changed, 44 insertions(+), 36 deletions(-) create mode 100644 toolbox/Android.bp diff --git a/toolbox/Android.bp b/toolbox/Android.bp new file mode 100644 index 000000000..1c9fb2095 --- /dev/null +++ b/toolbox/Android.bp @@ -0,0 +1,44 @@ +common_cflags = [ + "-Werror", + "-Wno-unused-parameter", + "-Wno-unused-const-variable", + "-include bsd-compatibility.h" +] + +cc_library_static { + srcs: [ + "upstream-netbsd/bin/dd/args.c", + "upstream-netbsd/bin/dd/conv.c", + "upstream-netbsd/bin/dd/dd.c", + "upstream-netbsd/bin/dd/dd_hostops.c", + "upstream-netbsd/bin/dd/misc.c", + "upstream-netbsd/bin/dd/position.c", + "upstream-netbsd/lib/libc/gen/getbsize.c", + "upstream-netbsd/lib/libc/gen/humanize_number.c", + "upstream-netbsd/lib/libc/stdlib/strsuftoll.c", + "upstream-netbsd/lib/libc/string/swab.c", + "upstream-netbsd/lib/libutil/raise_default_signal.c", + ], + cflags: common_cflags + [ + "-Dmain=dd_main", + "-DNO_CONV", + ], + local_include_dirs: ["upstream-netbsd/include/"], + name: "libtoolbox_dd", +} + +// We build BSD grep separately, so it can provide egrep and fgrep too. +cc_binary { + name: "grep", + srcs: [ + "upstream-netbsd/usr.bin/grep/fastgrep.c", + "upstream-netbsd/usr.bin/grep/file.c", + "upstream-netbsd/usr.bin/grep/grep.c", + "upstream-netbsd/usr.bin/grep/queue.c", + "upstream-netbsd/usr.bin/grep/util.c", + ], + cflags: common_cflags, + local_include_dirs: ["upstream-netbsd/include/"], + symlinks: ["egrep", "fgrep"], + +} diff --git a/toolbox/Android.mk b/toolbox/Android.mk index d6ead1a09..94029d8d2 100644 --- a/toolbox/Android.mk +++ b/toolbox/Android.mk @@ -1,30 +1,9 @@ LOCAL_PATH:= $(call my-dir) - common_cflags := \ -Werror -Wno-unused-parameter -Wno-unused-const-variable \ -include bsd-compatibility.h \ - -include $(CLEAR_VARS) -LOCAL_SRC_FILES := \ - upstream-netbsd/bin/dd/args.c \ - upstream-netbsd/bin/dd/conv.c \ - upstream-netbsd/bin/dd/dd.c \ - upstream-netbsd/bin/dd/dd_hostops.c \ - upstream-netbsd/bin/dd/misc.c \ - upstream-netbsd/bin/dd/position.c \ - upstream-netbsd/lib/libc/gen/getbsize.c \ - upstream-netbsd/lib/libc/gen/humanize_number.c \ - upstream-netbsd/lib/libc/stdlib/strsuftoll.c \ - upstream-netbsd/lib/libc/string/swab.c \ - upstream-netbsd/lib/libutil/raise_default_signal.c -LOCAL_CFLAGS += $(common_cflags) -Dmain=dd_main -DNO_CONV -LOCAL_C_INCLUDES += $(LOCAL_PATH)/upstream-netbsd/include/ -LOCAL_MODULE := libtoolbox_dd -include $(BUILD_STATIC_LIBRARY) - - include $(CLEAR_VARS) BSD_TOOLS := \ @@ -80,18 +59,3 @@ $(INPUT_H_LABELS_H): PRIVATE_CUSTOM_TOOL = $(PRIVATE_LOCAL_PATH)/generate-input. $(INPUT_H_LABELS_H): $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/generate-input.h-labels.py $(UAPI_INPUT_EVENT_CODES_H) $(INPUT_H_LABELS_H): $(transform-generated-source) - - -# We build BSD grep separately, so it can provide egrep and fgrep too. -include $(CLEAR_VARS) -LOCAL_SRC_FILES := \ - upstream-netbsd/usr.bin/grep/fastgrep.c \ - upstream-netbsd/usr.bin/grep/file.c \ - upstream-netbsd/usr.bin/grep/grep.c \ - upstream-netbsd/usr.bin/grep/queue.c \ - upstream-netbsd/usr.bin/grep/util.c -LOCAL_CFLAGS += $(common_cflags) -LOCAL_C_INCLUDES += $(LOCAL_PATH)/upstream-netbsd/include/ -LOCAL_MODULE := grep -LOCAL_POST_INSTALL_CMD := $(hide) $(foreach t,egrep fgrep,ln -sf grep $(TARGET_OUT)/bin/$(t);) -include $(BUILD_EXECUTABLE)