summaryrefslogtreecommitdiff
path: root/build/unix/build_clean
diff options
context:
space:
mode:
authorneonloop2021-05-07 20:00:12 +0000
committerneonloop2021-05-07 20:00:12 +0000
commit7f6002caba3f0a6749820c2772161caf55b8d267 (patch)
tree1ed4bdd8c9ac897d1a3f77c223c1fd286dded458 /build/unix/build_clean
downloaduqm-7f6002caba3f0a6749820c2772161caf55b8d267.tar.gz
uqm-7f6002caba3f0a6749820c2772161caf55b8d267.tar.bz2
uqm-7f6002caba3f0a6749820c2772161caf55b8d267.zip
Initial commit (uqm-0.8.0)
Diffstat (limited to 'build/unix/build_clean')
-rw-r--r--build/unix/build_clean29
1 files changed, 29 insertions, 0 deletions
diff --git a/build/unix/build_clean b/build/unix/build_clean
new file mode 100644
index 0000000..ffc7440
--- /dev/null
+++ b/build/unix/build_clean
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+# Find all the .c, .cpp, .m, and .rc files which are relevant for the project,
+# and remove their respective object files in the work directory.
+
+# Expected to be passed from the environment:
+# BUILD_PROJECT - the name of the project
+# BUILD_ROOT - The root of the source files.
+# BUILD_WORK - The root of the work directory.
+
+BUILD_ROOT=${BUILD_ROOT%/}/
+BUILD_WORK=${BUILD_WORK%/}/
+eval OBJDIR=\"${BUILD_WORK}\${${BUILD_PROJECT}_OBJS}\"
+
+. "${BUILD_ROOT}Makeproject"
+
+build/unix/recurse "$BUILD_PROJECT" "$BUILD_ROOT" | \
+ while read TYPE FILE; do
+ case "$TYPE" in
+ C|CXX|M|RC)
+ rm -f -- "${OBJDIR}${REC_PREFIX}$FILE.d" \
+ "${OBJDIR}${FILE}.o"
+ ;;
+ DIROUT)
+ rmdir -- "${OBJDIR}${FILE}" 2> /dev/null
+ ;;
+ esac
+done
+