diff options
-rwxr-xr-x | clean | 21 |
1 files changed, 15 insertions, 6 deletions
@@ -1,8 +1,17 @@ -#!/bin/sh +#!/bin/bash + if command -v redo-targets >/dev/null 2>&1; then - redo-targets | tr '\n' '\0' | xargs -r0 rm -f -else - find . -type f \( -name '*.o' -o -name '*.inc' -o -name '*.tool' \) \ - -exec rm -f {} + - rm -f .vars.rc all compile_flags.txt libpack test test_gen + mapfile -t targets < <(redo-targets) fi + +rm -f .vars.rc all compile_commands.json libpack test test_gen +find . -type f \ + \( -name '*.cmd' -o -name '*.inc' -o -name '*.o' -o -name '*.tool' \) \ + -delete + +for t in "${targets[@]}"; do + if [ -e "$t" ]; then + echo "$0: Missed '$t'. Removing!" >&2 + rm "$t" + fi +done |