OSDN Git Service

Add file(1).
[android-x86/external-toybox.git] / Android.mk
index 26b54ee..d4cbe3d 100644 (file)
@@ -25,8 +25,9 @@ LOCAL_PATH := $(call my-dir)
 #  git merge toybox/master
 #  mm -j32
 #  # (Make any necessary Android.mk changes and test the new toybox.)
+#  repo upload .
+#  git push aosp HEAD:refs/for/master  # Push to gerrit for review.
 #  git push aosp HEAD:master  # Push directly, avoiding gerrit.
-#  git push aosp HEAD:refs/for/master  # Push to gerrit.
 #
 #  # Now commit any necessary Android.mk changes like normal:
 #  repo start post-sync .
@@ -37,8 +38,7 @@ LOCAL_PATH := $(call my-dir)
 # To add a toy:
 #
 
-#  make menuconfig
-#  # (Select the toy you want to add.)
+#  Edit .config to enable the toy you want to add.
 #  make clean && make  # Regenerate the generated files.
 #  # Edit LOCAL_SRC_FILES below to add the toy.
 #  # If you just want to use it as "toybox x" rather than "x", you can stop now.
@@ -53,6 +53,7 @@ LOCAL_SRC_FILES := \
     lib/help.c \
     lib/interestingtimes.c \
     lib/lib.c \
+    lib/linestack.c \
     lib/llist.c \
     lib/net.c \
     lib/portability.c \
@@ -61,10 +62,12 @@ LOCAL_SRC_FILES := \
     toys/android/getenforce.c \
     toys/android/getprop.c \
     toys/android/load_policy.c \
+    toys/android/log.c \
     toys/android/restorecon.c \
     toys/android/runcon.c \
     toys/android/setenforce.c \
     toys/android/setprop.c \
+    toys/android/start.c \
     toys/lsb/dmesg.c \
     toys/lsb/hostname.c \
     toys/lsb/killall.c \
@@ -76,6 +79,10 @@ LOCAL_SRC_FILES := \
     toys/lsb/seq.c \
     toys/lsb/sync.c \
     toys/lsb/umount.c \
+    toys/net/ifconfig.c \
+    toys/net/netcat.c \
+    toys/net/netstat.c \
+    toys/net/rfkill.c \
     toys/other/acpi.c \
     toys/other/base64.c \
     toys/other/blkid.c \
@@ -86,12 +93,12 @@ LOCAL_SRC_FILES := \
     toys/other/clear.c \
     toys/other/dos2unix.c \
     toys/other/fallocate.c \
+    toys/other/flock.c \
     toys/other/free.c \
     toys/other/freeramdisk.c \
     toys/other/fsfreeze.c \
     toys/other/help.c \
     toys/other/hwclock.c \
-    toys/other/ifconfig.c \
     toys/other/inotifyd.c \
     toys/other/insmod.c \
     toys/other/ionice.c \
@@ -104,7 +111,6 @@ LOCAL_SRC_FILES := \
     toys/other/modinfo.c \
     toys/other/mountpoint.c \
     toys/other/nbd_client.c \
-    toys/other/netcat.c \
     toys/other/partprobe.c \
     toys/other/pivot_root.c \
     toys/other/pmap.c \
@@ -113,13 +119,11 @@ LOCAL_SRC_FILES := \
     toys/other/readlink.c \
     toys/other/realpath.c \
     toys/other/rev.c \
-    toys/other/rfkill.c \
     toys/other/rmmod.c \
     toys/other/setsid.c \
     toys/other/stat.c \
     toys/other/swapoff.c \
     toys/other/swapon.c \
-    toys/other/switch_root.c \
     toys/other/sysctl.c \
     toys/other/tac.c \
     toys/other/taskset.c \
@@ -136,11 +140,7 @@ LOCAL_SRC_FILES := \
     toys/pending/expr.c \
     toys/pending/lsof.c \
     toys/pending/more.c \
