OSDN Git Service

Regenerate generated files.
[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/landley/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 #
37 # To add a toy:
38 #
39
40 #  make menuconfig
41 #  # (Select the toy you want to add.)
42 #  make clean && make  # Regenerate the generated files.
43 #  # Edit LOCAL_SRC_FILES below to add the toy.
44 #  # If you just want to use it as "toybox x" rather than "x", you can stop now.
45 #  # If you want this toy to have a symbolic link in /system/bin, add the toy to ALL_TOOLS.
46
47 include $(CLEAR_VARS)
48
49 LOCAL_SRC_FILES := \
50     lib/args.c \
51     lib/dirtree.c \
52     lib/getmountlist.c \
53     lib/help.c \
54     lib/interestingtimes.c \
55     lib/lib.c \
56     lib/llist.c \
57     lib/net.c \
58     lib/portability.c \
59     lib/xwrap.c \
60     main.c \
61     toys/android/getenforce.c \
62     toys/android/getprop.c \
63     toys/android/load_policy.c \
64     toys/android/restorecon.c \
65     toys/android/runcon.c \
66     toys/android/setenforce.c \
67     toys/android/setprop.c \
68     toys/lsb/dmesg.c \
69     toys/lsb/hostname.c \
70     toys/lsb/killall.c \
71     toys/lsb/md5sum.c \
72     toys/lsb/mknod.c \
73     toys/lsb/mktemp.c \
74     toys/lsb/mount.c \
75     toys/lsb/pidof.c \
76     toys/lsb/seq.c \
77     toys/lsb/sync.c \
78     toys/lsb/umount.c \
79     toys/other/acpi.c \
80     toys/other/base64.c \
81     toys/other/blkid.c \
82     toys/other/blockdev.c \
83     toys/other/bzcat.c \
84     toys/other/chcon.c \
85     toys/other/chroot.c \
86     toys/other/clear.c \
87     toys/other/dos2unix.c \
88     toys/other/fallocate.c \
89     toys/other/free.c \
90     toys/other/freeramdisk.c \
91     toys/other/fsfreeze.c \
92     toys/other/help.c \
93     toys/other/ifconfig.c \
94     toys/other/inotifyd.c \
95     toys/other/insmod.c \
96     toys/other/losetup.c \
97     toys/other/lsattr.c \
98     toys/other/lsmod.c \
99     toys/other/lspci.c \
100     toys/other/lsusb.c \
101     toys/other/makedevs.c \
102     toys/other/mkswap.c \
103     toys/other/modinfo.c \
104     toys/other/mountpoint.c \
105     toys/other/nbd_client.c \
106     toys/other/netcat.c \
107     toys/other/partprobe.c \
108     toys/other/pivot_root.c \
109     toys/other/pmap.c \
110     toys/other/printenv.c \
111     toys/other/pwdx.c \
112     toys/other/readlink.c \
113     toys/other/realpath.c \
114     toys/other/rev.c \
115     toys/other/rfkill.c \
116     toys/other/rmmod.c \
117     toys/other/setsid.c \
118     toys/other/stat.c \
119     toys/other/swapoff.c \
120     toys/other/swapon.c \
121     toys/other/switch_root.c \
122     toys/other/sysctl.c \
123     toys/other/tac.c \
124     toys/other/taskset.c \
125     toys/other/timeout.c \
126     toys/other/truncate.c \
127     toys/other/usleep.c \
128     toys/other/vconfig.c \
129     toys/other/vmstat.c \
130     toys/other/which.c \
131     toys/other/yes.c \
132     toys/pending/dd.c \
133     toys/pending/expr.c \
134     toys/pending/hwclock.c \
135     toys/pending/more.c \
136     toys/pending/pgrep.c \
137     toys/pending/netstat.c \
138     toys/pending/route.c \
139     toys/pending/tar.c \
140     toys/pending/top.c \
141     toys/pending/tr.c \
142     toys/pending/traceroute.c \
143     toys/posix/basename.c \
144     toys/posix/cal.c \
145     toys/posix/cat.c \
146     toys/posix/chgrp.c \
147     toys/posix/chmod.c \
148     toys/posix/cksum.c \
149     toys/posix/cmp.c \
150     toys/posix/comm.c \
151     toys/posix/cp.c \
152     toys/posix/cpio.c \
153     toys/posix/cut.c \
154     toys/posix/date.c \
155     toys/posix/df.c \
156     toys/posix/dirname.c \
157     toys/posix/du.c \
158     toys/posix/echo.c \
159     toys/posix/env.c \
160     toys/posix/expand.c \
161     toys/posix/false.c \
162     toys/posix/find.c \
163     toys/posix/grep.c \
164     toys/posix/head.c \
165     toys/posix/id.c \
166     toys/posix/kill.c \
167     toys/posix/ln.c \
168     toys/posix/ls.c \
169     toys/posix/mkdir.c \
170     toys/posix/mkfifo.c \
171     toys/posix/nice.c \
172     toys/posix/nl.c \
173     toys/posix/nohup.c \
174     toys/posix/od.c \
175     toys/posix/paste.c \
176     toys/posix/patch.c \
177     toys/posix/printf.c \
178     toys/posix/pwd.c \
179     toys/posix/renice.c \
180     toys/posix/rm.c \
181     toys/posix/rmdir.c \
182     toys/posix/sed.c \
183     toys/posix/sleep.c \
184     toys/posix/sort.c \
185     toys/posix/split.c \
186     toys/posix/strings.c \
187     toys/posix/tail.c \
188     toys/posix/tee.c \
189     toys/posix/time.c \
190     toys/posix/touch.c \
191     toys/posix/true.c \
192     toys/posix/tty.c \
193     toys/posix/uname.c \
194     toys/posix/uniq.c \
195     toys/posix/wc.c \
196     toys/posix/xargs.c \
197
198 LOCAL_CFLAGS += \
199     -std=c99 \
200     -Os \
201     -Wno-char-subscripts \
202     -Wno-sign-compare \
203     -Wno-string-plus-int \
204     -Wno-uninitialized \
205     -Wno-unused-parameter \
206     -funsigned-char \
207     -ffunction-sections -fdata-sections \
208     -fno-asynchronous-unwind-tables \
209
210 toybox_version := $(shell git -C $(LOCAL_PATH) rev-parse --short=12 HEAD 2>/dev/null)-android
211 LOCAL_CFLAGS += -DTOYBOX_VERSION='"$(toybox_version)"'
212
213 LOCAL_CLANG := true
214
215 LOCAL_SHARED_LIBRARIES := libcutils libselinux
216
217 LOCAL_MODULE := toybox
218
219 # dupes: dd df du ls mount renice
220 # useless?: freeramdisk fsfreeze install makedevs mkfifo nbd-client
221 #           partprobe pivot_root pwdx rev rfkill switch_root tty vconfig
222 # prefer BSD netcat instead?: nc netcat
223 # prefer efs2progs instead?: blkid chattr lsattr
224
225 ALL_TOOLS := \
226     acpi \
227     basename \
228     blockdev \
229     bzcat \
230     cal \
231     cat \
232     chcon \
233     chgrp \
234     chmod \
235     chown \
236     chroot \
237     cksum \
238     clear \
239     comm \
240     cmp \
241     cp \
242     cpio \
243     cut \
244     date \
245     dirname \
246     dmesg \
247     dos2unix \
248     echo \
249     env \
250     expand \
251     expr \
252     fallocate \
253     false \
254     find \
255     free \
256     getenforce \
257     getprop \
258     groups \
259     head \
260     hostname \
261     hwclock \
262     id \
263     ifconfig \
264     inotifyd \
265     insmod \
266     kill \
267     killall \
268     load_policy \
269     ln \
270     logname \
271     losetup \
272     lsmod \
273     lspci \
274     lsusb \
275     md5sum \
276     mkdir \
277     mknod \
278     mkswap \
279     mktemp \
280     modinfo \
281     more \
282     mountpoint \
283     mv \
284     netstat \
285     nice \
286     nl \
287     nohup \
288     od \
289     paste \
290     patch \
291     pgrep \
292     pidof \
293     pkill \
294     pmap \
295     printenv \
296     printf \
297     pwd \
298     readlink \
299     realpath \
300     restorecon \
301     rm \
302     rmdir \
303     rmmod \
304     route \
305     runcon \
306     sed \
307     seq \
308     setenforce \
309     setprop \
310     setsid \
311     sha1sum \
312     sleep \
313     sort \
314     split \
315     stat \
316     strings \
317     swapoff \
318     swapon \
319     sync \
320     sysctl \
321     tac \
322     tail \
323     tar \
324     taskset \
325     tee \
326     time \
327     timeout \
328     touch \
329     tr \
330     true \
331     truncate \
332     umount \
333     uname \
334     uniq \
335     unix2dos \
336     usleep \
337     vmstat \
338     wc \
339     which \
340     whoami \
341     xargs \
342     yes \
343
344 # Install the symlinks.
345 LOCAL_POST_INSTALL_CMD := $(hide) $(foreach t,$(ALL_TOOLS),ln -sf toybox $(TARGET_OUT)/bin/$(t);)
346
347 include $(BUILD_EXECUTABLE)