upd Makefile
This commit is contained in:
parent
a0b5dfe0e6
commit
ea846e9386
10
Makefile
10
Makefile
@ -1,7 +1,7 @@
|
|||||||
BIN := "nexclamation"
|
BIN := "nexclamation"
|
||||||
SYMLINK := "n!"
|
SYMLINK := "n!"
|
||||||
COMPL := "completion"
|
COMPL := "completion"
|
||||||
TMP := "./.installation_prefix"
|
PREF := "./.installation_prefix"
|
||||||
|
|
||||||
all:
|
all:
|
||||||
@echo Nothing to do. Available targets: install, uninstall, set-prefix
|
@echo Nothing to do. Available targets: install, uninstall, set-prefix
|
||||||
@ -12,7 +12,7 @@ all:
|
|||||||
@echo make PREFIX=/your/path install
|
@echo make PREFIX=/your/path install
|
||||||
|
|
||||||
install: set-prefix
|
install: set-prefix
|
||||||
$(eval PREFIX := $(shell cat $(TMP)))
|
$(eval PREFIX := $(shell cat $(PREF)))
|
||||||
@echo Installation PREFIX $(PREFIX)
|
@echo Installation PREFIX $(PREFIX)
|
||||||
COMPDIR="$(PREFIX)/share/bash-completion/completions"; \
|
COMPDIR="$(PREFIX)/share/bash-completion/completions"; \
|
||||||
mkdir -p "$(PREFIX)" && \
|
mkdir -p "$(PREFIX)" && \
|
||||||
@ -23,7 +23,7 @@ install: set-prefix
|
|||||||
@echo Successfully installed
|
@echo Successfully installed
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
$(eval PREFIX := $(shell cat $(TMP)))
|
$(eval PREFIX := $(shell cat $(PREF)))
|
||||||
@echo Installation PREFIX $(PREFIX)
|
@echo Installation PREFIX $(PREFIX)
|
||||||
COMPDIR="$(PREFIX)/share/bash-completion/completions"; \
|
COMPDIR="$(PREFIX)/share/bash-completion/completions"; \
|
||||||
rm -f "$(PREFIX)/bin/$(BIN)" && \
|
rm -f "$(PREFIX)/bin/$(BIN)" && \
|
||||||
@ -33,5 +33,5 @@ uninstall:
|
|||||||
|
|
||||||
set-prefix:
|
set-prefix:
|
||||||
if [ "$$UID" == "0" ]; then \
|
if [ "$$UID" == "0" ]; then \
|
||||||
echo $${PREFIX:-/usr/local} > $(TMP); else \
|
echo $${PREFIX:-/usr/local} > $(PREF); else \
|
||||||
echo $${PREFIX:-$$HOME/.local} > $(TMP); fi;
|
echo $${PREFIX:-$$HOME/.local} > $(PREF); fi;
|
||||||
|
Loading…
Reference in New Issue
Block a user