From c502072cd7ee1691b8cd426c8b23a091613378b3 Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Wed, 14 Jul 2021 17:11:29 +0100 Subject: Remove need for test.o.do by adding @BUILD_DEP directive --- default.o.do | 4 +++- test.c | 1 + test.o.do | 4 ---- 3 files changed, 4 insertions(+), 5 deletions(-) delete mode 100755 test.o.do diff --git a/default.o.do b/default.o.do index 121c3c0..16e98a0 100755 --- a/default.o.do +++ b/default.o.do @@ -1,4 +1,6 @@ #!/bin/bash -e -redo-ifchange .compile .parse-depfile "${1%.o}.c" +src=${1%.o}.c +redo-ifchange .compile .parse-depfile "$src" +sed -n 's|.*@BUILD_DEP \(.*\)|\1|p' "$src" | tr '\n' '\0' | xargs -0 redo-ifchange . ./.compile ./.parse-depfile "${1%.o}.d" | tr '\n' '\0' | xargs -0 redo-ifchange diff --git a/test.c b/test.c index 5e68887..5d4eb7e 100644 --- a/test.c +++ b/test.c @@ -74,6 +74,7 @@ static bool do_check_bufequal(const char *file, int line, void *a_, void *b_, si return false; } +// @BUILD_DEP test.inc #include "test.inc" TEST(unpack_simple0_float, "unpack simple float") diff --git a/test.o.do b/test.o.do deleted file mode 100755 index f90e621..0000000 --- a/test.o.do +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -redo-ifchange "test.inc" -set -- "$1" "${2%.o}" "$3" -. ./default.o.do -- cgit v1.2.3-54-g00ecf