| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 1 | LOCAL_PATH:= $(call my-dir) | 
|  | 2 | include $(CLEAR_VARS) | 
|  | 3 |  | 
|  | 4 | TOOLS := \ | 
|  | 5 | ls \ | 
|  | 6 | mount \ | 
|  | 7 | cat \ | 
|  | 8 | ps \ | 
|  | 9 | kill \ | 
|  | 10 | ln \ | 
|  | 11 | insmod \ | 
|  | 12 | rmmod \ | 
|  | 13 | lsmod \ | 
|  | 14 | ifconfig \ | 
|  | 15 | setconsole \ | 
|  | 16 | rm \ | 
|  | 17 | mkdir \ | 
|  | 18 | rmdir \ | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 19 | getevent \ | 
|  | 20 | sendevent \ | 
|  | 21 | date \ | 
|  | 22 | wipe \ | 
|  | 23 | sync \ | 
|  | 24 | umount \ | 
|  | 25 | start \ | 
|  | 26 | stop \ | 
|  | 27 | notify \ | 
|  | 28 | cmp \ | 
|  | 29 | dmesg \ | 
|  | 30 | route \ | 
|  | 31 | hd \ | 
|  | 32 | dd \ | 
|  | 33 | df \ | 
|  | 34 | getprop \ | 
|  | 35 | setprop \ | 
|  | 36 | watchprops \ | 
|  | 37 | log \ | 
|  | 38 | sleep \ | 
|  | 39 | renice \ | 
|  | 40 | printenv \ | 
|  | 41 | smd \ | 
|  | 42 | chmod \ | 
| Dries Harnie | 2a74373 | 2010-01-18 17:44:33 +0100 | [diff] [blame] | 43 | chown \ | 
| San Mehat | 72eead4 | 2009-07-06 11:10:03 -0700 | [diff] [blame] | 44 | newfs_msdos \ | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 45 | netstat \ | 
|  | 46 | ioctl \ | 
|  | 47 | mv \ | 
|  | 48 | schedtop \ | 
|  | 49 | top \ | 
|  | 50 | iftop \ | 
|  | 51 | id \ | 
| Mike Lockwood | a699d62 | 2010-04-09 15:27:16 -0400 | [diff] [blame] | 52 | uptime \ | 
| Arve Hjønnevåg | 7c953d0 | 2009-09-17 17:30:55 -0700 | [diff] [blame] | 53 | vmstat \ | 
| San Mehat | 10d469b | 2010-02-25 14:02:55 -0800 | [diff] [blame] | 54 | nandread \ | 
| Kenny Root | 8b9b105 | 2010-07-27 09:20:02 -0700 | [diff] [blame] | 55 | ionice \ | 
| Ken Sumrall | 795165b | 2011-04-05 20:46:30 -0700 | [diff] [blame] | 56 | touch \ | 
| Scott Anderson | d0455c9 | 2012-01-11 18:13:26 -0800 | [diff] [blame] | 57 | lsof \ | 
| Jeff Sharkey | 57df14c | 2012-07-13 16:25:33 -0700 | [diff] [blame] | 58 | du \ | 
| Michael Wright | 52abb4b | 2012-07-15 15:52:50 -0700 | [diff] [blame] | 59 | md5 \ | 
| Kenny Root | efb5e3c | 2012-10-16 18:00:29 -0700 | [diff] [blame] | 60 | clear \ | 
| Stephen Smalley | 8290d10 | 2012-01-13 08:53:56 -0500 | [diff] [blame] | 61 | getenforce \ | 
|  | 62 | setenforce \ | 
|  | 63 | chcon \ | 
|  | 64 | restorecon \ | 
|  | 65 | runcon \ | 
|  | 66 | getsebool \ | 
|  | 67 | setsebool \ | 
| Rom Lemarchand | 367297c | 2013-06-05 13:25:12 -0700 | [diff] [blame] | 68 | load_policy \ | 
|  | 69 | swapon \ | 
|  | 70 | swapoff \ | 
| Michael Wright | 9f50abd | 2013-08-19 15:56:34 -0700 | [diff] [blame] | 71 | mkswap \ | 
|  | 72 | readlink | 
| Stephen Smalley | 8290d10 | 2012-01-13 08:53:56 -0500 | [diff] [blame] | 73 |  | 
| Erik Gilling | b76f0ff | 2011-04-28 14:23:26 -0700 | [diff] [blame] | 74 | ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) | 
|  | 75 | TOOLS += r | 
|  | 76 | endif | 
|  | 77 |  | 
| Jeff Sharkey | 57df14c | 2012-07-13 16:25:33 -0700 | [diff] [blame] | 78 | ALL_TOOLS = $(TOOLS) | 
|  | 79 | ALL_TOOLS += \ | 
| Jeff Sharkey | 3e8b158 | 2012-07-13 16:37:13 -0700 | [diff] [blame] | 80 | cp \ | 
|  | 81 | grep | 
| Jeff Sharkey | 57df14c | 2012-07-13 16:25:33 -0700 | [diff] [blame] | 82 |  | 
|  | 83 | LOCAL_SRC_FILES := \ | 
| David 'Digit' Turner | a8d1afb | 2011-01-06 08:39:44 +0100 | [diff] [blame] | 84 | dynarray.c \ | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 85 | toolbox.c \ | 
| Jeff Sharkey | 57df14c | 2012-07-13 16:25:33 -0700 | [diff] [blame] | 86 | $(patsubst %,%.c,$(TOOLS)) \ | 
| Jeff Sharkey | 3e8b158 | 2012-07-13 16:37:13 -0700 | [diff] [blame] | 87 | cp/cp.c cp/utils.c \ | 
|  | 88 | grep/grep.c grep/fastgrep.c grep/file.c grep/queue.c grep/util.c | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 89 |  | 
| Scott Anderson | d0455c9 | 2012-01-11 18:13:26 -0800 | [diff] [blame] | 90 | LOCAL_C_INCLUDES := bionic/libc/bionic | 
|  | 91 |  | 
| Kenny Root | b83c098 | 2012-10-10 11:26:33 -0700 | [diff] [blame] | 92 | LOCAL_SHARED_LIBRARIES := \ | 
|  | 93 | libcutils \ | 
| Ying Wang | 083b5cc | 2013-04-09 22:03:45 -0700 | [diff] [blame] | 94 | liblog \ | 
| Kenny Root | b83c098 | 2012-10-10 11:26:33 -0700 | [diff] [blame] | 95 | libc \ | 
|  | 96 | libusbhost \ | 
|  | 97 | libselinux | 
| Stephen Smalley | 8290d10 | 2012-01-13 08:53:56 -0500 | [diff] [blame] | 98 |  | 
| Jeff Sharkey | 57df14c | 2012-07-13 16:25:33 -0700 | [diff] [blame] | 99 | LOCAL_MODULE := toolbox | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 100 |  | 
|  | 101 | # Including this will define $(intermediates). | 
|  | 102 | # | 
|  | 103 | include $(BUILD_EXECUTABLE) | 
|  | 104 |  | 
|  | 105 | $(LOCAL_PATH)/toolbox.c: $(intermediates)/tools.h | 
|  | 106 |  | 
|  | 107 | TOOLS_H := $(intermediates)/tools.h | 
| Jeff Sharkey | 57df14c | 2012-07-13 16:25:33 -0700 | [diff] [blame] | 108 | $(TOOLS_H): PRIVATE_TOOLS := $(ALL_TOOLS) | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 109 | $(TOOLS_H): PRIVATE_CUSTOM_TOOL = echo "/* file generated automatically */" > $@ ; for t in $(PRIVATE_TOOLS) ; do echo "TOOL($$t)" >> $@ ; done | 
|  | 110 | $(TOOLS_H): $(LOCAL_PATH)/Android.mk | 
|  | 111 | $(TOOLS_H): | 
|  | 112 | $(transform-generated-source) | 
|  | 113 |  | 
|  | 114 | # Make #!/system/bin/toolbox launchers for each tool. | 
|  | 115 | # | 
| Jeff Sharkey | 57df14c | 2012-07-13 16:25:33 -0700 | [diff] [blame] | 116 | SYMLINKS := $(addprefix $(TARGET_OUT)/bin/,$(ALL_TOOLS)) | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 117 | $(SYMLINKS): TOOLBOX_BINARY := $(LOCAL_MODULE) | 
|  | 118 | $(SYMLINKS): $(LOCAL_INSTALLED_MODULE) $(LOCAL_PATH)/Android.mk | 
|  | 119 | @echo "Symlink: $@ -> $(TOOLBOX_BINARY)" | 
|  | 120 | @mkdir -p $(dir $@) | 
|  | 121 | @rm -rf $@ | 
|  | 122 | $(hide) ln -sf $(TOOLBOX_BINARY) $@ | 
|  | 123 |  | 
|  | 124 | ALL_DEFAULT_INSTALLED_MODULES += $(SYMLINKS) | 
|  | 125 |  | 
|  | 126 | # We need this so that the installed files could be picked up based on the | 
|  | 127 | # local module name | 
|  | 128 | ALL_MODULES.$(LOCAL_MODULE).INSTALLED := \ | 
|  | 129 | $(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(SYMLINKS) |