mirror of
https://github.com/zardus/ctf-tools
synced 2024-12-04 18:29:26 +00:00
gdb install script: remove build artifacts and strip gdb binary after build to save some disk space
This commit is contained in:
parent
985c884a96
commit
407a2a80d6
1 changed files with 16 additions and 2 deletions
18
gdb/install
18
gdb/install
|
@ -13,17 +13,31 @@ find_latest_gdb_version() {
|
||||||
}
|
}
|
||||||
|
|
||||||
VERSION=$(find_latest_gdb_version)
|
VERSION=$(find_latest_gdb_version)
|
||||||
|
echo $VERSION > gdb_version
|
||||||
|
|
||||||
|
rm -rf "gdb" || true
|
||||||
curl "https://ftp.gnu.org/gnu/gdb/gdb-$VERSION.tar.gz" | tar xz
|
curl "https://ftp.gnu.org/gnu/gdb/gdb-$VERSION.tar.gz" | tar xz
|
||||||
cd "gdb-$VERSION"
|
mv "gdb-$VERSION" "gdb"
|
||||||
|
|
||||||
|
set +x
|
||||||
# move to ctftools virtual env
|
# move to ctftools virtual env
|
||||||
source ctf-tools-venv-activate
|
source ctf-tools-venv-activate
|
||||||
|
set -x
|
||||||
|
|
||||||
|
PREFIX=$(pwd)
|
||||||
|
|
||||||
|
pushd ./gdb
|
||||||
./configure \
|
./configure \
|
||||||
--prefix=$(dirname $PWD) \
|
--prefix=$PREFIX \
|
||||||
--with-python=$(which python) \
|
--with-python=$(which python) \
|
||||||
--enable-targets=all \
|
--enable-targets=all \
|
||||||
--with-guile=guile-2.0
|
--with-guile=guile-2.0
|
||||||
make -j $(nproc)
|
make -j $(nproc)
|
||||||
make install
|
make install
|
||||||
|
# remove build artifacts
|
||||||
|
make clean
|
||||||
|
popd
|
||||||
|
|
||||||
|
# reduce binary size a little...
|
||||||
|
strip bin/gdb || true
|
||||||
|
strip bin/gdbserver || true
|
||||||
|
|
Loading…
Reference in a new issue