From 4a4ff7a416cba297ef1172bcdf44ed69b9178033 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sat, 1 Feb 2025 09:48:18 +0700 Subject: make: derive GOBIN using "go env GOBIN" The environment variable GOBIN may not set by user explicitly. --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 14976ed..bc043b3 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ ## SPDX-License-Identifier: GPL-3.0-or-later VERSION:=$(shell git describe --tags) +ENV_GOBIN:=$(shell go env GOBIN) LDFLAGS:=-ldflags "-s -w -X 'git.sr.ht/~shulhan/ciigo.Version=$(VERSION)'" DIR_BUILD:=_bin @@ -21,7 +22,7 @@ test: .PHONY: install install: build - mv _bin/ciigo $(GOBIN) + mv _bin/ciigo $(ENV_GOBIN) .PHONY: run-example run-example: -- cgit v1.3