From 90085bacc47ea92cbec6622f9678fc3233e7536f Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Thu, 7 Oct 2021 17:44:44 -0400 Subject: "make install" will use sudo --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index 1942852..3fcaea9 100644 --- a/Makefile +++ b/Makefile @@ -54,6 +54,10 @@ cscope.out: clean: rm -f $(OBJECTS) $(EXECUTABLES) cscope.out gitversion.h +ifneq ($(shell id -u),0) +install: + sudo MAKEFLAGS=$(MAKEFLAGS) -- $(MAKE) install +else install: tuntox_nostatic install -d -m755 $(DESTDIR)$(bindir) $(DESTDIR)$(etcdir) install -d -m700 $(DESTDIR)$(etcdir)/tuntox @@ -65,6 +69,7 @@ ifeq ($(SKIP_SYSTEMCTL),) systemctl restart tuntox systemctl status tuntox endif +endif .PHONY: install-debs debs install-debs: $(DEBS) -- cgit v1.2.3