Fix incorrect paths in LICENSE.txt and improve wording slightly.
[0ad.git] / build / workspaces / clean-workspaces.sh
blobc5881d72cf78527321ea2bda5a8c6d0cc1765c69
1 #!/bin/sh
3 # Some of our makefiles depend on GNU make, so we set some sane defaults if MAKE
4 # is not set.
5 case "`uname -s`" in
6 "FreeBSD" | "OpenBSD" )
7 MAKE=${MAKE:="gmake"}
8 ;;
9 * )
10 MAKE=${MAKE:="make"}
12 esac
14 # Check the preserve-libs CL option
15 preserve_libs=false
17 for i in "$@"; do
18 case "$i" in
19 --preserve-libs ) preserve_libs=true ;;
20 esac
21 done
23 # (We don't attempt to clean up every last file here - output in
24 # binaries/system/ will still be there, etc. This is mostly just
25 # to quickly fix problems in the bundled dependencies.)
27 cd "$(dirname $0)"
28 # Now in build/workspaces/ (where we assume this script resides)
30 if [ "$preserve_libs" != "true" ]; then
31 echo "Cleaning bundled third-party dependencies..."
33 (cd ../../libraries/source/fcollada/src && rm -rf ./output)
34 (cd ../../libraries/source/fcollada && rm -f .already-built)
35 (cd ../../libraries/source/nvtt/src && rm -rf ./build)
36 (cd ../../libraries/source/nvtt && rm -f .already-built)
37 (cd ../../libraries/source/spidermonkey && rm -f .already-built)
38 (cd ../../libraries/source/spidermonkey && rm -rf ./lib/*.a && rm -rf ./lib/*.so)
39 (cd ../../libraries/source/spidermonkey && rm -rf ./include-unix-debug)
40 (cd ../../libraries/source/spidermonkey && rm -rf ./include-unix-release)
41 (cd ../../libraries/source/spidermonkey && rm -rf ./mozjs-68.12.1)
44 # Still delete the directory of previous SpiderMonkey versions to
45 # avoid wasting disk space if people clean workspaces after updating.
46 (cd ../../libraries/source/spidermonkey && rm -rf ./mozjs-62.9.1)
47 (cd ../../libraries/source/spidermonkey && rm -rf ./mozjs-52.9.1pre1)
48 (cd ../../libraries/source/spidermonkey && rm -rf ./mozjs-45.0.2)
49 (cd ../../libraries/source/spidermonkey && rm -rf ./mozjs-38.0.0)
50 (cd ../../libraries/source/spidermonkey && rm -rf ./mozjs-38.0.0)
51 (cd ../../libraries/source/spidermonkey && rm -rf ./mozjs31)
52 (cd ../../libraries/source/spidermonkey && rm -rf ./mozjs24)
54 # Delete former premake5 gmake.* directories
55 (cd ../premake/premake5/build && rm -rf ./gmake.bsd)
56 (cd ../premake/premake5/build && rm -rf ./gmake.macosx)
57 (cd ../premake/premake5/build && rm -rf ./gmake.unix)
59 # Cleanup current premake directories
60 (cd ../premake/premake5/build/gmake2.bsd && ${MAKE} clean)
61 (cd ../premake/premake5/build/gmake2.macosx && ${MAKE} clean)
62 (cd ../premake/premake5/build/gmake2.unix && ${MAKE} clean)
64 echo "Removing generated stub and test files..."
66 find ../../source -name "stub_*.cpp" -type f -exec rm {} \;
67 find ../../source -name "test_*.cpp" -type f -not -name "test_setup.cpp" -exec rm {} \;
69 echo "Cleaning build output..."
71 # Remove workspaces/gcc if present
72 rm -rf ./gcc
73 # Remove workspaces/codeblocks if present
74 rm -rf ./codeblocks
75 # Remove workspaces/xcode3 if present
76 rm -rf ./xcode3
77 # Remove workspaces/xcode4 if present
78 rm -rf ./xcode4
80 echo
81 echo "Done. Try running update-workspaces.sh again now."