From d1d8d1ae4b82190183e70622c4d7471e55ae28b5 Mon Sep 17 00:00:00 2001 From: Alexey Yerin Date: Sat, 22 Feb 2025 23:38:59 +0300 Subject: Use hare version -vv to get the value of HAREPATH --- Makefile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 1a56721..9b658bb 100644 --- a/Makefile +++ b/Makefile @@ -41,14 +41,21 @@ uninstall4: rm -r "$(DESTDIR)$(THIRDPARTYDIR)/$$mod"; \ done -HAREPATH_CMD = hare version -v | awk 'harepath { gsub(/^\t/, ""); print }; /^HAREPATH/ { harepath = 1 }' | tr '\n' ':' +HAREPATH_ENV_CMD = hare version -vv | grep '^HAREPATH' + +# hare version -vv returns the value of HAREPATH in form +# HAREPATH= +# +# Using eval on that line will set the HAREPATH variable in the environment to +# the unquoted value, which makes it easy to add the bindings directory to the +# path demo: - env HAREPATH="$(BINDINGS_DIR):$$($(HAREPATH_CMD))" \ + eval "$$($(HAREPATH_ENV_CMD))" && env HAREPATH="$(BINDINGS_DIR):$$HAREPATH" \ hare build $$(pkg-config --libs-only-l gtk+-3.0) -o demo cmd/demo demo4: - env HAREPATH="$(BINDINGS_DIR):$$($(HAREPATH_CMD))" \ + eval "$$($(HAREPATH_ENV_CMD))" && env HAREPATH="$(BINDINGS_DIR):$$HAREPATH" \ hare build $$(pkg-config --libs-only-l gtk4) -o demo4 cmd/demo4 clean: -- cgit 1.3.0-6-gf8a5