diff options
author | Andrew Cady <d@cryptonomic.net> | 2021-10-24 17:30:55 -0400 |
---|---|---|
committer | Andrew Cady <d@cryptonomic.net> | 2021-10-24 17:30:55 -0400 |
commit | 89395ba3f6ea5c91f93033962feff36e67c06efd (patch) | |
tree | 7ab4eaca3e23b3e8cd0f2f5cb4ac6adaf82c98ef /EndoForge/Makefile | |
parent | 473f1f61ac0c3489fd3bd357e2b733aafec5715a (diff) |
"make install" auto-selects user or root
Diffstat (limited to 'EndoForge/Makefile')
-rw-r--r-- | EndoForge/Makefile | 4 |
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 | |||
14 | SUDO = sudo | 14 | SUDO = sudo |
15 | endif | 15 | endif |
16 | 16 | ||
17 | HAVE_ROOT != $(SUDO) true && echo y || true | ||
18 | |||
17 | ROOT_INSTALL = $(SUDO) $(INSTALL) | 19 | ROOT_INSTALL = $(SUDO) $(INSTALL) |
18 | USER != echo "$${SUDO_USER:-$$(id -un)}" | 20 | USER != echo "$${SUDO_USER:-$$(id -un)}" |
19 | SSH_CONFIG_DIR = /etc/ssh | 21 | SSH_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?' |
45 | endef | 47 | endef |
46 | 48 | ||
47 | install: install-user install-root | 49 | install: $(if $(HAVE_ROOT), install-root, install-user) |
48 | 50 | ||
49 | install-user: | 51 | install-user: |
50 | $(INSTALL) -d ~/.ssh | 52 | $(INSTALL) -d ~/.ssh |