rust/Makefile: Add 'install-(bash|zsh)-completion' targets

Add installation targets for bash and zsh autocompletions for the PV
related tools. Do not use them by default.

Acked-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Marc Hartmayer
2025-01-13 17:41:41 +00:00
committed by Jan Höppner
parent 6718c0edc9
commit b3055154db
2 changed files with 13 additions and 1 deletions

View File

@@ -267,6 +267,8 @@ USRLIB64DIR = $(INSTALLDIR)/usr/lib64
SYSCONFDIR = $(INSTALLDIR)/etc
DATADIR = $(INSTALLDIR)/usr/share
MANDIR = $(DATADIR)/man
BASHCOMPLETIONDIR = $(DATADIR)/bash-completion/completions
ZSHCOMPLETIONDIR = $(DATADIR)/zsh/site-functions
VARDIR = $(INSTALLDIR)/var
TOOLS_DATADIR = $(DATADIR)/s390-tools
TOOLS_LIBDIR = $(INSTALLDIR)/lib/s390-tools

View File

@@ -116,7 +116,17 @@ install-man:
$(foreach target,$(PV_TARGETS),\
$(INSTALL) -m 644 $(target)/man/*.1 -t $(DESTDIR)$(MANDIR)/man1;)
.PHONY: all install clean skip-build install-rust-tools print-rust-targets install-man rust-test
install-bash-completion: $(PV_TARGETS)
$(INSTALL) -d -m 755 $(DESTDIR)$(BASHCOMPLETIONDIR)
$(foreach target,$(PV_TARGETS),\
$(INSTALL) $(shell find $(shell ls --sort=time --reverse --directory target/release/build/$(target)-*/out/ |tail -n1) -name '*.bash') $(DESTDIR)$(BASHCOMPLETIONDIR);)
install-zsh-completion: $(PV_TARGETS)
$(INSTALL) -d -m 755 $(DESTDIR)$(ZSHCOMPLETIONDIR)
$(foreach target,$(PV_TARGETS),\
$(INSTALL) $(shell find $(shell ls --sort=time --reverse --directory target/release/build/$(target)-*/out/ |tail -n1) -regex '.*/_[a-zA-Z0-9]+') $(DESTDIR)$(ZSHCOMPLETIONDIR);)
.PHONY: all install clean skip-build install-rust-tools print-rust-targets install-man rust-test install-bash-completion install-zsh-completion
.check-cargo:
ifeq ($(shell command -v $(CARGO)),)