OSDN Git Service

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/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 #  repo upload .
29 #  git push aosp HEAD:master  # Push directly, avoiding 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/flock.c \
90     toys/other/free.c \
91     toys/other/freeramdisk.c \
92     toys/other/fsfreeze.c \
93     toys/other/help.c \
94     toys/other/hwclock.c \
95     toys/other/ifconfig.c \
96     toys/other/inotifyd.c \
97     toys/other/insmod.c \
98     toys/other/ionice.c \
99     toys/other/losetup.c \
100     toys/other/lsattr.c \
101     toys/other/lsmod.c \
102     toys/other/lsusb.c \
103     toys/other/makedevs.c \
104     toys/other/mkswap.c \
105     toys/other/modinfo.c \
106     toys/other/mountpoint.c \
107     toys/other/nbd_client.c \
108     toys/other/netcat.c \
109     toys/other/partprobe.c \
110     toys/other/pivot_root.c \
111     toys/other/pmap.c \
112     toys/other/printenv.c \
113     toys/other/pwdx.c \
114     toys/other/readlink.c \
115     toys/other/realpath.c \
116     toys/other/rev.c \
117     toys/other/rfkill.c \
118     toys/other/rmmod.c \
119     toys/other/setsid.c \
120     toys/other/stat.c \
121     toys/other/swapoff.c \
122     toys/other/swapon.c \
123     toys/other/switch_root.c \
124     toys/other/sysctl.c \
125     toys/other/tac.c \
126     toys/other/taskset.c \
127     toys/other/timeout.c \
128     toys/other/truncate.c \
129     toys/other/uptime.c \
130     toys/other/usleep.c \
131     toys/other/vconfig.c \
132     toys/other/vmstat.c \
133     toys/other/which.c \
134     toys/other/xxd.c \
135     toys/other/yes.c \
136     toys/pending/dd.c \
137     toys/pending/expr.c \
138     toys/pending/lsof.c \
139     toys/pending/more.c \
140     toys/pending/netstat.c \
141     toys/pending/pgrep.c \
142     toys/pending/route.c \
143     toys/pending/tar.c \
144     toys/pending/top.c \
145     toys/pending/tr.c \
146     toys/pending/traceroute.c \
147     toys/posix/basename.c \
148     toys/posix/cal.c \
149     toys/posix/cat.c \
150     toys/posix/chgrp.c \
151     toys/posix/chmod.c \
152     toys/posix/cksum.c \
153     toys/posix/cmp.c \
154     toys/posix/comm.c \
155     toys/posix/cp.c \
156     toys/posix/cpio.c \
157     toys/posix/cut.c \
158     toys/posix/date.c \
159     toys/posix/df.c \
160     toys/posix/dirname.c \
161     toys/posix/du.c \
162     toys/posix/echo.c \
163     toys/posix/env.c \
164     toys/posix/expand.c \
165     toys/posix/false.c \
166     toys/posix/find.c \
167     toys/posix/grep.c \
168     toys/posix/head.c \
169     toys/posix/id.c \
170     toys/posix/kill.c \
171     toys/posix/ln.c \
172     toys/posix/ls.c \
173     toys/posix/mkdir.c \
174     toys/posix/mkfifo.c \
175     toys/posix/nice.c \
176     toys/posix/nl.c \
177     toys/posix/nohup.c \
178     toys/posix/od.c \
179     toys/posix/paste.c \
180     toys/posix/patch.c \
181     toys/posix/printf.c \
182     toys/posix/pwd.c \
183     toys/posix/renice.c \
184     toys/posix/rm.c \
185     toys/posix/rmdir.c \
186     toys/posix/sed.c \
187     toys/posix/sleep.c \
188     toys/posix/sort.c \
189     toys/posix/split.c \
190     toys/posix/strings.c \
191     toys/posix/tail.c \
192     toys/posix/tee.c \
193     toys/posix/time.c \
194     toys/posix/touch.c \
195     toys/posix/true.c \
196     toys/posix/tty.c \
197     toys/posix/uname.c \
198     toys/posix/uniq.c \
199     toys/posix/wc.c \
200     toys/posix/xargs.c \
201
202 LOCAL_CFLAGS += \
203     -std=c99 \
204     -Os \
205     -Wno-char-subscripts \
206     -Wno-sign-compare \
207     -Wno-string-plus-int \
208     -Wno-uninitialized \
209     -Wno-unused-parameter \
210     -funsigned-char \
211     -ffunction-sections -fdata-sections \
212     -fno-asynchronous-unwind-tables \
213
214 toybox_version := $(shell git -C $(LOCAL_PATH) rev-parse --short=12 HEAD 2>/dev/null)-android
215 LOCAL_CFLAGS += -DTOYBOX_VERSION='"$(toybox_version)"'
216
217 LOCAL_CLANG := true
218
219 LOCAL_SHARED_LIBRARIES := libcutils libselinux
220
221 # This doesn't actually prevent us from dragging in libc++ at runtime
222 # because libnetd_client.so is C++.
223 LOCAL_CXX_STL := none
224
225 LOCAL_MODULE := toybox
226
227 # dupes: dd
228 # useless?: freeramdisk fsfreeze install makedevs mkfifo nbd-client
229 #           partprobe pivot_root pwdx rev rfkill switch_root vconfig
230 # prefer BSD netcat instead?: nc netcat
231 # prefer efs2progs instead?: blkid chattr lsattr
232
233 ALL_TOOLS := \
234     acpi \
235     base64 \
236     basename \
237     blockdev \
238     bzcat \
239     cal \
240     cat \
241     chcon \
242     chgrp \
243     chmod \
244     chown \
245     chroot \
246     cksum \
247     clear \
248     comm \
249     cmp \
250     cp \
251     cpio \
252     cut \
253     date \
254     df \
255     dirname \
256     dmesg \
257     dos2unix \
258     du \
259     echo \
260     env \
261     expand \
262     expr \
263     fallocate \
264     false \
265     find \
266     flock \
267     free \
268     getenforce \
269     getprop \
270     groups \
271     head \
272     hostname \
273     hwclock \
274     id \
275     ifconfig \
276     inotifyd \
277     insmod \
278     ionice \
279     iorenice \
280     kill \
281     load_policy \
282     ln \
283     logname \
284     losetup \
285     ls \
286     lsmod \
287     lsof \
288     lsusb \
289     md5sum \
290     mkdir \
291     mknod \
292     mkswap \
293     mktemp \
294     modinfo \
295     more \
296     mount \
297     mountpoint \
298     mv \
299     netstat \
300     nice \
301     nl \
302     nohup \
303     od \
304     paste \
305     patch \
306     pgrep \
307     pidof \
308     pkill \
309     pmap \
310     printenv \
311     printf \
312     pwd \
313     readlink \
314     realpath \
315     renice \
316     restorecon \
317     rm \
318     rmdir \
319     rmmod \
320     route \
321     runcon \
322     sed \
323     seq \
324     setenforce \
325     setprop \
326     setsid \
327     sha1sum \
328     sleep \
329     sort \
330     split \
331     stat \
332     strings \
333     swapoff \
334     swapon \
335     sync \
336     sysctl \
337     tac \
338     tail \
339     tar \
340     taskset \
341     tee \
342     time \
343     timeout \
344     touch \
345     tr \
346     true \
347     truncate \
348     tty \
349     umount \
350     uname \
351     uniq \
352     unix2dos \
353     uptime \
354     usleep \
355     vmstat \
356     wc \
357     which \
358     whoami \
359     xargs \
360     xxd \
361     yes \
362
363 # Install the symlinks.
364 LOCAL_POST_INSTALL_CMD := $(hide) $(foreach t,$(ALL_TOOLS),ln -sf toybox $(TARGET_OUT)/bin/$(t);)
365
366 include $(BUILD_EXECUTABLE)