Skip to content
This repository was archived by the owner on May 22, 2019. It is now read-only.

Commit e0b775d

Browse files
committed
update Makefile
1 parent d8f97f2 commit e0b775d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Makefile

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
DO := ./build/utils.sh
44
SET_CONFIG := $(DO) set-config
55
DESTDIR ?= /
6+
MAYBE_SUDO := ''
67

78
define colorecho
89
@tput setaf 118 || true
@@ -16,6 +17,10 @@ decorated := True
1617
stays_on_top := False
1718
endif
1819

20+
ifeq ($(DESTDIR),/)
21+
MAYBE_SUDO := sudo
22+
endif
23+
1924

2025
# Configuration: Use values from command line if provided, default values otherwise.
2126
at_spi_service ?= True
@@ -59,7 +64,7 @@ clean:
5964
$(DO) clean
6065

6166
install: build
62-
sudo $(DO) install $(DESTDIR)
67+
$(MAYBE_SUDO) $(DO) install $(DESTDIR)
6368
$(call colorecho, SUCCESS!)
6469

6570

0 commit comments

Comments
 (0)