-
Notifications
You must be signed in to change notification settings - Fork 40
/
buildarm.sh
executable file
·51 lines (40 loc) · 907 Bytes
/
buildarm.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
export ARCH=arm
TARGET=$1
# Sets up toolchain environment variables for arm toolchain
# Tested against armv7-eabihf, glibc from toolchains.free-electrons.com
warn()
{
echo "$1" >&2
}
if [ ! -z $(which arm-linux-gcc) ];
then
export CC=$(which arm-linux-gcc)
else
warn "Not setting CC: can't locate arm-linux-gcc."
fi
if [ ! -z $(which arm-linux-ld) ];
then
export LD=$(which arm-linux-ld)
else
warn "Not setting LD: can't locate arm-linux-ld."
fi
if [ ! -z $(which arm-linux-ar) ];
then
export AR=$(which arm-linux-ar)
else
warn "Not setting AR: can't locate arm-linux-ar."
fi
if [ ! -z $(which arm-linux-strip) ];
then
export STRIP=$(which arm-linux-strip)
else
warn "Not setting STRIP: can't locate arm-linux-strip."
fi
if [ ! -z $(which arm-linux-nm) ];
then
export NM=$(which arm-linux-nm)
else
warn "Not setting NM: can't lcoate arm-linux-nm."
fi
make $TARGET || exit $?