aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Kramkowski <tk@the-tk.com>2021-07-18 13:10:55 +0100
committerTomasz Kramkowski <tk@the-tk.com>2021-07-18 13:10:55 +0100
commit311ca1db4ad68c7fb8b993640fda0de057387f2d (patch)
tree26e1eb5be4c84df07210654dadc69556f7acc709
parent6e0b9525916b59e6053ec4dc2cb1b0e96c55afcb (diff)
downloadpack-311ca1db4ad68c7fb8b993640fda0de057387f2d.tar.gz
pack-311ca1db4ad68c7fb8b993640fda0de057387f2d.tar.xz
pack-311ca1db4ad68c7fb8b993640fda0de057387f2d.zip
Do not store .d files permanently. Use tempfiles
-rwxr-xr-x.compile.do2
-rwxr-xr-xclean2
-rwxr-xr-xdefault.o.do4
3 files changed, 5 insertions, 3 deletions
diff --git a/.compile.do b/.compile.do
index a249c44..6634b55 100755
--- a/.compile.do
+++ b/.compile.do
@@ -4,5 +4,5 @@ redo-ifchange .vars.rc
exec >"$3"
echo "# generated by $0"
declare -p CC CFLAGS CPPFLAGS
-echo '"$CC" -MMD -MF "${1%.o}.d" "${CFLAGS[@]}" "${CPPFLAGS[@]}" -c -o "$3" "${1%.o}.c"'
+echo '"$CC" -MMD -MF "$depfile" "${CFLAGS[@]}" "${CPPFLAGS[@]}" -c -o "$3" "${1%.o}.c"'
if command -v redo-stamp &>/dev/null; then redo-stamp <"$3"; fi
diff --git a/clean b/clean
index 2cb5f16..8797998 100755
--- a/clean
+++ b/clean
@@ -1,3 +1,3 @@
#!/bin/sh
-find . -type f \( -name '*.d' -o -name '*.o' -o -name '*.inc' \) -exec rm -f {} +
+find . -type f \( -name '*.o' -o -name '*.inc' \) -exec rm -f {} +
rm -f .compile .link-executable .link-library .vars.rc all compile_flags.txt libpack.so test test_gen
diff --git a/default.o.do b/default.o.do
index c457bc5..c7e415b 100755
--- a/default.o.do
+++ b/default.o.do
@@ -2,5 +2,7 @@
src=${1%.o}.c
redo-ifchange .compile .parse-depfile "$src"
sed -n 's|.*@BUILD_DEP \(.*\)|\1|p' "$src" | tr '\n' '\0' | xargs -r0 redo-ifchange
+depfile=$(mktemp)
. ./.compile
-./.parse-depfile "${1%.o}.d" | tr '\n' '\0' | xargs -r0 redo-ifchange
+./.parse-depfile "$depfile" | tr '\n' '\0' | xargs -r0 redo-ifchange
+rm "$depfile"