summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2025-10-20 13:00:11 +0000
committerIan C <ianc@noddybox.co.uk>2025-10-20 13:00:11 +0000
commit85c6b0ce41e21898adeeb9a9435954426213b964 (patch)
treede4f7647d566a00b94e94a3b999cecea5a49dc95
parent89f09a372368674669b8577151475bbc66a832b1 (diff)
Made sdf.build work a bit better with subdirectoriesHEADmaster
-rwxr-xr-xsdf.build10
1 files changed, 3 insertions, 7 deletions
diff --git a/sdf.build b/sdf.build
index 068415a..621656e 100755
--- a/sdf.build
+++ b/sdf.build
@@ -3,22 +3,18 @@
name=$(basename $0)
if [ -z "$1" ] ; then
- echo $name: usage $name dir
+ echo "$name: usage $name dir"
exit 1
fi
-if [ "$(echo $1 | grep / | grep -v grep)" ] ; then
- echo $name: use the script from the parent directory of the thing to build
- exit 1;
-fi
-
build=/tmp/$$.build
+target=$(echo $1 | sed 's+/.*$++')
cp -r $1 $build
cd $build
make
cd -
-cp $build/$1 $1
+cp $build/$target $1
rm -rf $build