1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:47:35 +00:00

Toolchain: Always remove the previous artifacts when building

This commit is contained in:
AnotherTest 2021-02-21 21:50:29 +03:30 committed by Andreas Kling
parent 7b156a7add
commit bd318dcdcd

View file

@ -140,47 +140,50 @@ pushd "$DIR/Tarballs"
echo "Skipped downloading gcc" echo "Skipped downloading gcc"
fi fi
if [ ! -d ${BINUTILS_NAME} ]; then if [ -d ${BINUTILS_NAME} ]; then
echo "Extracting binutils..." rm -rf "${BINUTILS_NAME}"
tar -xzf ${BINUTILS_PKG} rm -rf "$DIR/Build/$ARCH/$BINUTILS_NAME"
pushd ${BINUTILS_NAME}
if [ "$git_patch" = "1" ]; then
git init > /dev/null
git add . > /dev/null
git commit -am "BASE" > /dev/null
git apply "$DIR"/Patches/binutils.patch > /dev/null
else
patch -p1 < "$DIR"/Patches/binutils.patch > /dev/null
fi
popd
else
echo "Skipped extracting binutils"
fi fi
echo "Extracting binutils..."
tar -xzf ${BINUTILS_PKG}
if [ ! -d $GCC_NAME ]; then pushd ${BINUTILS_NAME}
echo "Extracting gcc..." if [ "$git_patch" = "1" ]; then
tar -xzf $GCC_PKG git init > /dev/null
pushd $GCC_NAME git add . > /dev/null
if [ "$git_patch" = "1" ]; then git commit -am "BASE" > /dev/null
git init > /dev/null git apply "$DIR"/Patches/binutils.patch > /dev/null
git add . > /dev/null else
git commit -am "BASE" > /dev/null patch -p1 < "$DIR"/Patches/binutils.patch > /dev/null
git apply "$DIR"/Patches/gcc.patch > /dev/null fi
else $MD5SUM "$DIR"/Patches/binutils.patch > .patch.applied
patch -p1 < "$DIR/Patches/gcc.patch" > /dev/null popd
fi
popd if [ -d ${GCC_NAME} ]; then
else # Drop the previously patched extracted dir
echo "Skipped extracting gcc" rm -rf "${GCC_NAME}"
# Also drop the build dir
rm -rf "$DIR/Build/$ARCH/$GCC_NAME"
fi fi
echo "Extracting gcc..."
tar -xzf $GCC_PKG
pushd $GCC_NAME
if [ "$git_patch" = "1" ]; then
git init > /dev/null
git add . > /dev/null
git commit -am "BASE" > /dev/null
git apply "$DIR"/Patches/gcc.patch > /dev/null
else
patch -p1 < "$DIR/Patches/gcc.patch" > /dev/null
fi
$MD5SUM "$DIR/Patches/gcc.patch" > .patch.applied
popd
if [ "$(uname)" = "Darwin" ]; then if [ "$(uname)" = "Darwin" ]; then
pushd "gcc-${GCC_VERSION}" pushd "gcc-${GCC_VERSION}"
./contrib/download_prerequisites ./contrib/download_prerequisites
popd popd
fi fi
popd popd