blob: f6bbd6edb23b40d261a677e961dbbf0f53a42485 [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 Hughes53a43da2014-12-11 17:05:54 -0800118 toys/pending/more.c \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800119 toys/posix/basename.c \
120 toys/posix/cal.c \
121 toys/posix/cat.c \
122 toys/posix/chgrp.c \
123 toys/posix/chmod.c \
124 toys/posix/cksum.c \
125 toys/posix/cmp.c \
126 toys/posix/comm.c \
127 toys/posix/cp.c \
128 toys/posix/cpio.c \
129 toys/posix/cut.c \
130 toys/posix/date.c \
131 toys/posix/df.c \
132 toys/posix/dirname.c \
133 toys/posix/du.c \
134 toys/posix/echo.c \
135 toys/posix/env.c \
136 toys/posix/expand.c \
137 toys/posix/false.c \
138 toys/posix/find.c \
139 toys/posix/grep.c \
140 toys/posix/head.c \
141 toys/posix/id.c \
142 toys/posix/kill.c \
143 toys/posix/link.c \
144 toys/posix/ln.c \
145 toys/posix/ls.c \
146 toys/posix/mkdir.c \
147 toys/posix/mkfifo.c \
148 toys/posix/nice.c \
149 toys/posix/nl.c \
150 toys/posix/nohup.c \
151 toys/posix/od.c \
152 toys/posix/paste.c \
153 toys/posix/patch.c \
154 toys/posix/pwd.c \
155 toys/posix/renice.c \
156 toys/posix/rm.c \
157 toys/posix/rmdir.c \
158 toys/posix/sleep.c \
159 toys/posix/sort.c \
160 toys/posix/split.c \
161 toys/posix/strings.c \
162 toys/posix/tail.c \
163 toys/posix/tee.c \
164 toys/posix/time.c \
165 toys/posix/touch.c \
166 toys/posix/true.c \
167 toys/posix/tty.c \
168 toys/posix/uname.c \
169 toys/posix/uniq.c \
170 toys/posix/unlink.c \
171 toys/posix/uudecode.c \
172 toys/posix/uuencode.c \
173 toys/posix/wc.c \
174 toys/posix/xargs.c \
175
176LOCAL_CFLAGS += \
177 -Os \
178 -Wno-char-subscripts \
179 -Wno-sign-compare \
180 -Wno-uninitialized \
181 -Wno-unused-parameter \
182 -funsigned-char -ffunction-sections -fdata-sections -fno-asynchronous-unwind-tables \
183
184LOCAL_MODULE := toybox
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800185
Elliott Hughes5c7cca02014-12-11 12:12:59 -0800186# dupes: cat chown cmp cp date df du grep id ifconfig ls mkdir
Elliott Hughes8f7bc7a2014-11-26 15:21:03 -0800187# mknod mount mv nc netcat notify(inotifyd) renice rm rmdir
Elliott Hughes20800602014-11-25 17:25:05 -0800188# touch umount
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800189# obsolete?: cpio killall5 link unlink
Elliott Hughes10bd49e2014-11-21 14:53:43 -0800190# non-Linux: count freeramdisk fstype nbd-client oneit vconfig
Elliott Hughese3ebdf02014-11-24 14:34:48 -0800191# useless?: chvt fsfreeze install makedevs mkfifo mktemp partprobe pivot_root pwdx rev
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800192# rfkill switch_root tty unshare
193# prefer efs2progs instead?: blkid chattr lsattr
194
195ALL_TOOLS := \
196 acpi \
197 basename \
198 blockdev \
199 bzcat \
200 cal \
201 catv \
202 chgrp \
Elliott Hughes5c7cca02014-12-11 12:12:59 -0800203 chmod \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800204 chroot \
205 cksum \
Elliott Hughes03275a82014-11-22 22:56:47 -0800206 clear \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800207 comm \
208 cut \
209 dirname \
Elliott Hughesc99e20b2014-11-26 11:38:43 -0800210 dmesg \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800211 dos2unix \
212 echo \
213 egrep \
214 env \
215 expand \
216 factor \
217 fallocate \
Elliott Hughes03275a82014-11-22 22:56:47 -0800218 false \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800219 fgrep \
220 find \
221 free \
222 groups \
223 head \
224 hostname \
Elliott Hughes6a646ef2014-11-24 11:41:35 -0800225 insmod \
Elliott Hughes95211ea2014-12-04 20:09:44 -0800226 kill \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800227 killall \
228 ln \
229 logname \
230 losetup \
Elliott Hughes6a646ef2014-11-24 11:41:35 -0800231 lsmod \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800232 lspci \
233 lsusb \
234 md5sum \
Elliott Hughes620bc1a2014-11-24 16:12:40 -0800235 mkswap \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800236 modinfo \
Elliott Hughes53a43da2014-12-11 17:05:54 -0800237 more \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800238 mountpoint \
239 nice \
240 nl \
Elliott Hughes9f989412014-11-25 17:00:40 -0800241 nohup \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800242 od \
243 paste \
244 patch \
245 pidof \
246 pmap \
Elliott Hughes68e18cd2014-11-24 15:36:51 -0800247 printenv \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800248 pwd \
249 readahead \
Elliott Hughes8f7bc7a2014-11-26 15:21:03 -0800250 readlink \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800251 realpath \
Elliott Hughes6a646ef2014-11-24 11:41:35 -0800252 rmmod \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800253 seq \
254 setsid \
255 sha1sum \
Elliott Hughes62cf8d62014-11-24 15:23:04 -0800256 sleep \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800257 sort \
258 split \
259 stat \
260 strings \
Elliott Hughes620bc1a2014-11-24 16:12:40 -0800261 swapoff \
262 swapon \
Elliott Hughes85368282014-11-24 14:53:36 -0800263 sync \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800264 sysctl \
265 tac \
266 tail \
267 taskset \
268 tee \
269 time \
270 timeout \
Elliott Hughes03275a82014-11-22 22:56:47 -0800271 true \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800272 truncate \
273 uname \
274 uniq \
275 unix2dos \
Elliott Hughes10bd49e2014-11-21 14:53:43 -0800276 usleep \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800277 uudecode \
278 uuencode \
Elliott Hughes20800602014-11-25 17:25:05 -0800279 vmstat \
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800280 wc \
281 which \
282 whoami \
283 xargs \
284 yes \
285
Ying Wang331b22d2014-11-24 12:42:09 -0800286# Install the symlinks.
287LOCAL_POST_INSTALL_CMD := $(hide) $(foreach t,$(ALL_TOOLS),ln -sf toybox $(TARGET_OUT)/bin/$(t);)
Elliott Hughesd8d2d3c2014-11-20 10:39:27 -0800288
Ying Wang331b22d2014-11-24 12:42:09 -0800289include $(BUILD_EXECUTABLE)