add DESTDIR support in make
This commit is contained in:
1 parent
c021e8e6c2
commit
b666285bd8
1 file changed
+6
-5
@@ -1,6 +1,7 @@
|
||||
PREFIX ?= /usr
|
||||
DESTDIR ?=
|
||||
BINARY=qulay
|
||||
SRC=main.go
|
||||
PREFIX=/usr
|
||||
|
||||
.PHONY: all clean install uninstall deps
|
||||
|
||||
@@ -11,12 +12,12 @@ deps:
|
||||
go mod tidy
|
||||
|
||||
install: all
|
||||
install -Dm755 $(BINARY) $(PREFIX)/bin/$(BINARY)
|
||||
@echo "qulay installed to $(PREFIX)/bin"
|
||||
install -Dm755 $(BINARY) $(DESTDIR)$(PREFIX)/bin/$(BINARY)
|
||||
@echo "qulay installed to $(DESTDIR)$(PREFIX)/bin"
|
||||
|
||||
uninstall:
|
||||
rm -f $(PREFIX)/bin/$(BINARY)
|
||||
@echo "qulay removed from $(PREFIX)/bin"
|
||||
rm -f $(DESTDIR)$(PREFIX)/bin/$(BINARY)
|
||||
@echo "qulay removed from $(DESTDIR)$(PREFIX)/bin"
|
||||
|
||||
clean:
|
||||
rm -f $(BINARY)
|
||||
Reference in new issue
Block a user