OSDN Git Service

Switch to toybox date, and add hwclock.
[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 -ffunction-sections -fdata-sections -fno-asynchronous-unwind-tables \
186
187 LOCAL_SHARED_LIBRARIES := libselinux
188
189 LOCAL_MODULE := toybox
190
191 # dupes: chown cmp df du grep id ls
192 #        mount nc netcat renice
193 #        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     chroot \
209     cksum \
210     clear \
211     comm \
212     cp \
213     cut \
214     date \
215     dirname \
216     dmesg \
217     dos2unix \
218     echo \
219     egrep \
220     env \
221     expand \
222     fallocate \
223     false \
224     fgrep \
225     find \
226     free \
227     getenforce \
228     groups \
229     head \
230     hostname \
231     hwclock \
232     ifconfig \
233     inotifyd \
234     insmod \
235     kill \
236     killall \
237     ln \
238     logname \
239     losetup \
240     lsmod \
241     lspci \
242     lsusb \
243     md5sum \
244     mkdir \
245     mknod \
246     mkswap \
247     modinfo \
248     more \
249     mountpoint \
250     mv \
251     netstat \
252     nice \
253     nl \
254     nohup \
255     od \
256     paste \
257     patch \
258     pidof \
259     pmap \
260     printenv \
261     pwd \
262     readlink \
263     realpath \
264     rm \
265     rmdir \
266     rmmod \
267     sed \
268     seq \
269     setenforce \
270     setsid \
271     sha1sum \
272     sleep \
273     sort \
274     split \
275     stat \
276     strings \
277     swapoff \
278     swapon \
279     sync \
280     sysctl \
281     tac \
282     tail \
283     taskset \
284     tee \
285     time \
286     timeout \
287     tr \
288     true \
289     truncate \
290     uname \
291     uniq \
292     unix2dos \
293     usleep \
294     vmstat \
295     wc \
296     which \
297     whoami \
298     xargs \
299     yes \
300
301 # Install the symlinks.
302 LOCAL_POST_INSTALL_CMD := $(hide) $(foreach t,$(ALL_TOOLS),ln -sf toybox $(TARGET_OUT)/bin/$(t);)
303
304 include $(BUILD_EXECUTABLE)