2009-03-04 11:32:55 +08:00
|
|
|
LOCAL_PATH:= $(call my-dir)
|
2014-07-23 01:46:15 +08:00
|
|
|
|
2014-07-23 08:20:15 +08:00
|
|
|
|
2014-07-23 01:46:15 +08:00
|
|
|
common_cflags := \
|
|
|
|
-std=gnu99 \
|
|
|
|
-Werror -Wno-unused-parameter \
|
2014-07-23 08:20:15 +08:00
|
|
|
-I$(LOCAL_PATH)/upstream-netbsd/include/ \
|
2014-07-23 01:46:15 +08:00
|
|
|
-include bsd-compatibility.h \
|
|
|
|
|
2014-12-05 10:01:26 +08:00
|
|
|
# Temporary, remove after cleanup. b/18632512
|
|
|
|
common_cflags += -Wno-unused-variable \
|
|
|
|
-Wno-unused-but-set-variable
|
|
|
|
|
2014-07-23 08:20:15 +08:00
|
|
|
|
|
|
|
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
|
|
|
|
LOCAL_CFLAGS += $(common_cflags) -Dmain=dd_main -DNO_CONV
|
|
|
|
LOCAL_MODULE := libtoolbox_dd
|
|
|
|
LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk
|
|
|
|
include $(BUILD_STATIC_LIBRARY)
|
|
|
|
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
LOCAL_SRC_FILES := upstream-netbsd/usr.bin/du/du.c
|
|
|
|
LOCAL_CFLAGS += $(common_cflags) -Dmain=du_main
|
|
|
|
LOCAL_MODULE := libtoolbox_du
|
|
|
|
LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk
|
|
|
|
include $(BUILD_STATIC_LIBRARY)
|
|
|
|
|
|
|
|
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) -Dmain=grep_main
|
|
|
|
LOCAL_MODULE := libtoolbox_grep
|
|
|
|
LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk
|
|
|
|
include $(BUILD_STATIC_LIBRARY)
|
|
|
|
|
|
|
|
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
BSD_TOOLS := \
|
|
|
|
dd \
|
|
|
|
du \
|
|
|
|
grep \
|
2009-03-04 11:32:55 +08:00
|
|
|
|
2014-07-23 08:20:15 +08:00
|
|
|
OUR_TOOLS := \
|
|
|
|
df \
|
|
|
|
getevent \
|
|
|
|
getprop \
|
|
|
|
getsebool \
|
|
|
|
iftop \
|
|
|
|
ioctl \
|
|
|
|
ionice \
|
|
|
|
load_policy \
|
|
|
|
log \
|
|
|
|
ls \
|
|
|
|
lsof \
|
|
|
|
mount \
|
|
|
|
nandread \
|
|
|
|
newfs_msdos \
|
|
|
|
ps \
|
|
|
|
renice \
|
|
|
|
restorecon \
|
|
|
|
route \
|
|
|
|
runcon \
|
|
|
|
schedtop \
|
|
|
|
sendevent \
|
|
|
|
setprop \
|
|
|
|
setsebool \
|
|
|
|
smd \
|
|
|
|
start \
|
|
|
|
stop \
|
|
|
|
top \
|
|
|
|
touch \
|
|
|
|
umount \
|
|
|
|
uptime \
|
|
|
|
watchprops \
|
|
|
|
wipe \
|
2012-01-13 21:53:56 +08:00
|
|
|
|
2014-07-23 08:20:15 +08:00
|
|
|
ALL_TOOLS = $(BSD_TOOLS) $(OUR_TOOLS)
|
2012-07-14 07:25:33 +08:00
|
|
|
|
|
|
|
LOCAL_SRC_FILES := \
|
2014-07-23 08:20:15 +08:00
|
|
|
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 \
|
|
|
|
dynarray.c \
|
|
|
|
$(patsubst %,%.c,$(OUR_TOOLS)) \
|
|
|
|
toolbox.c \
|
2009-03-04 11:32:55 +08:00
|
|
|
|
2014-07-23 01:46:15 +08:00
|
|
|
LOCAL_CFLAGS += $(common_cflags)
|
2014-01-17 02:53:11 +08:00
|
|
|
|
2012-10-11 02:26:33 +08:00
|
|
|
LOCAL_SHARED_LIBRARIES := \
|
2014-06-08 12:53:04 +08:00
|
|
|
libcutils \
|
|
|
|
libselinux \
|
|
|
|
|
2014-07-23 08:20:15 +08:00
|
|
|
LOCAL_WHOLE_STATIC_LIBRARIES := $(patsubst %,libtoolbox_%,$(BSD_TOOLS))
|
2014-07-23 01:46:15 +08:00
|
|
|
|
2012-07-14 07:25:33 +08:00
|
|
|
LOCAL_MODULE := toolbox
|
2014-06-08 12:53:04 +08:00
|
|
|
LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk
|
2009-03-04 11:32:55 +08:00
|
|
|
|
2014-11-25 04:40:32 +08:00
|
|
|
# Install the symlinks.
|
|
|
|
LOCAL_POST_INSTALL_CMD := $(hide) $(foreach t,$(ALL_TOOLS),ln -sf toolbox $(TARGET_OUT)/bin/$(t);)
|
|
|
|
|
2009-03-04 11:32:55 +08:00
|
|
|
# Including this will define $(intermediates).
|
|
|
|
#
|
|
|
|
include $(BUILD_EXECUTABLE)
|
|
|
|
|
|
|
|
$(LOCAL_PATH)/toolbox.c: $(intermediates)/tools.h
|
|
|
|
|
|
|
|
TOOLS_H := $(intermediates)/tools.h
|
2012-07-14 07:25:33 +08:00
|
|
|
$(TOOLS_H): PRIVATE_TOOLS := $(ALL_TOOLS)
|
2009-03-04 11:32:55 +08:00
|
|
|
$(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)
|
|
|
|
|
2014-08-29 11:44:20 +08:00
|
|
|
|
|
|
|
# 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)
|