Elliott Hughes | d8d2d3c | 2014-11-20 10:39:27 -0800 | [diff] [blame] | 1 | # |
| 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 | |
| 17 | LOCAL_PATH := $(call my-dir) |
| 18 | |
| 19 | # |
| 20 | # To update: |
| 21 | # |
| 22 | |
| 23 | # git remote add toybox https://github.com/gfto/toybox.git |
| 24 | # git fetch toybox |
| 25 | # git merge toybox/master |
| 26 | # mm -j32 |
| 27 | # # (Make any necessary Android.mk changes and test the new toybox.) |
| 28 | # git push aosp HEAD:master # Push directly, avoiding gerrit. |
| 29 | # git push aosp HEAD:refs/for/master # Push to gerrit. |
| 30 | # |
| 31 | # # Now commit any necessary Android.mk changes like normal: |
| 32 | # repo start post-sync . |
| 33 | # git commit -a |
| 34 | |
| 35 | |
| 36 | include $(CLEAR_VARS) |
| 37 | |
| 38 | LOCAL_SRC_FILES := \ |
| 39 | lib/args.c \ |
| 40 | lib/dirtree.c \ |
| 41 | lib/getmountlist.c \ |
| 42 | lib/help.c \ |
| 43 | lib/lib.c \ |
| 44 | lib/llist.c \ |
| 45 | lib/net.c \ |
| 46 | lib/portability.c \ |
| 47 | lib/xwrap.c \ |
| 48 | main.c \ |
| 49 | toys/lsb/dmesg.c \ |
| 50 | toys/lsb/hostname.c \ |
| 51 | toys/lsb/killall.c \ |
| 52 | toys/lsb/md5sum.c \ |
| 53 | toys/lsb/mknod.c \ |
| 54 | toys/lsb/mktemp.c \ |
| 55 | toys/lsb/mount.c \ |
| 56 | toys/lsb/pidof.c \ |
| 57 | toys/lsb/seq.c \ |
| 58 | toys/lsb/sync.c \ |
| 59 | toys/lsb/umount.c \ |
| 60 | toys/other/acpi.c \ |
| 61 | toys/other/blkid.c \ |
| 62 | toys/other/blockdev.c \ |
| 63 | toys/other/bzcat.c \ |
| 64 | toys/other/catv.c \ |
| 65 | toys/other/chroot.c \ |
| 66 | toys/other/chvt.c \ |
| 67 | toys/other/clear.c \ |
| 68 | toys/other/count.c \ |
| 69 | toys/other/dos2unix.c \ |
| 70 | toys/other/factor.c \ |
| 71 | toys/other/fallocate.c \ |
| 72 | toys/other/free.c \ |
| 73 | toys/other/freeramdisk.c \ |
| 74 | toys/other/fsfreeze.c \ |
| 75 | toys/other/help.c \ |
| 76 | toys/other/ifconfig.c \ |
| 77 | toys/other/inotifyd.c \ |
| 78 | toys/other/insmod.c \ |
| 79 | toys/other/losetup.c \ |
| 80 | toys/other/lsattr.c \ |
| 81 | toys/other/lsmod.c \ |
| 82 | toys/other/lspci.c \ |
| 83 | toys/other/lsusb.c \ |
| 84 | toys/other/makedevs.c \ |
| 85 | toys/other/mkswap.c \ |
| 86 | toys/other/modinfo.c \ |
| 87 | toys/other/mountpoint.c \ |
| 88 | toys/other/nbd_client.c \ |
| 89 | toys/other/netcat.c \ |
| 90 | toys/other/oneit.c \ |
| 91 | toys/other/partprobe.c \ |
| 92 | toys/other/pivot_root.c \ |
| 93 | toys/other/pmap.c \ |
| 94 | toys/other/printenv.c \ |
| 95 | toys/other/pwdx.c \ |
| 96 | toys/other/readahead.c \ |
| 97 | toys/other/readlink.c \ |
| 98 | toys/other/realpath.c \ |
Elliott Hughes | d8d2d3c | 2014-11-20 10:39:27 -0800 | [diff] [blame] | 99 | toys/other/rev.c \ |
| 100 | toys/other/rfkill.c \ |
| 101 | toys/other/rmmod.c \ |
| 102 | toys/other/setsid.c \ |
| 103 | toys/other/stat.c \ |
| 104 | toys/other/swapoff.c \ |
| 105 | toys/other/swapon.c \ |
| 106 | toys/other/switch_root.c \ |
| 107 | toys/other/sysctl.c \ |
| 108 | toys/other/tac.c \ |
| 109 | toys/other/taskset.c \ |
| 110 | toys/other/timeout.c \ |
| 111 | toys/other/truncate.c \ |
| 112 | toys/other/unshare.c \ |
| 113 | toys/other/usleep.c \ |
| 114 | toys/other/vconfig.c \ |
| 115 | toys/other/vmstat.c \ |
| 116 | toys/other/which.c \ |
| 117 | toys/other/yes.c \ |
| 118 | toys/posix/basename.c \ |
| 119 | toys/posix/cal.c \ |
| 120 | toys/posix/cat.c \ |
| 121 | toys/posix/chgrp.c \ |
| 122 | toys/posix/chmod.c \ |
| 123 | toys/posix/cksum.c \ |
| 124 | toys/posix/cmp.c \ |
| 125 | toys/posix/comm.c \ |
| 126 | toys/posix/cp.c \ |
| 127 | toys/posix/cpio.c \ |
| 128 | toys/posix/cut.c \ |
| 129 | toys/posix/date.c \ |
| 130 | toys/posix/df.c \ |
| 131 | toys/posix/dirname.c \ |
| 132 | toys/posix/du.c \ |
| 133 | toys/posix/echo.c \ |
| 134 | toys/posix/env.c \ |
| 135 | toys/posix/expand.c \ |
| 136 | toys/posix/false.c \ |
| 137 | toys/posix/find.c \ |
| 138 | toys/posix/grep.c \ |
| 139 | toys/posix/head.c \ |
| 140 | toys/posix/id.c \ |
| 141 | toys/posix/kill.c \ |
| 142 | toys/posix/link.c \ |
| 143 | toys/posix/ln.c \ |
| 144 | toys/posix/ls.c \ |
| 145 | toys/posix/mkdir.c \ |
| 146 | toys/posix/mkfifo.c \ |
| 147 | toys/posix/nice.c \ |
| 148 | toys/posix/nl.c \ |
| 149 | toys/posix/nohup.c \ |
| 150 | toys/posix/od.c \ |
| 151 | toys/posix/paste.c \ |
| 152 | toys/posix/patch.c \ |
| 153 | toys/posix/pwd.c \ |
| 154 | toys/posix/renice.c \ |
| 155 | toys/posix/rm.c \ |
| 156 | toys/posix/rmdir.c \ |
| 157 | toys/posix/sleep.c \ |
| 158 | toys/posix/sort.c \ |
| 159 | toys/posix/split.c \ |
| 160 | toys/posix/strings.c \ |
| 161 | toys/posix/tail.c \ |
| 162 | toys/posix/tee.c \ |
| 163 | toys/posix/time.c \ |
| 164 | toys/posix/touch.c \ |
| 165 | toys/posix/true.c \ |
| 166 | toys/posix/tty.c \ |
| 167 | toys/posix/uname.c \ |
| 168 | toys/posix/uniq.c \ |
| 169 | toys/posix/unlink.c \ |
| 170 | toys/posix/uudecode.c \ |
| 171 | toys/posix/uuencode.c \ |
| 172 | toys/posix/wc.c \ |
| 173 | toys/posix/xargs.c \ |
| 174 | |
| 175 | LOCAL_CFLAGS += \ |
| 176 | -Os \ |
| 177 | -Wno-char-subscripts \ |
| 178 | -Wno-sign-compare \ |
| 179 | -Wno-uninitialized \ |
| 180 | -Wno-unused-parameter \ |
| 181 | -funsigned-char -ffunction-sections -fdata-sections -fno-asynchronous-unwind-tables \ |
| 182 | |
| 183 | LOCAL_MODULE := toybox |
Elliott Hughes | d8d2d3c | 2014-11-20 10:39:27 -0800 | [diff] [blame] | 184 | |
Elliott Hughes | c99e20b | 2014-11-26 11:38:43 -0800 | [diff] [blame] | 185 | # dupes: cat chmod chown cmp cp date df du grep id ifconfig kill ls mkdir |
Elliott Hughes | 8f7bc7a | 2014-11-26 15:21:03 -0800 | [diff] [blame^] | 186 | # mknod mount mv nc netcat notify(inotifyd) renice rm rmdir |
Elliott Hughes | 620bc1a | 2014-11-24 16:12:40 -0800 | [diff] [blame] | 187 | # touch umount vmstat |
Elliott Hughes | d8d2d3c | 2014-11-20 10:39:27 -0800 | [diff] [blame] | 188 | # obsolete?: cpio killall5 link unlink |
Elliott Hughes | 10bd49e | 2014-11-21 14:53:43 -0800 | [diff] [blame] | 189 | # non-Linux: count freeramdisk fstype nbd-client oneit vconfig |
Elliott Hughes | e3ebdf0 | 2014-11-24 14:34:48 -0800 | [diff] [blame] | 190 | # useless?: chvt fsfreeze install makedevs mkfifo mktemp partprobe pivot_root pwdx rev |
Elliott Hughes | d8d2d3c | 2014-11-20 10:39:27 -0800 | [diff] [blame] | 191 | # rfkill switch_root tty unshare |
| 192 | # prefer efs2progs instead?: blkid chattr lsattr |
| 193 | |
| 194 | ALL_TOOLS := \ |
| 195 | acpi \ |
| 196 | basename \ |
| 197 | blockdev \ |
| 198 | bzcat \ |
| 199 | cal \ |
| 200 | catv \ |
| 201 | chgrp \ |
| 202 | chroot \ |
| 203 | cksum \ |
Elliott Hughes | 03275a8 | 2014-11-22 22:56:47 -0800 | [diff] [blame] | 204 | clear \ |
Elliott Hughes | d8d2d3c | 2014-11-20 10:39:27 -0800 | [diff] [blame] | 205 | comm \ |
| 206 | cut \ |
| 207 | dirname \ |
Elliott Hughes | c99e20b | 2014-11-26 11:38:43 -0800 | [diff] [blame] | 208 | dmesg \ |
Elliott Hughes | d8d2d3c | 2014-11-20 10:39:27 -0800 | [diff] [blame] | 209 | dos2unix \ |
| 210 | echo \ |
| 211 | egrep \ |
| 212 | env \ |
| 213 | expand \ |
| 214 | factor \ |
| 215 | fallocate \ |
Elliott Hughes | 03275a8 | 2014-11-22 22:56:47 -0800 | [diff] [blame] | 216 | false \ |
Elliott Hughes | d8d2d3c | 2014-11-20 10:39:27 -0800 | [diff] [blame] | 217 | fgrep \ |
| 218 | find \ |
| 219 | free \ |
| 220 | groups \ |
| 221 | head \ |
| 222 | hostname \ |
Elliott Hughes | 6a646ef | 2014-11-24 11:41:35 -0800 | [diff] [blame] | 223 | insmod \ |
Elliott Hughes | d8d2d3c | 2014-11-20 10:39:27 -0800 | [diff] [blame] | 224 | killall \ |
| 225 | ln \ |
| 226 | logname \ |
| 227 | losetup \ |
Elliott Hughes | 6a646ef | 2014-11-24 11:41:35 -0800 | [diff] [blame] | 228 | lsmod \ |
Elliott Hughes | d8d2d3c | 2014-11-20 10:39:27 -0800 | [diff] [blame] | 229 | lspci \ |
| 230 | lsusb \ |
| 231 | md5sum \ |
Elliott Hughes | 620bc1a | 2014-11-24 16:12:40 -0800 | [diff] [blame] | 232 | mkswap \ |
Elliott Hughes | d8d2d3c | 2014-11-20 10:39:27 -0800 | [diff] [blame] | 233 | modinfo \ |
| 234 | mountpoint \ |
| 235 | nice \ |
| 236 | nl \ |
Elliott Hughes | 9f98941 | 2014-11-25 17:00:40 -0800 | [diff] [blame] | 237 | nohup \ |
Elliott Hughes | d8d2d3c | 2014-11-20 10:39:27 -0800 | [diff] [blame] | 238 | od \ |
| 239 | paste \ |
| 240 | patch \ |
| 241 | pidof \ |
| 242 | pmap \ |
Elliott Hughes | 68e18cd | 2014-11-24 15:36:51 -0800 | [diff] [blame] | 243 | printenv \ |
Elliott Hughes | d8d2d3c | 2014-11-20 10:39:27 -0800 | [diff] [blame] | 244 | pwd \ |
| 245 | readahead \ |
Elliott Hughes | 8f7bc7a | 2014-11-26 15:21:03 -0800 | [diff] [blame^] | 246 | readlink \ |
Elliott Hughes | d8d2d3c | 2014-11-20 10:39:27 -0800 | [diff] [blame] | 247 | realpath \ |
Elliott Hughes | 6a646ef | 2014-11-24 11:41:35 -0800 | [diff] [blame] | 248 | rmmod \ |
Elliott Hughes | d8d2d3c | 2014-11-20 10:39:27 -0800 | [diff] [blame] | 249 | seq \ |
| 250 | setsid \ |
| 251 | sha1sum \ |
Elliott Hughes | 62cf8d6 | 2014-11-24 15:23:04 -0800 | [diff] [blame] | 252 | sleep \ |
Elliott Hughes | d8d2d3c | 2014-11-20 10:39:27 -0800 | [diff] [blame] | 253 | sort \ |
| 254 | split \ |
| 255 | stat \ |
| 256 | strings \ |
Elliott Hughes | 620bc1a | 2014-11-24 16:12:40 -0800 | [diff] [blame] | 257 | swapoff \ |
| 258 | swapon \ |
Elliott Hughes | 8536828 | 2014-11-24 14:53:36 -0800 | [diff] [blame] | 259 | sync \ |
Elliott Hughes | d8d2d3c | 2014-11-20 10:39:27 -0800 | [diff] [blame] | 260 | sysctl \ |
| 261 | tac \ |
| 262 | tail \ |
| 263 | taskset \ |
| 264 | tee \ |
| 265 | time \ |
| 266 | timeout \ |
Elliott Hughes | 03275a8 | 2014-11-22 22:56:47 -0800 | [diff] [blame] | 267 | true \ |
Elliott Hughes | d8d2d3c | 2014-11-20 10:39:27 -0800 | [diff] [blame] | 268 | truncate \ |
| 269 | uname \ |
| 270 | uniq \ |
| 271 | unix2dos \ |
Elliott Hughes | 10bd49e | 2014-11-21 14:53:43 -0800 | [diff] [blame] | 272 | usleep \ |
Elliott Hughes | d8d2d3c | 2014-11-20 10:39:27 -0800 | [diff] [blame] | 273 | uudecode \ |
| 274 | uuencode \ |
| 275 | wc \ |
| 276 | which \ |
| 277 | whoami \ |
| 278 | xargs \ |
| 279 | yes \ |
| 280 | |
Ying Wang | 331b22d | 2014-11-24 12:42:09 -0800 | [diff] [blame] | 281 | # Install the symlinks. |
| 282 | LOCAL_POST_INSTALL_CMD := $(hide) $(foreach t,$(ALL_TOOLS),ln -sf toybox $(TARGET_OUT)/bin/$(t);) |
Elliott Hughes | d8d2d3c | 2014-11-20 10:39:27 -0800 | [diff] [blame] | 283 | |
Ying Wang | 331b22d | 2014-11-24 12:42:09 -0800 | [diff] [blame] | 284 | include $(BUILD_EXECUTABLE) |