-    toys/pending/pgrep.c \
-    toys/pending/netstat.c \
-    toys/pending/route.c \
     toys/pending/tar.c \
-    toys/pending/top.c \
     toys/pending/tr.c \
     toys/pending/traceroute.c \
     toys/posix/basename.c \
@@ -162,6 +162,7 @@ LOCAL_SRC_FILES := \
     toys/posix/env.c \
     toys/posix/expand.c \
     toys/posix/false.c \
+    toys/posix/file.c \
     toys/posix/find.c \
     toys/posix/grep.c \
     toys/posix/head.c \
@@ -178,6 +179,7 @@ LOCAL_SRC_FILES := \
     toys/posix/paste.c \
     toys/posix/patch.c \
     toys/posix/printf.c \
+    toys/posix/ps.c \
     toys/posix/pwd.c \
     toys/posix/renice.c \
     toys/posix/rm.c \
@@ -193,6 +195,7 @@ LOCAL_SRC_FILES := \
     toys/posix/touch.c \
     toys/posix/true.c \
     toys/posix/tty.c \
+    toys/posix/ulimit.c \
     toys/posix/uname.c \
     toys/posix/uniq.c \
     toys/posix/wc.c \
@@ -210,7 +213,10 @@ LOCAL_CFLAGS += \
     -ffunction-sections -fdata-sections \
     -fno-asynchronous-unwind-tables \
 
-toybox_version := $(shell git -C $(LOCAL_PATH) rev-parse --short=12 HEAD 2>/dev/null)-android
+toybox_upstream_version := $(shell awk 'match($$0, /TOYBOX_VERSION.*"(.*)"/, ary) {print ary[1]}' $(LOCAL_PATH)/main.c)
+toybox_sha := $(shell git -C $(LOCAL_PATH) rev-parse --short=12 HEAD 2>/dev/null)
+
+toybox_version := $(toybox_upstream_version)-$(toybox_sha)-android
 LOCAL_CFLAGS += -DTOYBOX_VERSION='"$(toybox_version)"'
 
 LOCAL_CLANG := true
@@ -223,9 +229,9 @@ LOCAL_CXX_STL := none
 
 LOCAL_MODULE := toybox
 
-# dupes: dd df du
+# dupes: dd
 # useless?: freeramdisk fsfreeze install makedevs mkfifo nbd-client
-#           partprobe pivot_root pwdx rev rfkill switch_root tty vconfig
+#           partprobe pivot_root pwdx rev rfkill vconfig
 # prefer BSD netcat instead?: nc netcat
 # prefer efs2progs instead?: blkid chattr lsattr
 
@@ -250,16 +256,20 @@ ALL_TOOLS := \
     cpio \
     cut \
     date \
+    df \
     dirname \
     dmesg \
     dos2unix \
+    du \
     echo \
     env \
     expand \
     expr \
     fallocate \
     false \
+    file \
     find \
+    flock \
     free \
     getenforce \
     getprop \
@@ -277,6 +287,7 @@ ALL_TOOLS := \
     killall \
     load_policy \
     ln \
+    log \
     logname \
     losetup \
     ls \
@@ -306,6 +317,7 @@ ALL_TOOLS := \
     pmap \
     printenv \
     printf \
+    ps \
     pwd \
     readlink \
     realpath \
@@ -314,7 +326,6 @@ ALL_TOOLS := \
     rm \
     rmdir \
     rmmod \
-    route \
     runcon \
     sed \
     seq \
@@ -325,7 +336,9 @@ ALL_TOOLS := \
     sleep \
     sort \
     split \
+    start \
     stat \
+    stop \
     strings \
     swapoff \
     swapon \
@@ -338,11 +351,13 @@ ALL_TOOLS := \
     tee \
     time \
     timeout \
+    top \
     touch \
     tr \
     true \
     truncate \
     tty \
+    ulimit \
     umount \
     uname \
     uniq \