File: do-arm-tk

package info (click to toggle)
picolibc 1.8.11-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 50,064 kB
  • sloc: ansic: 404,031; asm: 24,984; sh: 2,585; python: 2,289; perl: 680; pascal: 329; exp: 287; makefile: 222; cpp: 71; xml: 40
file content (116 lines) | stat: -rwxr-xr-x 3,573 bytes parent folder | download
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/bin/bash
PICOLIBC=$(realpath $(dirname "$0")/..)
case "$ARM_TK":"$AARCH64_TK" in
    ?*:?*)
	;;
    *)
	echo "Need to set ARM_TK and AARCH64_TK before running $0"
	exit 1
	;;
esac
README_ARM="$ARM_TK/share/doc/arm-none-eabi/readme.txt"
README_AARCH64="$AARCH64_TK/share/doc/aarch64-none-elf/readme.txt"
if [ ! -f  "$README_ARM" ]; then
    echo "ARM_TK '$ARM_TK' doesn't appear valid?"
    exit 1
fi
if [ ! -f  "$README_AARCH64" ]; then
    echo "AARCH64_TK '$AARCH64_TK' doesn't appear valid?"
    exit 1
fi
TK_VERSION_ARM=$(head -n 1 "$README_ARM" | awk '{ print $NF; }')
TK_VERSION_AARCH64=$(head -n 1 "$README_AARCH64" | awk '{ print $NF; }')
PICOLIBC_VERSION=$(cd "$PICOLIBC" && git describe)
echo Arm Toolkit "$TK_VERSION_ARM"
echo Aarch64 Toolkit "$TK_VERSION_AARCH64"
echo Picolibc "$PICOLIBC"
echo Picolibc version "$PICOLIBC_VERSION"

case "$TK_VERSION_ARM" in
    [12]*)
	;;
    *)
	echo "Arm Toolkit version '$TK_VERSION_ARM' doesn't appear valid?"
	exit 1
	;;
esac

case "$TK_VERSION_AARCH64" in
    [12]*)
	;;
    *)
	echo "Aarch64 Toolkit version '$TK_VERSION_AARCH64' doesn't appear valid?"
	exit 1
	;;
esac

export PATH=$ARM_TK/bin:$AARCH64_TK/bin:$PATH

MINSIZE_DIR_ARM="$PICOLIBC"/builds/build-arm-tk-minsize
RELEASE_DIR_ARM="$PICOLIBC"/builds/build-arm-tk-release
MINSIZE_DIR_AARCH64="$PICOLIBC"/builds/build-aarch64-tk-minsize
RELEASE_DIR_AARCH64="$PICOLIBC"/builds/build-aarch64-tk-release
export DESTDIR="$PICOLIBC"/builds/dist

rm -r "$MINSIZE_DIR_ARM"
rm -r "$RELEASE_DIR_ARM"
rm -r "$MINSIZE_DIR_AARCH64"
rm -r "$RELEASE_DIR_AARCH64"
rm -r "$DESTDIR"/"$ARM_TK"
rm -r "$DESTDIR"/"$AARCH64_TK"

mkdir -p "$MINSIZE_DIR_ARM" "$RELEASE_DIR_ARM" "$MINSIZE_DIR_AARCH64" "$RELEASE_DIR_AARCH64" "$DESTDIR"

set -e


#build_options=-Dmultilib-exclude=pacbti
build_options=-Ddebug=true

echo '###################################'
echo '####' ../../scripts/do-aarch64-none-elf-configure -Dsysroot-install=true --buildtype=minsize $build_options
echo '###################################'

cd "$MINSIZE_DIR_AARCH64"
../../scripts/do-aarch64-none-elf-configure -Dsysroot-install=true --buildtype=minsize $build_options
ninja test install

echo '###################################'
echo '####' ../../scripts/do-aarch64-none-elf-configure -Dsysroot-install=true -Dbuild-type-subdir=release --buildtype=release $build_options
echo '###################################'

cd "$RELEASE_DIR_AARCH64"
../../scripts/do-aarch64-none-elf-configure -Dsysroot-install=true -Dbuild-type-subdir=release --buildtype=release $build_options
ninja test install

echo '###################################'
echo '####' ../../scripts/do-arm-configure -Dsysroot-install=true --buildtype=minsize $build_options
echo '###################################'

cd "$MINSIZE_DIR_ARM"
../../scripts/do-arm-configure -Dsysroot-install=true --buildtype=minsize $build_options
ninja test install

echo '###################################'
echo '####' ../../scripts/do-arm-configure -Dsysroot-install=true -Dbuild-type-subdir=release --buildtype=release $build_options
echo '###################################'

cd "$RELEASE_DIR_ARM"
../../scripts/do-arm-configure -Dsysroot-install=true -Dbuild-type-subdir=release --buildtype=release $build_options
ninja test install

cd "$DESTDIR"/"$ARM_TK"

ZIP_ARM="$DESTDIR"/picolibc-arm-none-eabi-"$PICOLIBC_VERSION"-"$TK_VERSION_ARM".zip

rm -f "$ZIP_ARM"

zip -r "$ZIP_ARM" .

cd "$DESTDIR"/"$AARCH64_TK"

ZIP_AARCH64="$DESTDIR"/picolibc-aarch64-none-elf-"$PICOLIBC_VERSION"-"$TK_VERSION_AARCH64".zip

rm -f "$ZIP_AARCH64"

zip -r "$ZIP_AARCH64" .