From cac8b6f4bd9c680b915393b06c19b8facf74f0cc Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Thu, 6 May 2021 17:33:04 +0200 Subject: [PATCH] Makefile: allow overriding the binary executable target dir Distros tend to change this to specific locations (eg. on MVCC installs), therefore introduce a generic environment variable that's a common practise since 30+ years and thus already well known and supported by distros. Signed-off-by: Enrico Weigelt, metux IT consult --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 29f3aea3e..99641a6fd 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,7 @@ ROOTDIR=$(dir $(abspath $(lastword $(MAKEFILE_LIST)))) # The files will be installed under `$(DESTDIR)/$(PREFIX)`. # The convention of `DESTDIR` was changed in containerd v1.6. PREFIX ?= /usr/local +BINDIR ?= $(PREFIX)/bin DATADIR ?= $(PREFIX)/share MANDIR ?= $(DATADIR)/man @@ -408,12 +409,12 @@ clean-test: ## clean up debris from previously failed tests install: ## install binaries @echo "$(WHALE) $@ $(BINARIES)" - @$(INSTALL) -d $(DESTDIR)$(PREFIX)/bin - @$(INSTALL) $(BINARIES) $(DESTDIR)$(PREFIX)/bin + @$(INSTALL) -d $(DESTDIR)$(BINDIR) + @$(INSTALL) $(BINARIES) $(DESTDIR)$(BINDIR) uninstall: @echo "$(WHALE) $@" - @rm -f $(addprefix $(DESTDIR)$(PREFIX)/bin/,$(notdir $(BINARIES))) + @rm -f $(addprefix $(DESTDIR)$(BINDIR)/,$(notdir $(BINARIES))) ifeq ($(GOOS),windows) install-deps: