blob: f65bc0b2f7fd215482b05a2bdfdbf62efc4e8de9 [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#
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
36include $(CLEAR_VARS)
37
38LOCAL_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 Hughesd8d2d3c2014-11-20 10:39:27 -080099 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 \
Elliott Hughes76115632014-12-16 09:14:47 -0800118 toys/pending/chcon.c \
Elliott Hughes53a43da2014-12-11 17:05:54 -0800119 toys/pending/more.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800120 toys/posix/basename.c \
121 toys/posix/cal.c \
122 toys/posix/cat.c \
123 toys/posix/chgrp.c \
124 toys/posix/chmod.c \
125 toys/posix/cksum.c \
126 toys/posix/cmp.c \
127 toys/posix/comm.c \
128 toys/posix/cp.c \
129 toys/posix/cpio.c \
130 toys/posix/cut.c \
131 toys/posix/date.c \
132 toys/posix/df.c \
133 toys/posix/dirname.c \
134 toys/posix/du.c \
135 toys/posix/echo.c \
136 toys/posix/env.c \
137 toys/posix/expand.c \
138 toys/posix/false.c \
139 toys/posix/find.c \
140 toys/posix/grep.c \
141 toys/posix/head.c \
142 toys/posix/id.c \
143 toys/posix/kill.c \
144 toys/posix/link.c \
145 toys/posix/ln.c \
146 toys/posix/ls.c \
147 toys/posix/mkdir.c \
148 toys/posix/mkfifo.c \
149 toys/posix/nice.c \
150 toys/posix/nl.c \
151 toys/posix/nohup.c \
152 toys/posix/od.c \
153 toys/posix/paste.c \
154 toys/posix/patch.c \
155 toys/posix/pwd.c \
156 toys/posix/renice.c \
157 toys/posix/rm.c \
158 toys/posix/rmdir.c \
159 toys/posix/sleep.c \
160 toys/posix/sort.c \
161 toys/posix/split.c \
162 toys/posix/strings.c \
163 toys/posix/tail.c \
164 toys/posix/tee.c \
165 toys/posix/time.c \
166 toys/posix/touch.c \
167 toys/posix/true.c \
168 toys/posix/tty.c \
169 toys/posix/uname.c \
170 toys/posix/uniq.c \
171 toys/posix/unlink.c \
172 toys/posix/uudecode.c \
173 toys/posix/uuencode.c \
174 toys/posix/wc.c \
175 toys/posix/xargs.c \
176
177LOCAL_CFLAGS += \
178 -Os \
179 -Wno-char-subscripts \
180 -Wno-sign-compare \
181 -Wno-uninitialized \
182 -Wno-unused-parameter \
183 -funsigned-char -ffunction-sections -fdata-sections -fno-asynchronous-unwind-tables \
184
Elliott Hughes76115632014-12-16 09:14:47 -0800185LOCAL_SHARED_LIBRARIES := libselinux
186
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800187LOCAL_MODULE := toybox
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800188
Elliott Hughesd13bf6a2014-12-16 15:17:17 -0800189# dupes: cat chown cmp cp date df du grep id ifconfig ls
Elliott Hughesd4a6d662014-12-16 15:26:53 -0800190# mount mv nc netcat notify(inotifyd) renice rm
Elliott Hughes20800602014-11-25 17:25:05 -0800191# touch umount
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800192# obsolete?: cpio killall5 link unlink
Elliott Hughes10bd49e2014-11-21 14:53:43 -0800193# non-Linux: count freeramdisk fstype nbd-client oneit vconfig
Elliott Hughese3ebdf02014-11-24 14:34:48 -0800194# useless?: chvt fsfreeze install makedevs mkfifo mktemp partprobe pivot_root pwdx rev
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800195# rfkill switch_root tty unshare
196# prefer efs2progs instead?: blkid chattr lsattr
197
198ALL_TOOLS := \
199 acpi \
200 basename \
201 blockdev \
202 bzcat \
203 cal \
204 catv \
Elliott Hughes76115632014-12-16 09:14:47 -0800205 chcon \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800206 chgrp \
Elliott Hughes5c7cca02014-12-11 12:12:59 -0800207 chmod \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800208 chroot \
209 cksum \
Elliott Hughes03275a82014-11-22 22:56:47 -0800210 clear \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800211 comm \
212 cut \
213 dirname \
Elliott Hughesc99e20b2014-11-26 11:38:43 -0800214 dmesg \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800215 dos2unix \
216 echo \
217 egrep \
218 env \
219 expand \
220 factor \
221 fallocate \
Elliott Hughes03275a82014-11-22 22:56:47 -0800222 false \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800223 fgrep \
224 find \
225 free \
226 groups \
227 head \
228 hostname \
Elliott Hughes6a646ef2014-11-24 11:41:35 -0800229 insmod \
Elliott Hughes95211ea2014-12-04 20:09:44 -0800230 kill \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800231 killall \
232 ln \
233 logname \
234 losetup \
Elliott Hughes6a646ef2014-11-24 11:41:35 -0800235 lsmod \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800236 lspci \
237 lsusb \
238 md5sum \
Elliott Hughesd13bf6a2014-12-16 15:17:17 -0800239 mkdir \
Elliott Hughes0a0435c2014-12-11 18:34:09 -0800240 mknod \
Elliott Hughes620bc1a2014-11-24 16:12:40 -0800241 mkswap \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800242 modinfo \
Elliott Hughes53a43da2014-12-11 17:05:54 -0800243 more \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800244 mountpoint \
245 nice \
246 nl \
Elliott Hughes9f989412014-11-25 17:00:40 -0800247 nohup \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800248 od \
249 paste \
250 patch \
251 pidof \
252 pmap \
Elliott Hughes68e18cd2014-11-24 15:36:51 -0800253 printenv \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800254 pwd \
255 readahead \
Elliott Hughes8f7bc7a2014-11-26 15:21:03 -0800256 readlink \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800257 realpath \
Elliott Hughesd4a6d662014-12-16 15:26:53 -0800258 rmdir \
Elliott Hughes6a646ef2014-11-24 11:41:35 -0800259 rmmod \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800260 seq \
261 setsid \
262 sha1sum \
Elliott Hughes62cf8d62014-11-24 15:23:04 -0800263 sleep \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800264 sort \
265 split \
266 stat \
267 strings \
Elliott Hughes620bc1a2014-11-24 16:12:40 -0800268 swapoff \
269 swapon \
Elliott Hughes85368282014-11-24 14:53:36 -0800270 sync \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800271 sysctl \
272 tac \
273 tail \
274 taskset \
275 tee \
276 time \
277 timeout \
Elliott Hughes03275a82014-11-22 22:56:47 -0800278 true \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800279 truncate \
280 uname \
281 uniq \
282 unix2dos \
Elliott Hughes10bd49e2014-11-21 14:53:43 -0800283 usleep \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800284 uudecode \
285 uuencode \
Elliott Hughes20800602014-11-25 17:25:05 -0800286 vmstat \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800287 wc \
288 which \
289 whoami \
290 xargs \
291 yes \
292
Ying Wang331b22d2014-11-24 12:42:09 -0800293# Install the symlinks.
294LOCAL_POST_INSTALL_CMD := $(hide) $(foreach t,$(ALL_TOOLS),ln -sf toybox $(TARGET_OUT)/bin/$(t);)
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800295
Ying Wang331b22d2014-11-24 12:42:09 -0800296include $(BUILD_EXECUTABLE)