2009-03-04 04:32:55 +01:00
|
|
|
LOCAL_PATH:= $(call my-dir)
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
TOOLS := \
|
|
|
|
ls \
|
|
|
|
mount \
|
|
|
|
cat \
|
|
|
|
ps \
|
|
|
|
kill \
|
|
|
|
ln \
|
|
|
|
insmod \
|
|
|
|
rmmod \
|
|
|
|
lsmod \
|
|
|
|
ifconfig \
|
|
|
|
setconsole \
|
|
|
|
rm \
|
|
|
|
mkdir \
|
|
|
|
rmdir \
|
|
|
|
reboot \
|
|
|
|
getevent \
|
|
|
|
sendevent \
|
|
|
|
date \
|
|
|
|
wipe \
|
|
|
|
sync \
|
|
|
|
umount \
|
|
|
|
start \
|
|
|
|
stop \
|
|
|
|
notify \
|
|
|
|
cmp \
|
|
|
|
dmesg \
|
|
|
|
route \
|
|
|
|
hd \
|
|
|
|
dd \
|
|
|
|
df \
|
|
|
|
getprop \
|
|
|
|
setprop \
|
|
|
|
watchprops \
|
|
|
|
log \
|
|
|
|
sleep \
|
|
|
|
renice \
|
|
|
|
printenv \
|
|
|
|
smd \
|
|
|
|
chmod \
|
2010-01-18 17:44:33 +01:00
|
|
|
chown \
|
2009-07-06 20:10:03 +02:00
|
|
|
newfs_msdos \
|
2009-03-04 04:32:55 +01:00
|
|
|
netstat \
|
|
|
|
ioctl \
|
|
|
|
mv \
|
|
|
|
schedtop \
|
|
|
|
top \
|
|
|
|
iftop \
|
|
|
|
id \
|
2010-04-09 21:27:16 +02:00
|
|
|
uptime \
|
2009-09-18 02:30:55 +02:00
|
|
|
vmstat \
|
2010-02-25 23:02:55 +01:00
|
|
|
nandread \
|
2010-07-27 18:20:02 +02:00
|
|
|
ionice \
|
|
|
|
lsof
|
2009-03-04 04:32:55 +01:00
|
|
|
|
|
|
|
LOCAL_SRC_FILES:= \
|
|
|
|
toolbox.c \
|
|
|
|
$(patsubst %,%.c,$(TOOLS))
|
|
|
|
|
|
|
|
LOCAL_SHARED_LIBRARIES := libcutils libc
|
|
|
|
|
2010-12-09 23:52:53 +01:00
|
|
|
# Needed for lsusb. Should optimize out in linker if lsusb is not included
|
|
|
|
LOCAL_STATIC_LIBRARIES := libusbhost
|
|
|
|
|
2009-03-04 04:32:55 +01:00
|
|
|
LOCAL_MODULE:= toolbox
|
|
|
|
|
|
|
|
# Including this will define $(intermediates).
|
|
|
|
#
|
|
|
|
include $(BUILD_EXECUTABLE)
|
|
|
|
|
|
|
|
$(LOCAL_PATH)/toolbox.c: $(intermediates)/tools.h
|
|
|
|
|
|
|
|
TOOLS_H := $(intermediates)/tools.h
|
|
|
|
$(TOOLS_H): PRIVATE_TOOLS := $(TOOLS)
|
|
|
|
$(TOOLS_H): PRIVATE_CUSTOM_TOOL = echo "/* file generated automatically */" > $@ ; for t in $(PRIVATE_TOOLS) ; do echo "TOOL($$t)" >> $@ ; done
|
|
|
|
$(TOOLS_H): $(LOCAL_PATH)/Android.mk
|
|
|
|
$(TOOLS_H):
|
|
|
|
$(transform-generated-source)
|
|
|
|
|
|
|
|
# Make #!/system/bin/toolbox launchers for each tool.
|
|
|
|
#
|
|
|
|
SYMLINKS := $(addprefix $(TARGET_OUT)/bin/,$(TOOLS))
|
|
|
|
$(SYMLINKS): TOOLBOX_BINARY := $(LOCAL_MODULE)
|
|
|
|
$(SYMLINKS): $(LOCAL_INSTALLED_MODULE) $(LOCAL_PATH)/Android.mk
|
|
|
|
@echo "Symlink: $@ -> $(TOOLBOX_BINARY)"
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
@rm -rf $@
|
|
|
|
$(hide) ln -sf $(TOOLBOX_BINARY) $@
|
|
|
|
|
|
|
|
ALL_DEFAULT_INSTALLED_MODULES += $(SYMLINKS)
|
|
|
|
|
|
|
|
# We need this so that the installed files could be picked up based on the
|
|
|
|
# local module name
|
|
|
|
ALL_MODULES.$(LOCAL_MODULE).INSTALLED := \
|
|
|
|
$(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(SYMLINKS)
|