summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-07-18 12:57:12 +0100
committerdavidovski <david@davidovski.xyz>2022-07-18 12:57:12 +0100
commitb0ef6bc7d3971afb48ebd5becf56737256f2aed5 (patch)
tree9a3f07cb47d0ebedaad1819c67345d740e83b02f
parentd928a64d382cbed095ad7748e09facc9610a1775 (diff)
fixed building shmkv1.8
-rwxr-xr-xbuild.shmk1
-rw-r--r--src/lib/xitui.sh2
-rwxr-xr-xsrc/util/shmk.sh14
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)