-
Notifications
You must be signed in to change notification settings - Fork 4
/
builder.sh
executable file
·36 lines (31 loc) · 923 Bytes
/
builder.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
#!/bin/bash
GDB_VERSION=$1
TARGETARCH=$2
echo "Start build buildroot"
cd buildroot
make clean
cp ../config/${TARGETARCH}-config .config
make
export PATH=`pwd`/output/host/bin:$PATH
tar -zcvf ${TARGETARCH}-linux-buildroot.tar.gz output/host/*
cp ${TARGETARCH}-linux-buildroot.tar.gz /releases/
cd ..
echo "Start build gdb"
HOMEDIR=`pwd`
wget https://ftp.gnu.org/gnu/gdb/gdb-${GDB_VERSION}.tar.gz
tar xf gdb-${GDB_VERSION}.tar.gz
cd gdb-${GDB_VERSION}
mkdir build
mkdir out
cd build
../configure\
--prefix=${HOMEDIR}/gdb-${GDB_VERSION}/out\
--program-prefix=${TARGETARCH}-linux-${GDB_VERSION}-\
--host=${TARGETARCH}-linux
make -j16 all-gdbserver CFLAGS=-static CXXFLAGS=-static
make install-strip-gdbserver
cd ../out/bin
tar -zcvf ${TARGETARCH}-linux-${GDB_VERSION}-gdbserver.tar.gz *
cp ${TARGETARCH}-linux-${GDB_VERSION}-gdbserver.tar.gz /releases/
cd ${HOMEDIR}
rm -rf gdb-${GDB_VERSION} gdb-${GDB_VERSION}.tar.gz