aboutsummaryrefslogtreecommitdiffstats
path: root/GNUmakefile
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2023-08-29 23:47:41 +0200
committerRobin Jarry <robin@jarry.cc>2023-08-30 22:10:10 +0200
commitab7d32c1fe5182a7a7631bb4dc35bed49af752c0 (patch)
tree356eaa9e825e79734378a54a2b6aa1178db0b016 /GNUmakefile
parentf1bb4767b04a84432cd8abd59d987a57b3cdbb7a (diff)
downloadaerc-ab7d32c1fe5182a7a7631bb4dc35bed49af752c0.tar.gz
mk: evaluate variables with $(shell)
Now that we use GNU make, instead of deferred evaluation when running the target commands, use $(shell) to evaluate commands when parsing the makefile and print prettier build commands. Before: go build -trimpath `contrib/goflags.sh` -ldflags \ "-X main.Version=`git describe --long --abbrev=12 --tags --dirty 2>/dev/null || echo 0.15.2` \ -X main.Flags=$(echo -- `contrib/goflags.sh` | base64 | tr -d '\r\n') \ -X git.sr.ht/~rjarry/aerc/config.shareDir=/usr/local/share/aerc \ -X git.sr.ht/~rjarry/aerc/config.libexecDir=/usr/local/libexec/aerc" \ -o aerc After: go build -trimpath -tags=notmuch -ldflags \ "-X main.Version=0.15.2-174-gf25e038dacd7-dirty \ -X main.Flags=LS0gLXRhZ3M9bm90bXVjaAo= \ -X git.sr.ht/~rjarry/aerc/config.shareDir=/usr/local/share/aerc \ -X git.sr.ht/~rjarry/aerc/config.libexecDir=/usr/local/libexec/aerc" \ -o aerc Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile6
1 files changed, 3 insertions, 3 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 71aa2704..7704fcdb 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -1,17 +1,17 @@
# variables that can be changed by users
#
-VERSION ?= `git describe --long --abbrev=12 --tags --dirty 2>/dev/null || echo 0.15.2`
+VERSION ?= $(shell git describe --long --abbrev=12 --tags --dirty 2>/dev/null || echo 0.15.2)
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
SHAREDIR ?= $(PREFIX)/share/aerc
LIBEXECDIR ?= $(PREFIX)/libexec/aerc
MANDIR ?= $(PREFIX)/share/man
GO ?= go
-GOFLAGS ?= `contrib/goflags.sh`
+GOFLAGS ?= $(shell contrib/goflags.sh)
BUILD_OPTS ?= -trimpath
GO_LDFLAGS :=
GO_LDFLAGS += -X main.Version=$(VERSION)
-GO_LDFLAGS += -X main.Flags=$$(echo -- $(GOFLAGS) | base64 | tr -d '\r\n')
+GO_LDFLAGS += -X main.Flags=$(shell echo -- $(GOFLAGS) | base64 | tr -d '\r\n')
GO_LDFLAGS += -X git.sr.ht/~rjarry/aerc/config.shareDir=$(SHAREDIR)
GO_LDFLAGS += -X git.sr.ht/~rjarry/aerc/config.libexecDir=$(LIBEXECDIR)
GO_LDFLAGS += $(GO_EXTRA_LDFLAGS)