OSDN Git Service

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