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 <jan@janware.com>
This commit is contained in:
Jan Lindemann 2025-12-12 09:44:29 +01:00
commit 31108fc608

View file

@ -111,8 +111,12 @@ else
LINK_LIB = $(LOG_INSTALL_SH) -L -l $(INSTALL_LOG) $(LOG_INSTALL_EXTRA_OPTS)
else
ifndef INSTALL
ifeq ($(DEVELOPMENT),false)
INSTALL = $(SUDO) install
else
INSTALL = install
endif
endif
ifndef LINK_LIB
LINK_LIB = $(LOG_INSTALL_SH) -L
endif