summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@cryptonomic.net>2021-10-07 17:44:44 -0400
committerAndrew Cady <d@cryptonomic.net>2021-10-08 04:01:58 -0400
commit90085bacc47ea92cbec6622f9678fc3233e7536f (patch)
treeb69d746de544532a7318b70ab7ba5177c734a868
parent19043546f68da0ba42463723b2a2d6e562db5619 (diff)
"make install" will use sudo
-rw-r--r--Makefile5
1 files changed, 5 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 1942852..3fcaea9 100644
--- a/Makefile
+++ b/Makefile
@@ -54,6 +54,10 @@ cscope.out:
54clean: 54clean:
55 rm -f $(OBJECTS) $(EXECUTABLES) cscope.out gitversion.h 55 rm -f $(OBJECTS) $(EXECUTABLES) cscope.out gitversion.h
56 56
57ifneq ($(shell id -u),0)
58install:
59 sudo MAKEFLAGS=$(MAKEFLAGS) -- $(MAKE) install
60else
57install: tuntox_nostatic 61install: tuntox_nostatic
58 install -d -m755 $(DESTDIR)$(bindir) $(DESTDIR)$(etcdir) 62 install -d -m755 $(DESTDIR)$(bindir) $(DESTDIR)$(etcdir)
59 install -d -m700 $(DESTDIR)$(etcdir)/tuntox 63 install -d -m700 $(DESTDIR)$(etcdir)/tuntox
@@ -65,6 +69,7 @@ ifeq ($(SKIP_SYSTEMCTL),)
65 systemctl restart tuntox 69 systemctl restart tuntox
66 systemctl status tuntox 70 systemctl status tuntox
67endif 71endif
72endif
68 73
69.PHONY: install-debs debs 74.PHONY: install-debs debs
70install-debs: $(DEBS) 75install-debs: $(DEBS)