2009-03-04 04:32:55 +01:00
|
|
|
LOCAL_PATH:= $(call my-dir)
|
2014-07-22 19:46:15 +02:00
|
|
|
|
2014-07-23 02:20:15 +02:00
|
|
|
|
2014-07-22 19:46:15 +02:00
|
|
|
common_cflags := \
|
2015-07-30 20:46:30 +02:00
|
|
|
-Werror -Wno-unused-parameter -Wno-unused-const-variable \
|
2014-07-23 02:20:15 +02:00
|
|
|
-I$(LOCAL_PATH)/upstream-netbsd/include/ \
|
2014-07-22 19:46:15 +02:00
|
|
|
-include bsd-compatibility.h \
|
|
|
|
|
2014-07-23 02:20:15 +02: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 \
|
2015-02-05 03:50:14 +01:00
|
|
|
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
|
2014-07-23 02:20:15 +02:00
|
|
|
LOCAL_CFLAGS += $(common_cflags) -Dmain=dd_main -DNO_CONV
|
|
|
|
LOCAL_MODULE := libtoolbox_dd
|
|
|
|
include $(BUILD_STATIC_LIBRARY)
|
|
|
|
|
|
|
|
|
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
BSD_TOOLS := \
|
|
|
|
dd \
|
2009-03-04 04:32:55 +01:00
|
|
|
|
2014-07-23 02:20:15 +02:00
|
|
|
OUR_TOOLS := \
|
|
|
|
df \
|
|
|
|
getevent \
|
|
|
|
iftop \
|
|
|
|
ioctl \
|
|
|
|
log \
|
|
|
|
nandread \
|
|
|
|
newfs_msdos \
|
|
|
|
ps \
|
2014-11-25 20:00:41 +01:00
|
|
|
prlimit \
|
2014-07-23 02:20:15 +02:00
|
|
|
sendevent \
|
|
|
|
start \
|
|
|
|
stop \
|
|
|
|
top \
|
2012-01-13 14:53:56 +01:00
|
|
|
|
2014-07-23 02:20:15 +02:00
|
|
|
ALL_TOOLS = $(BSD_TOOLS) $(OUR_TOOLS)
|
2012-07-14 01:25:33 +02:00
|
|
|
|
|
|
|
LOCAL_SRC_FILES := \
|
2015-06-06 01:43:23 +02:00
|
|
|
start_stop.cpp \
|
2014-07-23 02:20:15 +02:00
|
|
|
toolbox.c \
|
2015-02-05 03:50:14 +01:00
|
|
|
$(patsubst %,%.c,$(OUR_TOOLS)) \
|
2009-03-04 04:32:55 +01:00
|
|
|
|
2014-07-22 19:46:15 +02:00
|
|
|
LOCAL_CFLAGS += $(common_cflags)
|
2015-06-06 01:43:23 +02:00
|
|
|
LOCAL_CONLYFLAGS += -std=gnu99
|
2014-01-16 19:53:11 +01:00
|
|
|
|
2012-10-10 20:26:33 +02:00
|
|
|
LOCAL_SHARED_LIBRARIES := \
|
2014-06-08 06:53:04 +02:00
|
|
|
libcutils \
|
|
|
|
libselinux \
|
|
|
|
|
2014-07-23 02:20:15 +02:00
|
|
|
LOCAL_WHOLE_STATIC_LIBRARIES := $(patsubst %,libtoolbox_%,$(BSD_TOOLS))
|
2014-07-22 19:46:15 +02:00
|
|
|
|
2012-07-14 01:25:33 +02:00
|
|
|
LOCAL_MODULE := toolbox
|
2009-03-04 04:32:55 +01:00
|
|
|
|
2014-11-24 21:40:32 +01:00
|
|
|
# Install the symlinks.
|
|
|
|
LOCAL_POST_INSTALL_CMD := $(hide) $(foreach t,$(ALL_TOOLS),ln -sf toolbox $(TARGET_OUT)/bin/$(t);)
|
|
|
|
|
2009-03-04 04:32:55 +01:00
|
|
|
# Including this will define $(intermediates).
|
|
|
|
#
|
|
|
|
include $(BUILD_EXECUTABLE)
|
|
|
|
|
|
|
|
$(LOCAL_PATH)/toolbox.c: $(intermediates)/tools.h
|
|
|
|
|
|
|
|
TOOLS_H := $(intermediates)/tools.h
|
2012-07-14 01:25:33 +02:00
|
|
|
$(TOOLS_H): PRIVATE_TOOLS := $(ALL_TOOLS)
|
2009-03-04 04:32:55 +01: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)
|
|
|
|
|
2015-03-26 00:40:13 +01:00
|
|
|
$(LOCAL_PATH)/getevent.c: $(intermediates)/input.h-labels.h
|
|
|
|
|
|
|
|
INPUT_H_LABELS_H := $(intermediates)/input.h-labels.h
|
|
|
|
$(INPUT_H_LABELS_H): PRIVATE_LOCAL_PATH := $(LOCAL_PATH)
|
|
|
|
$(INPUT_H_LABELS_H): PRIVATE_CUSTOM_TOOL = $(PRIVATE_LOCAL_PATH)/generate-input.h-labels.py > $@
|
|
|
|
$(INPUT_H_LABELS_H): $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/generate-input.h-labels.py
|
|
|
|
$(INPUT_H_LABELS_H):
|
|
|
|
$(transform-generated-source)
|
2014-08-29 05:44:20 +02: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
|
|
|
|
include $(BUILD_EXECUTABLE)
|
2015-02-05 03:50:14 +01:00
|
|
|
|
|
|
|
|
|
|
|
# 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_MODULE := grep
|
|
|
|
LOCAL_POST_INSTALL_CMD := $(hide) $(foreach t,egrep fgrep,ln -sf grep $(TARGET_OUT)/bin/$(t);)
|
|
|
|
include $(BUILD_EXECUTABLE)
|