From 31108fc60820af52aa673e9a0673deafb78e2b17 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Fri, 12 Dec 2025 09:44:29 +0100 Subject: [PATCH] defs.mk: Allow INSTALL = $(SUDO) install Running "make install" from an arbitrary source directory currently by default either installs to a user-accessible ENV_PREFIX, or, if DEVELOPMENT is set to false, tries to install into the system's root filesystem, but fails over permission errors. This was by design: To now, I considered trying the latter ill-conceived, because installing without package manager control bears the risk of leaving unversioned files in the system. Actually, thinking again, during development this looks like a valid use case: Having run pkg-rebuild-reinstall before, installing from a source directory will leave a trace in the package manager's hash check output, will be handled during the next clean install, and might be a useful shortcut for trying things in the root file system. So make this possible by: $ DEVELOPMENT=false make install Signed-off-by: Jan Lindemann --- make/defs.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/make/defs.mk b/make/defs.mk index 8f71cd7b..d9653ecf 100644 --- a/make/defs.mk +++ b/make/defs.mk @@ -111,7 +111,11 @@ else LINK_LIB = $(LOG_INSTALL_SH) -L -l $(INSTALL_LOG) $(LOG_INSTALL_EXTRA_OPTS) else ifndef INSTALL - INSTALL = install + ifeq ($(DEVELOPMENT),false) + INSTALL = $(SUDO) install + else + INSTALL = install + endif endif ifndef LINK_LIB LINK_LIB = $(LOG_INSTALL_SH) -L