OSDN Git Service

Keep using the BSD grep/egrep/fgrep for now.
[android-x86/external-toybox.git] / Android.mk
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/base64.c \
62     toys/other/blkid.c \
63     toys/other/blockdev.c \
64     toys/other/bzcat.c \
65     toys/other/chroot.c \
66     toys/other/chvt.c \
67     toys/other/clear.c \
68     toys/other/dos2unix.c \
69     toys/other/fallocate.c \
70     toys/other/free.c \
71     toys/other/freeramdisk.c \
72     toys/other/fsfreeze.c \
73     toys/other/help.c \
74     toys/other/ifconfig.c \
75     toys/other/inotifyd.c \
76     toys/other/insmod.c \
77     toys/other/losetup.c \
78     toys/other/lsattr.c \
79     toys/other/lsmod.c \
80     toys/other/lspci.c \
81     toys/other/lsusb.c \
82     toys/other/makedevs.c \
83     toys/other/mkswap.c \
84     toys/other/modinfo.c \
85     toys/other/mountpoint.c \
86     toys/other/nbd_client.c \
87     toys/other/netcat.c \
88     toys/other/partprobe.c \
89     toys/other/pivot_root.c \
90     toys/other/pmap.c \
91     toys/other/printenv.c \
92     toys/other/pwdx.c \
93     toys/other/readlink.c \
94     toys/other/realpath.c \
95     toys/other/rev.c \
96     toys/other/rfkill.c \
97     toys/other/rmmod.c \
98     toys/other/setsid.c \
99     toys/other/stat.c \
100     toys/other/swapoff.c \
101     toys/other/swapon.c \
102     toys/other/switch_root.c \
103     toys/other/sysctl.c \
104     toys/other/tac.c \
105     toys/other/taskset.c \
106     toys/other/timeout.c \
107     toys/other/truncate.c \
108     toys/other/unshare.c \
109     toys/other/usleep.c \
110     toys/other/vconfig.c \
111     toys/other/vmstat.c \
112     toys/other/which.c \
113     toys/other/yes.c \
114     toys/pending/chcon.c \
115     toys/pending/dd.c \
116     toys/pending/getenforce.c \
117     toys/pending/hwclock.c \
118     toys/pending/more.c \
119     toys/pending/ps.c \
120     toys/pending/netstat.c \
121     toys/pending/route.c \
122     toys/pending/setenforce.c \
123     toys/pending/top.c \
124     toys/pending/tr.c \
125     toys/pending/traceroute.c \
126     toys/posix/basename.c \
127     toys/posix/cal.c \
128     toys/posix/cat.c \
129     toys/posix/chgrp.c \
130     toys/posix/chmod.c \
131     toys/posix/cksum.c \
132     toys/posix/cmp.c \
133     toys/posix/comm.c \
134     toys/posix/cp.c \
135     toys/posix/cut.c \
136     toys/posix/date.c \
137     toys/posix/df.c \
138     toys/posix/dirname.c \
139     toys/posix/du.c \
140     toys/posix/echo.c \
141     toys/posix/env.c \
142     toys/posix/expand.c \
143     toys/posix/false.c \
144     toys/posix/find.c \
145     toys/posix/grep.c \
146     toys/posix/head.c \
147     toys/posix/id.c \
148     toys/posix/kill.c \
149     toys/posix/ln.c \
150     toys/posix/ls.c \
151     toys/posix/mkdir.c \
152     toys/posix/mkfifo.c \
153     toys/posix/nice.c \
154     toys/posix/nl.c \
155     toys/posix/nohup.c \
156     toys/posix/od.c \
157     toys/posix/paste.c \
158     toys/posix/patch.c \
159     toys/posix/pwd.c \
160     toys/posix/renice.c \
161     toys/posix/rm.c \
162     toys/posix/rmdir.c \
163     toys/posix/sed.c \
164     toys/posix/sleep.c \
165     toys/posix/sort.c \
166     toys/posix/split.c \
167     toys/posix/strings.c \
168     toys/posix/tail.c \
169     toys/posix/tee.c \
170     toys/posix/time.c \
171     toys/posix/touch.c \
172     toys/posix/true.c \
173     toys/posix/tty.c \
174     toys/posix/uname.c \
175     toys/posix/uniq.c \
176     toys/posix/wc.c \
177     toys/posix/xargs.c \
178
179 LOCAL_CFLAGS += \
180     -Os \
181     -Wno-char-subscripts \
182     -Wno-sign-compare \
183     -Wno-uninitialized \
184     -Wno-unused-parameter \
185     -funsigned-char \
186     -ffunction-sections -fdata-sections \
187     -fno-asynchronous-unwind-tables \
188
189 LOCAL_SHARED_LIBRARIES := libselinux
190
191 LOCAL_MODULE := toybox
192
193 # dupes: df du ls mount nc netcat renice touch umount
194 # useless?: chvt freeramdisk fsfreeze install makedevs mkfifo mktemp nbd-client
195 #           partprobe pivot_root pwdx rev rfkill switch_root tty unshare vconfig
196 # prefer efs2progs instead?: blkid chattr lsattr
197
198 ALL_TOOLS := \
199     acpi \
200     basename \
201     blockdev \
202     bzcat \
203     cal \
204     cat \
205     chcon \
206     chgrp \
207     chmod \
208     chown \
209     chroot \
210     cksum \
211     clear \
212     comm \
213     cmp \
214     cp \
215     cut \
216     date \
217     dirname \
218     dmesg \
219     dos2unix \
220     echo \
221     env \
222     expand \
223     fallocate \
224     false \
225     find \
226     free \
227     getenforce \
228     groups \
229     head \
230     hostname \
231     hwclock \
232     id \
233     ifconfig \
234     inotifyd \
235     insmod \
236     kill \
237     killall \
238     ln \
239     logname \
240     losetup \
241     lsmod \
242     lspci \
243     lsusb \
244     md5sum \
245     mkdir \
246     mknod \
247     mkswap \
248     modinfo \
249     more \
250     mountpoint \
251     mv \
252     netstat \
253     nice \
254     nl \
255     nohup \
256     od \
257     paste \
258     patch \
259     pidof \
260     pmap \
261     printenv \
262     pwd \
263     readlink \
264     realpath \
265     rm \
266     rmdir \
267     rmmod \
268     sed \
269     seq \
270     setenforce \
271     setsid \
272     sha1sum \
273     sleep \
274     sort \
275     split \
276     stat \
277     strings \
278     swapoff \
279     swapon \
280     sync \
281     sysctl \
282     tac \
283     tail \
284     taskset \
285     tee \
286     time \
287     timeout \
288     tr \
289     true \
290     truncate \
291     uname \
292     uniq \
293     unix2dos \
294     usleep \
295     vmstat \
296     wc \
297     which \
298     whoami \
299     xargs \
300     yes \
301
302 # Install the symlinks.
303 LOCAL_POST_INSTALL_CMD := $(hide) $(foreach t,$(ALL_TOOLS),ln -sf toybox $(TARGET_OUT)/bin/$(t);)
304
305 include $(BUILD_EXECUTABLE)