From b0ef6bc7d3971afb48ebd5becf56737256f2aed5 Mon Sep 17 00:00:00 2001 From: davidovski Date: Mon, 18 Jul 2022 12:57:12 +0100 Subject: fixed building shmk --- build.shmk | 1 - src/lib/xitui.sh | 2 +- src/util/shmk.sh | 14 +++++++++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/build.shmk b/build.shmk index 2ce463d..112de67 100755 --- a/build.shmk +++ b/build.shmk @@ -5,7 +5,6 @@ CC=gcc LIBS="src/lib/*.sh" PROGS=" -hbar src/util/shmk.sh src/util/shtests.sh src/util/parseconf.sh diff --git a/src/lib/xitui.sh b/src/lib/xitui.sh index dcfaf02..bd23bdc 100644 --- a/src/lib/xitui.sh +++ b/src/lib/xitui.sh @@ -24,7 +24,7 @@ #███████ ███████ ███████ ███████ ███████ ███████ ███████ ███████# ################################################################# -. /usr/lib/colors.sh +#include colors COLOR_FG=${WHITE} COLOR_FG2=${LIGHT_BLUE} 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