summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorhans@chromium.org <hans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-10 01:02:43 +0000
committerhans@chromium.org <hans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-10 01:02:43 +0000
commita5673e17a19af9f11dd41513899121ec1bc5dd89 (patch)
treee950879829ccc89f9ac36990f9679822e2c9bcd3 /tools
parentd5a28e45277c3fb21fdc1b4dca054ce93341fc14 (diff)
downloadchromium_src-a5673e17a19af9f11dd41513899121ec1bc5dd89.zip
chromium_src-a5673e17a19af9f11dd41513899121ec1bc5dd89.tar.gz
chromium_src-a5673e17a19af9f11dd41513899121ec1bc5dd89.tar.bz2
Clang update script: simplify code for file clobbering
This makes the code a lot simpler. BUG=none Review URL: https://codereview.chromium.org/26736002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227848 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rwxr-xr-xtools/clang/scripts/update.sh58
1 files changed, 11 insertions, 47 deletions
diff --git a/tools/clang/scripts/update.sh b/tools/clang/scripts/update.sh
index 76fcf0a..fae1a72 100755
--- a/tools/clang/scripts/update.sh
+++ b/tools/clang/scripts/update.sh
@@ -130,55 +130,19 @@ fi
# To always force a new build if someone interrupts their build half way.
rm -f "${STAMP_FILE}"
-# Clobber pch files, since they only work with the compiler version that
-# created them. Also clobber .o files, to make sure everything will be built
-# with the new compiler.
-if [[ "${OS}" = "Darwin" ]]; then
- XCODEBUILD_DIR="${THIS_DIR}/../../../xcodebuild"
-
- # Xcode groups .o files by project first, configuration second.
- if [[ -d "${XCODEBUILD_DIR}" ]]; then
- echo "Clobbering .o files for Xcode build"
- find "${XCODEBUILD_DIR}" -name '*.o' -exec rm {} +
- echo "Clobbering .dylib files for Xcode build"
- find "${XCODEBUILD_DIR}" -name '*.dylib' -exec rm {} +
- fi
-fi
+# Clobber build files. PCH files only work with the compiler that created them.
+# We delete .o files to make sure all files are built with the new compiler.
+echo "Clobbering build files"
MAKE_DIR="${THIS_DIR}/../../../out"
-
-for CONFIG in Debug Release; do
- if [[ -d "${MAKE_DIR}/${CONFIG}/obj.target" ||
- -d "${MAKE_DIR}/${CONFIG}/obj.host" ]]; then
- echo "Clobbering ${CONFIG} PCH and .o files for make build"
- if [[ -d "${MAKE_DIR}/${CONFIG}/obj.target" ]]; then
- find "${MAKE_DIR}/${CONFIG}/obj.target" -name '*.gch' -exec rm {} +
- find "${MAKE_DIR}/${CONFIG}/obj.target" -name '*.o' -exec rm {} +
- fi
- if [[ -d "${MAKE_DIR}/${CONFIG}/obj.host" ]]; then
- find "${MAKE_DIR}/${CONFIG}/obj.host" -name '*.o' -exec rm {} +
- fi
- fi
-
- # ninja puts its output below ${MAKE_DIR} as well.
- if [[ -d "${MAKE_DIR}/${CONFIG}/obj" ]]; then
- echo "Clobbering ${CONFIG} PCH and .o files for ninja build"
- find "${MAKE_DIR}/${CONFIG}/obj" -name '*.gch' -exec rm {} +
- find "${MAKE_DIR}/${CONFIG}/obj" -name '*.o' -exec rm {} +
- find "${MAKE_DIR}/${CONFIG}/obj" -name '*.o.d' -exec rm {} +
- fi
-
- if [[ -d "${MAKE_DIR}/${CONFIG}" ]]; then
- # See http://crbug.com/304125
- echo "Clobbering ${CONFIG} .dylib files for ninja and make build"
- find "${MAKE_DIR}/${CONFIG}" -name '*.dylib' -exec rm {} +
- fi
-
- if [[ "${OS}" = "Darwin" ]]; then
- if [[ -d "${XCODEBUILD_DIR}/${CONFIG}/SharedPrecompiledHeaders" ]]; then
- echo "Clobbering ${CONFIG} PCH files for Xcode build"
- rm -rf "${XCODEBUILD_DIR}/${CONFIG}/SharedPrecompiledHeaders"
- fi
+XCODEBUILD_DIR="${THIS_DIR}/../../../xcodebuild"
+for DIR in "${XCODEBUILD_DIR}" "${MAKE_DIR}/Debug" "${MAKE_DIR}/Release"; do
+ if [[ -d "${DIR}" ]]; then
+ find "${DIR}" -name '*.o' -exec rm {} +
+ find "${DIR}" -name '*.o.d' -exec rm {} +
+ find "${DIR}" -name '*.gch' -exec rm {} +
+ find "${DIR}" -name '*.dylib' -exec rm {} +
+ find "${DIR}" -name 'SharedPrecompiledHeaders' -exec rm -rf {} +
fi
done