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