From b0ef6bc7d3971afb48ebd5becf56737256f2aed5 Mon Sep 17 00:00:00 2001 From: davidovski Date: Mon, 18 Jul 2022 12:57:12 +0100 Subject: fixed building shmk --- src/util/shmk.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/util') diff --git a/src/util/shmk.sh b/src/util/shmk.sh index 0174857..a7b0d37 100755 --- a/src/util/shmk.sh +++ b/src/util/shmk.sh @@ -27,10 +27,18 @@ find_file () { } parse_lines () { + included="" while IFS= read -r line; do case "$line" in "#include "*) - cat $(find_file ${line#\#include}) | parse_lines + file="$(find_file ${line#\#include})" + case "$included" in + *"$file"*) + ;; + *) + cat $file | parse_lines + included="$included $file" + esac ;; "#>"*) eval ${line#'#>'} @@ -50,7 +58,7 @@ build_shmk () { [ -f "$1" ] || return 1 [ ! -z "$2" ] && output="$2" [ -z "$output" ] && output=$(basename $1) - output=${output%.*} + output=./${output%.*} $clean && { rm -f $output @@ -91,7 +99,7 @@ interpret_shmk () { lib=$(basename $lib) lib="${lib%.*}" cmdlist="$cmdlist - install -Dm755 $DIST/$lib ${DESTDIR}/${PREFIX}/lib/$lib #Install library $lib" + install -Dm755 $DIST/$lib ${DESTDIR}/${PREFIX}/lib/$lib.sh #Install library $lib" done ;; clean) -- cgit v1.2.1