summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Schmitt <mathiaspeterhorst@gmail.com>2022-01-15 18:12:28 +0100
committercyqsimon <28627918+cyqsimon@users.noreply.github.com>2023-08-25 16:16:18 +0800
commit223bd3f192ecd3b6731d8bc38e3e83e7fd4c4349 (patch)
tree8c48af2e6d86e942134735f52f2ff8009976471c
parent06ea4d1e61f3ae7f22534df82ca5c6173f3d1cc7 (diff)
Makefile: Install autocompletion script.
-rw-r--r--Makefile14
1 files changed, 11 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 6da0877..447839c 100644
--- a/Makefile
+++ b/Makefile
@@ -17,9 +17,10 @@ BIN=target/$(TARGET)/$(APP)
BIN_DST=$(DESTDIR)$(prefix)/bin/$(APP)
DOC_DST=$(DESTDIR)$(prefix)/share/man/man1/bandwhich.1
LIC_DST=$(DESTDIR)$(prefix)/share/licenses/$(APP)
+AUTOCOMPLETE_DST=/usr/share/bash-completion/completions
SRC = Makefile Cargo.lock Cargo.toml $(shell find src -type f -wholename 'src/*.rs')
-.PHONY: all clean distclean install uninstall vendor
+.PHONY: all clean distclean install uninstall vendor install_autocomplete
all: $(BIN)
@@ -35,12 +36,19 @@ ifeq ($(VENDOR),1)
endif
cargo build $(ARGS)
-install:
+install_autocomplete:
+ mkdir -p $(AUTOCOMPLETE_DST)
+ cp src/bandwhich $(AUTOCOMPLETE_DST)/bandwhich
+
+uninstall_autocomplete:
+ rm -f $(AUTOCOMPLETE_DST)/bandwhich
+
+install: install_autocomplete
install -Dm755 $(BIN) $(BIN_DST)
install -Dm644 docs/bandwhich.1 $(DOC_DST)
install -Dm644 LICENSE.md $(LIC_DST)/LICENSE
-uninstall:
+uninstall: uninstall_autocomplete
rm -rf $(BIN_DST) $(DOC_DST) $(LIC_DST)
vendor: