OSDN Git Service

Add modprobe am: 488b539f0d am: be70774a16
[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:refs/for/master  # Push to gerrit for review.
30 #  git push aosp HEAD:master  # Push directly, avoiding gerrit.
31 #
32 #  # Now commit any necessary Android.mk changes like normal:
33 #  repo start post-sync .
34 #  git commit -a
35
36
37 #
38 # To add a toy:
39 #
40
41 #  Edit .config to enable 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/linestack.c \
57     lib/llist.c \
58     lib/net.c \
59     lib/portability.c \
60     lib/xwrap.c \
61     main.c \
62     toys/android/getenforce.c \
63     toys/android/getprop.c \
64     toys/android/load_policy.c \
65     toys/android/log.c \
66     toys/android/restorecon.c \
67     toys/android/runcon.c \
68     toys/android/sendevent.c \
69     toys/android/setenforce.c \
70     toys/android/setprop.c \
71     toys/android/start.c \
72     toys/lsb/dmesg.c \
73     toys/lsb/hostname.c \
74     toys/lsb/killall.c \
75     toys/lsb/md5sum.c \
76     toys/lsb/mknod.c \
77     toys/lsb/mktemp.c \
78     toys/lsb/mount.c \
79     toys/lsb/pidof.c \
80     toys/lsb/seq.c \
81     toys/lsb/sync.c \
82     toys/lsb/umount.c \
83     toys/net/ifconfig.c \
84     toys/net/microcom.c \
85     toys/net/netcat.c \
86     toys/net/netstat.c \
87     toys/net/rfkill.c \
88     toys/net/tunctl.c \
89     toys/other/acpi.c \
90     toys/other/base64.c \
91     toys/other/blkid.c \
92     toys/other/blockdev.c \
93     toys/other/bzcat.c \
94     toys/other/chcon.c \
95     toys/other/chroot.c \
96     toys/other/clear.c \
97     toys/other/dos2unix.c \
98     toys/other/fallocate.c \
99     toys/other/flock.c \
100     toys/other/free.c \
101     toys/other/freeramdisk.c \
102     toys/other/fsfreeze.c \
103     toys/other/help.c \
104     toys/other/hwclock.c \
105     toys/other/inotifyd.c \
106     toys/other/insmod.c \
107     toys/other/ionice.c \
108     toys/other/losetup.c \
109     toys/other/lsattr.c \
110     toys/other/lsmod.c \
111     toys/other/lsusb.c \
112     toys/other/makedevs.c \
113     toys/other/mkswap.c \
114     toys/other/modinfo.c \
115     toys/other/mountpoint.c \
116     toys/other/nbd_client.c \
117     toys/other/partprobe.c \
118     toys/other/pivot_root.c \
119     toys/other/pmap.c \
120     toys/other/printenv.c \
121     toys/other/pwdx.c \
122     toys/other/readlink.c \
123     toys/other/realpath.c \
124     toys/other/rev.c \
125     toys/other/rmmod.c \
126     toys/other/setsid.c \
127     toys/other/stat.c \
128     toys/other/swapoff.c \
129     toys/other/swapon.c \
130     toys/other/sysctl.c \
131     toys/other/tac.c \
132     toys/other/taskset.c \
133     toys/other/timeout.c \
134     toys/other/truncate.c \
135     toys/other/uptime.c \
136     toys/other/usleep.c \
137     toys/other/vconfig.c \
138     toys/other/vmstat.c \
139     toys/other/which.c \
140     toys/other/xxd.c \
141     toys/other/yes.c \
142     toys/pending/chrt.c \
143     toys/pending/dd.c \
144     toys/pending/expr.c \
145     toys/pending/getfattr.c \
146     toys/pending/lsof.c \
147     toys/pending/modprobe.c \
148     toys/pending/more.c \
149     toys/pending/setfattr.c \
150     toys/pending/tar.c \
151     toys/pending/tr.c \
152     toys/pending/traceroute.c \
153     toys/posix/basename.c \
154     toys/posix/cal.c \
155     toys/posix/cat.c \
156     toys/posix/chgrp.c \
157     toys/posix/chmod.c \
158     toys/posix/cksum.c \
159     toys/posix/cmp.c \
160     toys/posix/comm.c \
161     toys/posix/cp.c \
162     toys/posix/cpio.c \
163     toys/posix/cut.c \
164     toys/posix/date.c \
165     toys/posix/df.c \
166     toys/posix/dirname.c \
167     toys/posix/du.c \
168     toys/posix/echo.c \
169     toys/posix/env.c \
170     toys/posix/expand.c \
171     toys/posix/false.c \
172     toys/posix/file.c \
173     toys/posix/find.c \
174     toys/posix/grep.c \
175     toys/posix/head.c \
176     toys/posix/id.c \
177     toys/posix/kill.c \
178     toys/posix/ln.c \
179     toys/posix/ls.c \
180     toys/posix/mkdir.c \
181     toys/posix/mkfifo.c \
182     toys/posix/nice.c \
183     toys/posix/nl.c \
184     toys/posix/nohup.c \
185     toys/posix/od.c \
186     toys/posix/paste.c \
187     toys/posix/patch.c \
188     toys/posix/printf.c \
189     toys/posix/ps.c \
190     toys/posix/pwd.c \
191     toys/posix/renice.c \
192     toys/posix/rm.c \
193     toys/posix/rmdir.c \
194     toys/posix/sed.c \
195     toys/posix/sleep.c \
196     toys/posix/sort.c \
197     toys/posix/split.c \
198     toys/posix/strings.c \
199     toys/posix/tail.c \
200     toys/posix/tee.c \
201     toys/posix/time.c \
202     toys/posix/touch.c \
203     toys/posix/true.c \
204     toys/posix/tty.c \
205     toys/posix/ulimit.c \
206     toys/posix/uname.c \
207     toys/posix/uniq.c \
208     toys/posix/uudecode.c \
209     toys/posix/uuencode.c \
210     toys/posix/wc.c \
211     toys/posix/xargs.c \
212
213 LOCAL_CFLAGS += \
214     -std=c99 \
215     -Os \
216     -Wno-char-subscripts \
217     -Wno-sign-compare \
218     -Wno-string-plus-int \
219     -Wno-uninitialized \
220     -Wno-unused-parameter \
221     -funsigned-char \
222     -ffunction-sections -fdata-sections \
223     -fno-asynchronous-unwind-tables \
224
225 toybox_upstream_version := $(shell awk 'match($$0, /TOYBOX_VERSION.*"(.*)"/, ary) {print ary[1]}' $(LOCAL_PATH)/main.c)
226 toybox_sha := $(shell git -C $(LOCAL_PATH) rev-parse --short=12 HEAD 2>/dev/null)
227
228 toybox_version := $(toybox_upstream_version)-$(toybox_sha)-android
229 LOCAL_CFLAGS += -DTOYBOX_VERSION='"$(toybox_version)"'
230
231 LOCAL_CLANG := true
232
233 LOCAL_SHARED_LIBRARIES := liblog libcutils libselinux libcrypto
234
235 # This doesn't actually prevent us from dragging in libc++ at runtime
236 # because libnetd_client.so is C++.
237 LOCAL_CXX_STL := none
238
239 LOCAL_MODULE := toybox
240
241 # dupes: dd
242 # useless?: freeramdisk fsfreeze install makedevs mkfifo nbd-client
243 #           partprobe pivot_root pwdx rev rfkill vconfig
244 # prefer BSD netcat instead?: nc netcat
245 # prefer efs2progs instead?: blkid chattr lsattr
246
247 ALL_TOOLS := \
248     acpi \
249     base64 \
250     basename \
251     blockdev \
252     bzcat \
253     cal \
254     cat \
255     chcon \
256     chgrp \
257     chmod \
258     chown \
259     chroot \
260     chrt \
261     cksum \
262     clear \
263     comm \
264     cmp \
265     cp \
266     cpio \
267     cut \
268     date \
269     df \
270     dirname \
271     dmesg \
272     dos2unix \
273     du \
274     echo \
275     env \
276     expand \
277     expr \
278     fallocate \
279     false \
280     file \
281     find \
282     flock \
283     free \
284     getenforce \
285     getprop \
286     groups \
287     head \
288     hostname \
289     hwclock \
290     id \
291     ifconfig \
292     inotifyd \
293     insmod \
294     ionice \
295     iorenice \
296     kill \
297     killall \
298     load_policy \
299     ln \
300     log \
301     logname \
302     losetup \
303     ls \
304     lsmod \
305     lsof \
306     lsusb \
307     md5sum \
308     mkdir \
309     mknod \
310     mkswap \
311     mktemp \
312     microcom \
313     modinfo \
314     modprobe \
315     more \
316     mount \
317     mountpoint \
318     mv \
319     netstat \
320     nice \
321     nl \
322     nohup \
323     od \
324     paste \
325     patch \
326     pgrep \
327     pidof \
328     pkill \
329     pmap \
330     printenv \
331     printf \
332     ps \
333     pwd \
334     readlink \
335     realpath \
336     renice \
337     restorecon \
338     rm \
339     rmdir \
340     rmmod \
341     runcon \
342     sed \
343     sendevent \
344     seq \
345     setenforce \
346     setprop \
347     setsid \
348     sha1sum \
349     sha224sum \
350     sha256sum \
351     sha384sum \
352     sha512sum \
353     sleep \
354     sort \
355     split \
356     start \
357     stat \
358     stop \
359     strings \
360     swapoff \
361     swapon \
362     sync \
363     sysctl \
364     tac \
365     tail \
366     tar \
367     taskset \
368     tee \
369     time \
370     timeout \
371     top \
372     touch \
373     tr \
374     true \
375     truncate \
376     tty \
377     ulimit \
378     umount \
379     uname \
380     uniq \
381     unix2dos \
382     uptime \
383     usleep \
384     uudecode \
385     uuencode \
386     vmstat \
387     wc \
388     which \
389     whoami \
390     xargs \
391     xxd \
392     yes \
393
394 # Install the symlinks.
395 LOCAL_POST_INSTALL_CMD := $(hide) $(foreach t,$(ALL_TOOLS),ln -sf toybox $(TARGET_OUT)/bin/$(t);)
396
397 include $(BUILD_EXECUTABLE)