upd Makefile

This commit is contained in:
ge 2022-07-07 23:35:19 +03:00
parent a0b5dfe0e6
commit ea846e9386
1 changed files with 5 additions and 5 deletions

View File

@ -1,7 +1,7 @@
BIN := "nexclamation"
SYMLINK := "n!"
COMPL := "completion"
TMP := "./.installation_prefix"
PREF := "./.installation_prefix"
all:
@echo Nothing to do. Available targets: install, uninstall, set-prefix
@ -12,7 +12,7 @@ all:
@echo make PREFIX=/your/path install
install: set-prefix
$(eval PREFIX := $(shell cat $(TMP)))
$(eval PREFIX := $(shell cat $(PREF)))
@echo Installation PREFIX $(PREFIX)
COMPDIR="$(PREFIX)/share/bash-completion/completions"; \
mkdir -p "$(PREFIX)" && \
@ -23,7 +23,7 @@ install: set-prefix
@echo Successfully installed
uninstall:
$(eval PREFIX := $(shell cat $(TMP)))
$(eval PREFIX := $(shell cat $(PREF)))
@echo Installation PREFIX $(PREFIX)
COMPDIR="$(PREFIX)/share/bash-completion/completions"; \
rm -f "$(PREFIX)/bin/$(BIN)" && \
@ -33,5 +33,5 @@ uninstall:
set-prefix:
if [ "$$UID" == "0" ]; then \
echo $${PREFIX:-/usr/local} > $(TMP); else \
echo $${PREFIX:-$$HOME/.local} > $(TMP); fi;
echo $${PREFIX:-/usr/local} > $(PREF); else \
echo $${PREFIX:-$$HOME/.local} > $(PREF); fi;