blob: 3e00e4c00dd84cb344937eb10909c5aa36bb836f [file] [log] [blame]
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -08001#
2# Copyright (C) 2014 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17LOCAL_PATH := $(call my-dir)
18
19#
Elliott Hughesd3633b12017-08-03 14:52:32 -070020# To sync with upstream:
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -080021#
22
Elliott Hughesd3633b12017-08-03 14:52:32 -070023# # Update.
Elliott Hughesa67bfec2015-04-05 10:14:19 -070024# git remote add toybox https://github.com/landley/toybox.git
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -080025# git fetch toybox
26# git merge toybox/master
Elliott Hughesd3633b12017-08-03 14:52:32 -070027
28# # Regenerate generated files.
29# make
30
31# # Make any necessary Android.mk changes and rebuild.
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -080032# mm -j32
Elliott Hughesd3633b12017-08-03 14:52:32 -070033
34# # Run tests.
35# ./run-tests-on-android.sh
36# # Run a single test.
37# ./run-tests-on-android.sh wc
38
39# # Upload changes.
40# git commit -a --amend
Elliott Hughesa729fc82016-01-20 20:41:02 -080041# git push aosp HEAD:refs/for/master # Push to gerrit for review.
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -080042# git push aosp HEAD:master # Push directly, avoiding gerrit.
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -080043
44
Elliott Hughes361d6ab2015-03-13 14:49:52 -070045#
46# To add a toy:
47#
48
Elliott Hughesf6453fe2016-06-13 18:52:28 -070049# Edit .config to enable the toy you want to add.
Elliott Hughes361d6ab2015-03-13 14:49:52 -070050# make clean && make # Regenerate the generated files.
51# # Edit LOCAL_SRC_FILES below to add the toy.
52# # If you just want to use it as "toybox x" rather than "x", you can stop now.
53# # If you want this toy to have a symbolic link in /system/bin, add the toy to ALL_TOOLS.
54
Jaesoo Lee95a47fe2017-03-03 13:07:39 +090055common_SRC_FILES := \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -080056 lib/args.c \
57 lib/dirtree.c \
58 lib/getmountlist.c \
59 lib/help.c \
Elliott Hughes584c6542015-05-15 16:26:09 -070060 lib/interestingtimes.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -080061 lib/lib.c \
Elliott Hughesa729fc82016-01-20 20:41:02 -080062 lib/linestack.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -080063 lib/llist.c \
64 lib/net.c \
65 lib/portability.c \
66 lib/xwrap.c \
67 main.c \
Elliott Hughes0e6551a2015-03-28 12:49:31 -070068 toys/android/getenforce.c \
69 toys/android/load_policy.c \
Elliott Hughes0803f532016-06-22 10:26:11 -070070 toys/android/log.c \
Elliott Hughese0953ac2015-04-07 14:51:26 -070071 toys/android/restorecon.c \
Elliott Hughescfbb8c12015-03-23 17:53:47 -070072 toys/android/runcon.c \
Elliott Hughesa126e5f2016-07-15 10:14:33 -070073 toys/android/sendevent.c \
Elliott Hughes0e6551a2015-03-28 12:49:31 -070074 toys/android/setenforce.c \
Elliott Hughes4b39d132015-04-07 17:42:12 -070075 toys/android/setprop.c \
Elliott Hughes06b90e32016-06-28 14:20:54 -070076 toys/android/start.c \
Elliott Hughesf353b242017-06-19 12:47:01 -070077 toys/lsb/dmesg.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -080078 toys/lsb/hostname.c \
79 toys/lsb/killall.c \
80 toys/lsb/md5sum.c \
81 toys/lsb/mknod.c \
82 toys/lsb/mktemp.c \
83 toys/lsb/mount.c \
84 toys/lsb/pidof.c \
85 toys/lsb/seq.c \
86 toys/lsb/sync.c \
87 toys/lsb/umount.c \
Elliott Hughese7b74ae2016-07-07 17:02:37 -070088 toys/net/ifconfig.c \
Elliott Hughescae44952017-01-25 20:07:12 -080089 toys/net/microcom.c \
Elliott Hughese7b74ae2016-07-07 17:02:37 -070090 toys/net/netcat.c \
91 toys/net/netstat.c \
92 toys/net/rfkill.c \
Elliott Hughes5d83f7a2016-08-29 08:26:36 -070093 toys/net/tunctl.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -080094 toys/other/acpi.c \
Elliott Hughes14862232014-12-18 17:55:47 -080095 toys/other/base64.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -080096 toys/other/blkid.c \
97 toys/other/blockdev.c \
Elliott Hughesbf65a2e2015-02-09 12:14:46 -080098 toys/other/chcon.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -080099 toys/other/chroot.c \
Elliott Hughes3233e2f2017-05-25 14:16:21 -0700100 toys/other/chrt.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800101 toys/other/clear.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800102 toys/other/dos2unix.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800103 toys/other/fallocate.c \
Elliott Hughes0cad3b12015-10-06 14:31:35 -0700104 toys/other/flock.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800105 toys/other/free.c \
106 toys/other/freeramdisk.c \
107 toys/other/fsfreeze.c \
108 toys/other/help.c \
Elliott Hughes718f34d2015-07-10 18:02:00 -0700109 toys/other/hwclock.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800110 toys/other/inotifyd.c \
111 toys/other/insmod.c \
Elliott Hughese3764cc2015-07-06 18:09:49 -0700112 toys/other/ionice.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800113 toys/other/losetup.c \
114 toys/other/lsattr.c \
115 toys/other/lsmod.c \
Dmitry Shmidt1014fe72017-05-30 15:25:12 -0700116 toys/other/lspci.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800117 toys/other/lsusb.c \
118 toys/other/makedevs.c \
119 toys/other/mkswap.c \
120 toys/other/modinfo.c \
121 toys/other/mountpoint.c \
122 toys/other/nbd_client.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800123 toys/other/partprobe.c \
124 toys/other/pivot_root.c \
125 toys/other/pmap.c \
126 toys/other/printenv.c \
127 toys/other/pwdx.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800128 toys/other/readlink.c \
129 toys/other/realpath.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800130 toys/other/rev.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800131 toys/other/rmmod.c \
Elliott Hughesaf478b72018-01-22 12:56:47 -0800132 toys/other/setfattr.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800133 toys/other/setsid.c \
134 toys/other/stat.c \
135 toys/other/swapoff.c \
136 toys/other/swapon.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800137 toys/other/sysctl.c \
138 toys/other/tac.c \
139 toys/other/taskset.c \
140 toys/other/timeout.c \
141 toys/other/truncate.c \
Elliott Hughes68640612015-08-17 11:13:01 -0700142 toys/other/uptime.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800143 toys/other/usleep.c \
144 toys/other/vconfig.c \
145 toys/other/vmstat.c \
146 toys/other/which.c \
Elliott Hughese3764cc2015-07-06 18:09:49 -0700147 toys/other/xxd.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800148 toys/other/yes.c \
Elliott Hughes3c3e83a2014-12-16 20:18:05 -0800149 toys/pending/dd.c \
Elliott Hughes98aae742017-04-01 09:18:14 -0700150 toys/pending/diff.c \
Elliott Hughes88db4122015-02-18 17:32:09 -0800151 toys/pending/expr.c \
Elliott Hughesaf478b72018-01-22 12:56:47 -0800152 toys/pending/fmt.c \
Elliott Hughesa1ce46b2016-08-02 09:08:31 -0700153 toys/pending/getfattr.c \
Elliott Hughes429b7a32017-05-03 22:53:47 -0700154 toys/pending/gzip.c \
Elliott Hughesecd3df92015-09-11 10:50:35 -0700155 toys/pending/lsof.c \
Sandeep Patil488b5392016-12-06 21:21:58 -0800156 toys/pending/modprobe.c \
Elliott Hughes53a43da2014-12-11 17:05:54 -0800157 toys/pending/more.c \
Elliott Hughesb4d75fd2017-12-04 10:10:29 -0800158 toys/pending/stty.c \
Elliott Hughes88db4122015-02-18 17:32:09 -0800159 toys/pending/tar.c \
Elliott Hughes347e42b2015-01-13 18:45:44 -0800160 toys/pending/tr.c \
Elliott Hughes3c3e83a2014-12-16 20:18:05 -0800161 toys/pending/traceroute.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800162 toys/posix/basename.c \
163 toys/posix/cal.c \
164 toys/posix/cat.c \
165 toys/posix/chgrp.c \
166 toys/posix/chmod.c \
167 toys/posix/cksum.c \
168 toys/posix/cmp.c \
169 toys/posix/comm.c \
170 toys/posix/cp.c \
Elliott Hughesbfa8d062015-02-05 10:02:55 -0800171 toys/posix/cpio.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800172 toys/posix/cut.c \
173 toys/posix/date.c \
174 toys/posix/df.c \
175 toys/posix/dirname.c \
176 toys/posix/du.c \
177 toys/posix/echo.c \
178 toys/posix/env.c \
179 toys/posix/expand.c \
180 toys/posix/false.c \
Elliott Hughesf3304b32016-07-08 10:19:23 -0700181 toys/posix/file.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800182 toys/posix/find.c \
183 toys/posix/grep.c \
184 toys/posix/head.c \
185 toys/posix/id.c \
186 toys/posix/kill.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800187 toys/posix/ln.c \
188 toys/posix/ls.c \
189 toys/posix/mkdir.c \
190 toys/posix/mkfifo.c \
191 toys/posix/nice.c \
192 toys/posix/nl.c \
193 toys/posix/nohup.c \
194 toys/posix/od.c \
195 toys/posix/paste.c \
196 toys/posix/patch.c \
Elliott Hughes0e6551a2015-03-28 12:49:31 -0700197 toys/posix/printf.c \
Elliott Hughesb1318032015-10-30 13:24:56 -0700198 toys/posix/ps.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800199 toys/posix/pwd.c \
200 toys/posix/renice.c \
201 toys/posix/rm.c \
202 toys/posix/rmdir.c \
Elliott Hughes347e42b2015-01-13 18:45:44 -0800203 toys/posix/sed.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800204 toys/posix/sleep.c \
205 toys/posix/sort.c \
206 toys/posix/split.c \
207 toys/posix/strings.c \
208 toys/posix/tail.c \
209 toys/posix/tee.c \
210 toys/posix/time.c \
211 toys/posix/touch.c \
212 toys/posix/true.c \
213 toys/posix/tty.c \
Elliott Hughes59224352016-02-11 19:37:05 -0800214 toys/posix/ulimit.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800215 toys/posix/uname.c \
216 toys/posix/uniq.c \
Elliott Hugheseacb3492016-10-04 09:27:25 -0700217 toys/posix/uudecode.c \
218 toys/posix/uuencode.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800219 toys/posix/wc.c \
220 toys/posix/xargs.c \
221
Jaesoo Lee95a47fe2017-03-03 13:07:39 +0900222common_CFLAGS := \
Elliott Hughesf37062b2017-09-13 23:25:38 -0700223 -std=gnu11 \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800224 -Os \
Chih-Hung Hsieh0eb514a2017-10-11 14:24:08 -0700225 -Wall -Werror \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800226 -Wno-char-subscripts \
Elliott Hughes3233e2f2017-05-25 14:16:21 -0700227 -Wno-gnu-variable-sized-type-not-at-end \
228 -Wno-missing-field-initializers \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800229 -Wno-sign-compare \
Elliott Hughes0e6551a2015-03-28 12:49:31 -0700230 -Wno-string-plus-int \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800231 -Wno-uninitialized \
232 -Wno-unused-parameter \
Elliott Hughesd3533982015-01-15 15:04:19 -0800233 -funsigned-char \
234 -ffunction-sections -fdata-sections \
235 -fno-asynchronous-unwind-tables \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800236
Jeffrey Vander Stoepcf90d7e2017-07-10 06:19:45 +0000237toybox_libraries := liblog libselinux libcutils libcrypto libz
Elliott Hughes429b7a32017-05-03 22:53:47 -0700238
Elliott Hughescb633d42017-10-22 22:56:36 -0700239common_CFLAGS += -DTOYBOX_VENDOR=\"-android\"
Jaesoo Lee95a47fe2017-03-03 13:07:39 +0900240
Elliott Hughes429b7a32017-05-03 22:53:47 -0700241# not usable on Android?: freeramdisk fsfreeze install makedevs nbd-client
242# partprobe pivot_root pwdx rev rfkill vconfig
243# currently prefer BSD system/core/toolbox: dd
244# currently prefer BSD external/netcat: nc netcat
245# currently prefer external/efs2progs: blkid chattr lsattr
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800246
247ALL_TOOLS := \
248 acpi \
Elliott Hughes18465132015-08-18 09:57:45 -0700249 base64 \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800250 basename \
251 blockdev \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800252 cal \
Elliott Hughes1e0e5ea2015-01-14 10:40:22 -0800253 cat \
Elliott Hughes76115632014-12-16 09:14:47 -0800254 chcon \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800255 chgrp \
Elliott Hughes5c7cca02014-12-11 12:12:59 -0800256 chmod \
Elliott Hughes6ee70fc2015-01-15 13:41:34 -0800257 chown \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800258 chroot \
Elliott Hughes0f7f3a52016-08-29 09:07:38 -0700259 chrt \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800260 cksum \
Elliott Hughes03275a82014-11-22 22:56:47 -0800261 clear \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800262 comm \
Elliott Hughesd3533982015-01-15 15:04:19 -0800263 cmp \
Elliott Hughes6b4d05c2014-12-16 16:15:47 -0800264 cp \
Elliott Hughesbfa8d062015-02-05 10:02:55 -0800265 cpio \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800266 cut \
Elliott Hughes9aaeff32015-01-14 12:26:10 -0800267 date \
Elliott Hughes578e6282015-10-23 11:10:39 -0700268 df \
Elliott Hughes98aae742017-04-01 09:18:14 -0700269 diff \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800270 dirname \
Elliott Hughesc99e20b2014-11-26 11:38:43 -0800271 dmesg \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800272 dos2unix \
Elliott Hughes4dc62962015-09-14 10:39:33 -0700273 du \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800274 echo \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800275 env \
276 expand \
Elliott Hughes88db4122015-02-18 17:32:09 -0800277 expr \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800278 fallocate \
Elliott Hughes03275a82014-11-22 22:56:47 -0800279 false \
Elliott Hughesf3304b32016-07-08 10:19:23 -0700280 file \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800281 find \
Elliott Hughes0cad3b12015-10-06 14:31:35 -0700282 flock \
Elliott Hughesaf478b72018-01-22 12:56:47 -0800283 fmt \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800284 free \
Elliott Hughes9250c952014-12-24 11:29:44 -0800285 getenforce \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800286 groups \
Elliott Hughes429b7a32017-05-03 22:53:47 -0700287 gunzip \
288 gzip \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800289 head \
290 hostname \
Elliott Hughes9aaeff32015-01-14 12:26:10 -0800291 hwclock \
Elliott Hughesc8fa5ee2015-01-16 19:27:31 -0800292 id \
Elliott Hughes4f060a32015-01-14 11:07:28 -0800293 ifconfig \
Elliott Hughes123aecf2015-01-14 11:00:47 -0800294 inotifyd \
Elliott Hughes6a646ef2014-11-24 11:41:35 -0800295 insmod \
Elliott Hughesa53c8ff2015-08-14 15:55:40 -0700296 ionice \
297 iorenice \
Elliott Hughes95211ea2014-12-04 20:09:44 -0800298 kill \
Josh Gao53a1aa32015-12-22 11:34:57 -0800299 killall \
Elliott Hughes0e6551a2015-03-28 12:49:31 -0700300 load_policy \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800301 ln \
Elliott Hughesf74df032016-06-22 12:25:11 -0700302 log \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800303 logname \
304 losetup \
Elliott Hughes2e720072015-08-31 12:43:59 -0700305 ls \
Elliott Hughes6a646ef2014-11-24 11:41:35 -0800306 lsmod \
Elliott Hughes77538432015-09-11 10:57:33 -0700307 lsof \
Dmitry Shmidt1014fe72017-05-30 15:25:12 -0700308 lspci \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800309 lsusb \
310 md5sum \
Elliott Hughesd13bf6a2014-12-16 15:17:17 -0800311 mkdir \
Elliott Hughes86537b32017-05-02 17:26:30 -0700312 mkfifo \
Elliott Hughes0a0435c2014-12-11 18:34:09 -0800313 mknod \
Elliott Hughes620bc1a2014-11-24 16:12:40 -0800314 mkswap \
Elliott Hughes79984b42015-02-09 12:16:39 -0800315 mktemp \
Elliott Hughes7a497532017-01-15 11:24:30 -0800316 microcom \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800317 modinfo \
Sandeep Patil488b5392016-12-06 21:21:58 -0800318 modprobe \
Elliott Hughes53a43da2014-12-11 17:05:54 -0800319 more \
Elliott Hughes0e7e9a12015-06-08 14:52:58 -0700320 mount \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800321 mountpoint \
Elliott Hughesdbcacc62014-12-16 19:18:43 -0800322 mv \
Elliott Hughes5f9893b2014-12-23 09:12:18 -0800323 netstat \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800324 nice \
325 nl \
Elliott Hughes9f989412014-11-25 17:00:40 -0800326 nohup \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800327 od \
328 paste \
329 patch \
Elliott Hughes5d2ad232015-03-19 22:52:46 -0700330 pgrep \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800331 pidof \
Elliott Hughes5d2ad232015-03-19 22:52:46 -0700332 pkill \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800333 pmap \
Elliott Hughes68e18cd2014-11-24 15:36:51 -0800334 printenv \
Elliott Hughes0e6551a2015-03-28 12:49:31 -0700335 printf \
Elliott Hughes782aced2016-05-04 15:18:27 -0700336 ps \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800337 pwd \
Elliott Hughes8f7bc7a2014-11-26 15:21:03 -0800338 readlink \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800339 realpath \
Elliott Hughesa53c8ff2015-08-14 15:55:40 -0700340 renice \
Elliott Hughese0953ac2015-04-07 14:51:26 -0700341 restorecon \
Elliott Hughesf5275f92014-12-16 16:22:32 -0800342 rm \
Elliott Hughesd4a6d662014-12-16 15:26:53 -0800343 rmdir \
Elliott Hughes6a646ef2014-11-24 11:41:35 -0800344 rmmod \
Elliott Hughescfbb8c12015-03-23 17:53:47 -0700345 runcon \
Elliott Hughes347e42b2015-01-13 18:45:44 -0800346 sed \
Elliott Hughes75681dc2016-07-15 14:19:07 -0700347 sendevent \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800348 seq \
Elliott Hughes9250c952014-12-24 11:29:44 -0800349 setenforce \
Elliott Hughes176eae92015-04-07 20:36:38 -0700350 setprop \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800351 setsid \
352 sha1sum \
Elliott Hughes63ca1462016-07-15 16:31:22 -0700353 sha224sum \
354 sha256sum \
355 sha384sum \
356 sha512sum \
Elliott Hughes62cf8d62014-11-24 15:23:04 -0800357 sleep \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800358 sort \
359 split \
Elliott Hughesba38a432016-06-29 11:45:39 -0700360 start \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800361 stat \
Elliott Hughesba38a432016-06-29 11:45:39 -0700362 stop \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800363 strings \
Elliott Hughesb4d75fd2017-12-04 10:10:29 -0800364 stty \
Elliott Hughes620bc1a2014-11-24 16:12:40 -0800365 swapoff \
366 swapon \
Elliott Hughes85368282014-11-24 14:53:36 -0800367 sync \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800368 sysctl \
369 tac \
370 tail \
Elliott Hughes88db4122015-02-18 17:32:09 -0800371 tar \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800372 taskset \
373 tee \
374 time \
375 timeout \
Elliott Hughesf6453fe2016-06-13 18:52:28 -0700376 top \
Elliott Hughes5eec03a2015-02-09 14:09:49 -0800377 touch \
Elliott Hughes347e42b2015-01-13 18:45:44 -0800378 tr \
Elliott Hughes03275a82014-11-22 22:56:47 -0800379 true \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800380 truncate \
Elliott Hughes6f52fbc2015-05-31 10:02:48 -0700381 tty \
Elliott Hughes59224352016-02-11 19:37:05 -0800382 ulimit \
Elliott Hughescc6fc172015-04-02 21:27:05 -0700383 umount \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800384 uname \
385 uniq \
386 unix2dos \
Elliott Hughes68640612015-08-17 11:13:01 -0700387 uptime \
Elliott Hughes10bd49e2014-11-21 14:53:43 -0800388 usleep \
Elliott Hugheseacb3492016-10-04 09:27:25 -0700389 uudecode \
390 uuencode \
Elliott Hughes20800602014-11-25 17:25:05 -0800391 vmstat \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800392 wc \
393 which \
394 whoami \
395 xargs \
Elliott Hughesdce8d622015-07-17 11:17:39 -0700396 xxd \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800397 yes \
Elliott Hughes429b7a32017-05-03 22:53:47 -0700398 zcat \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800399
Elliott Hughes429b7a32017-05-03 22:53:47 -0700400############################################
401# toybox for /system
402############################################
403
404include $(CLEAR_VARS)
405LOCAL_MODULE := toybox
406LOCAL_SRC_FILES := $(common_SRC_FILES)
407LOCAL_CFLAGS := $(common_CFLAGS)
408LOCAL_SHARED_LIBRARIES := $(toybox_libraries)
409# This doesn't actually prevent us from dragging in libc++ at runtime
410# because libnetd_client.so is C++.
411LOCAL_CXX_STL := none
Ying Wang331b22d2014-11-24 12:42:09 -0800412LOCAL_POST_INSTALL_CMD := $(hide) $(foreach t,$(ALL_TOOLS),ln -sf toybox $(TARGET_OUT)/bin/$(t);)
Ying Wang331b22d2014-11-24 12:42:09 -0800413include $(BUILD_EXECUTABLE)
Jaesoo Lee95a47fe2017-03-03 13:07:39 +0900414
Sandeep Patil2b69f382017-04-12 14:53:55 -0700415############################################
Yifan Hong22114322017-07-13 00:56:30 +0000416# toybox for /vendor
Elliott Hughes429b7a32017-05-03 22:53:47 -0700417############################################
418
Sandeep Patil2b69f382017-04-12 14:53:55 -0700419include $(CLEAR_VARS)
Elliott Hughes429b7a32017-05-03 22:53:47 -0700420LOCAL_MODULE := toybox_vendor
421LOCAL_VENDOR_MODULE := true
Sandeep Patil2b69f382017-04-12 14:53:55 -0700422LOCAL_SRC_FILES := $(common_SRC_FILES)
Sandeep Patil2b69f382017-04-12 14:53:55 -0700423LOCAL_CFLAGS := $(common_CFLAGS)
Yifan Hong22114322017-07-13 00:56:30 +0000424LOCAL_STATIC_LIBRARIES := libcutils libcrypto libz
Jiyong Park61be2f82017-10-13 09:18:10 +0900425LOCAL_SHARED_LIBRARIES := libselinux liblog
Sandeep Patil2b69f382017-04-12 14:53:55 -0700426LOCAL_MODULE_TAGS := optional
Sandeep Patil2b69f382017-04-12 14:53:55 -0700427LOCAL_POST_INSTALL_CMD := $(hide) $(foreach t,$(ALL_TOOLS),ln -sf ${LOCAL_MODULE} $(TARGET_OUT_VENDOR_EXECUTABLES)/$(t);)
Sandeep Patil2b69f382017-04-12 14:53:55 -0700428include $(BUILD_EXECUTABLE)
Sandeep Patil2b69f382017-04-12 14:53:55 -0700429
Jaesoo Lee95a47fe2017-03-03 13:07:39 +0900430############################################
431# static version to be installed in recovery
Elliott Hughes429b7a32017-05-03 22:53:47 -0700432############################################
Jaesoo Lee95a47fe2017-03-03 13:07:39 +0900433
434include $(CLEAR_VARS)
Elliott Hughes429b7a32017-05-03 22:53:47 -0700435LOCAL_MODULE := toybox_static
Jaesoo Lee95a47fe2017-03-03 13:07:39 +0900436LOCAL_SRC_FILES := $(common_SRC_FILES)
Jaesoo Lee95a47fe2017-03-03 13:07:39 +0900437LOCAL_CFLAGS := $(common_CFLAGS)
Elliott Hughes429b7a32017-05-03 22:53:47 -0700438LOCAL_STATIC_LIBRARIES := $(toybox_libraries)
Jaesoo Lee95a47fe2017-03-03 13:07:39 +0900439# libc++_static is needed by static liblog
440LOCAL_CXX_STL := libc++_static
Jaesoo Lee81adbb22017-03-22 16:16:51 +0900441LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
Jaesoo Lee95a47fe2017-03-03 13:07:39 +0900442LOCAL_FORCE_STATIC_EXECUTABLE := true
Elliott Hughes1ca23992017-05-05 18:02:04 -0700443LOCAL_POST_INSTALL_CMD := $(hide) $(foreach t,$(ALL_TOOLS),ln -sf ${LOCAL_MODULE} $(LOCAL_MODULE_PATH)/$(t);)
Jaesoo Lee95a47fe2017-03-03 13:07:39 +0900444include $(BUILD_EXECUTABLE)