summaryrefslogtreecommitdiff
path: root/Toolchain/BuildIt.sh
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2021-02-21 21:50:29 +0330
committerAndreas Kling <kling@serenityos.org>2021-02-21 23:50:34 +0100
commitbd318dcdcd3bd7c84943acc29dc8c003dd6dc338 (patch)
tree6420947e7e843e7322bb0527d4b2e25b94d6da22 /Toolchain/BuildIt.sh
parent7b156a7add73921ea0a7829dfc9a310d940e02f6 (diff)
downloadserenity-bd318dcdcd3bd7c84943acc29dc8c003dd6dc338.zip
Toolchain: Always remove the previous artifacts when building
Diffstat (limited to 'Toolchain/BuildIt.sh')
-rwxr-xr-xToolchain/BuildIt.sh67
1 files changed, 35 insertions, 32 deletions
diff --git a/Toolchain/BuildIt.sh b/Toolchain/BuildIt.sh
index df14b45be6..6561dea785 100755
--- a/Toolchain/BuildIt.sh
+++ b/Toolchain/BuildIt.sh
@@ -140,47 +140,50 @@ pushd "$DIR/Tarballs"
echo "Skipped downloading gcc"
fi
- if [ ! -d ${BINUTILS_NAME} ]; then
- echo "Extracting binutils..."
- tar -xzf ${BINUTILS_PKG}
-
- 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"
+ if [ -d ${BINUTILS_NAME} ]; then
+ rm -rf "${BINUTILS_NAME}"
+ rm -rf "$DIR/Build/$ARCH/$BINUTILS_NAME"
fi
+ echo "Extracting binutils..."
+ tar -xzf ${BINUTILS_PKG}
+
+ 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
+ $MD5SUM "$DIR"/Patches/binutils.patch > .patch.applied
+ popd
- if [ ! -d $GCC_NAME ]; then
- 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
- popd
- else
- echo "Skipped extracting gcc"
+ if [ -d ${GCC_NAME} ]; then
+ # Drop the previously patched extracted dir
+ rm -rf "${GCC_NAME}"
+ # Also drop the build dir
+ rm -rf "$DIR/Build/$ARCH/$GCC_NAME"
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
pushd "gcc-${GCC_VERSION}"
./contrib/download_prerequisites
popd
fi
-
popd