From 01438f00d44adf33f59da729b347eca60cb461a8 Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Fri, 6 Aug 2021 15:53:53 +0100 Subject: implement do-link to simplify linking .do files --- do-link | 8 ++++++++ libpack.do | 6 +----- test.do | 6 +----- test_gen.do | 6 +----- 4 files changed, 11 insertions(+), 15 deletions(-) create mode 100755 do-link diff --git a/do-link b/do-link new file mode 100755 index 0000000..189e899 --- /dev/null +++ b/do-link @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -e +type=$1 +. "$2" # .do file which we are "interpreting" +redo-ifchange "$0" "link-$type.tool" "${objects[@]}" +shift 2 +. "./link-$type.tool" +"${cmd[@]}" diff --git a/libpack.do b/libpack.do index ae5f746..9fa753d 100755 --- a/libpack.do +++ b/libpack.do @@ -1,6 +1,2 @@ -#!/usr/bin/env bash -set -e +#!./do-link library objects=(common.o pack.o trace.o unpack.o ieee754b.o) -redo-ifchange link-library.tool "${objects[@]}" -. ./link-library.tool -"${cmd[@]}" diff --git a/test.do b/test.do index 483411f..5ebdb6e 100755 --- a/test.do +++ b/test.do @@ -1,6 +1,2 @@ -#!/usr/bin/env bash -set -e +#!./do-link executable objects=(common.o pack.o test.o trace.o unpack.o ieee754b.o) -redo-ifchange link-executable.tool "${objects[@]}" -. ./link-executable.tool -"${cmd[@]}" diff --git a/test_gen.do b/test_gen.do index e879f8f..cffe9df 100755 --- a/test_gen.do +++ b/test_gen.do @@ -1,6 +1,2 @@ -#!/usr/bin/env bash -set -e +#!./do-link executable-host objects=(test_gen.o) -redo-ifchange link-executable-host.tool "${objects[@]}" -. ./link-executable-host.tool -"${cmd[@]}" -- cgit v1.2.3-54-g00ecf