From 1bfd9a05a71e3ec729b65ff040a2496b7b1f8a23 Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Thu, 5 Aug 2021 11:27:24 +0100 Subject: .parse-deps: No longer executable, called with sed -f as #!/usr/bin/sed is not portable, it is easier to just use sed -f --- .licignore | 2 +- .parse-deps | 17 ----------------- .parse-deps.sed | 16 ++++++++++++++++ default.o.do | 4 ++-- 4 files changed, 19 insertions(+), 20 deletions(-) delete mode 100755 .parse-deps create mode 100644 .parse-deps.sed diff --git a/.licignore b/.licignore index 4ac0ff0..c35173f 100644 --- a/.licignore +++ b/.licignore @@ -1,7 +1,7 @@ *.do .gitignore .licignore -.parse-deps +.parse-deps.sed LICENSE README.md clean diff --git a/.parse-deps b/.parse-deps deleted file mode 100755 index e8dc74b..0000000 --- a/.parse-deps +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/sed -f -# remove target -1s/^[^:]*: // -# collapse lines -:loop -/\\$/ { - s|///*|/|g - s|$|//| - N - s|\\//. *|| - b loop -} -# split on unescaped spaces -s/\([^\]\) */\1\ -/g -# unescape spaces -s/\\ / /g diff --git a/.parse-deps.sed b/.parse-deps.sed new file mode 100644 index 0000000..488782d --- /dev/null +++ b/.parse-deps.sed @@ -0,0 +1,16 @@ +# remove target +1s/^[^:]*: // +# collapse lines +:loop +/\\$/ { + s|///*|/|g + s|$|//| + N + s|\\//. *|| + b loop +} +# split on unescaped spaces +s/\([^\]\) */\1\ +/g +# unescape spaces +s/\\ / /g diff --git a/default.o.do b/default.o.do index 2a21e84..75a77d8 100755 --- a/default.o.do +++ b/default.o.do @@ -2,6 +2,6 @@ set -e redo-ifchg-pipe() { tr '\n' '\0' | xargs -r0 redo-ifchange; } src=${1%.o}.c -redo-ifchange .compile .parse-deps "$src" +redo-ifchange .compile .parse-deps.sed "$src" sed -n 's|.*@BUILD_DEP \(.*\)|\1|p' "$src" | redo-ifchg-pipe -. ./.compile | ./.parse-deps | redo-ifchg-pipe +. ./.compile | sed -f .parse-deps.sed | redo-ifchg-pipe -- cgit v1.2.3-54-g00ecf