From e0b775d4d799969e678675b9a2589cae140fc9cb Mon Sep 17 00:00:00 2001 From: Dustin Falgout Date: Sun, 12 Feb 2017 03:40:32 -0600 Subject: [PATCH] update Makefile --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3427e5a..58dd2fb 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ DO := ./build/utils.sh SET_CONFIG := $(DO) set-config DESTDIR ?= / +MAYBE_SUDO := '' define colorecho @tput setaf 118 || true @@ -16,6 +17,10 @@ decorated := True stays_on_top := False endif +ifeq ($(DESTDIR),/) +MAYBE_SUDO := sudo +endif + # Configuration: Use values from command line if provided, default values otherwise. at_spi_service ?= True @@ -59,7 +64,7 @@ clean: $(DO) clean install: build - sudo $(DO) install $(DESTDIR) + $(MAYBE_SUDO) $(DO) install $(DESTDIR) $(call colorecho, SUCCESS!)