summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@cryptonomic.net>2021-10-24 17:30:55 -0400
committerAndrew Cady <d@cryptonomic.net>2021-10-24 17:30:55 -0400
commit89395ba3f6ea5c91f93033962feff36e67c06efd (patch)
tree7ab4eaca3e23b3e8cd0f2f5cb4ac6adaf82c98ef
parent473f1f61ac0c3489fd3bd357e2b733aafec5715a (diff)
"make install" auto-selects user or root
-rw-r--r--EndoForge/Makefile4
1 files changed, 3 insertions, 1 deletions
diff --git a/EndoForge/Makefile b/EndoForge/Makefile
index db8f77d..0f662d6 100644
--- a/EndoForge/Makefile
+++ b/EndoForge/Makefile
@@ -14,6 +14,8 @@ else
14SUDO = sudo 14SUDO = sudo
15endif 15endif
16 16
17HAVE_ROOT != $(SUDO) true && echo y || true
18
17ROOT_INSTALL = $(SUDO) $(INSTALL) 19ROOT_INSTALL = $(SUDO) $(INSTALL)
18USER != echo "$${SUDO_USER:-$$(id -un)}" 20USER != echo "$${SUDO_USER:-$$(id -un)}"
19SSH_CONFIG_DIR = /etc/ssh 21SSH_CONFIG_DIR = /etc/ssh
@@ -44,7 +46,7 @@ sed \
44 -e 's?PidFile=$$?&$(HOME)/.ssh/sshd.pid?' 46 -e 's?PidFile=$$?&$(HOME)/.ssh/sshd.pid?'
45endef 47endef
46 48
47install: install-user install-root 49install: $(if $(HAVE_ROOT), install-root, install-user)
48 50
49install-user: 51install-user:
50 $(INSTALL) -d ~/.ssh 52 $(INSTALL) -d ~/.ssh