aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorHenry-Joseph Audéoud <henry-joseph.audeoud@univ-grenoble-alpes.fr>2020-10-30 11:41:52 +0100
committerEric Biggers <ebiggers3@gmail.com>2020-11-30 13:49:06 -0800
commitb74cd30fd7b0ebf30ef570f7bfa78dfcd62d80d5 (patch)
tree2da385b30c00f509f16efca1c22508f960a0a282 /Makefile
parentcc933cdb51cb14dadd72217842e7a27854d63982 (diff)
bash-completion: add completion script
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 10 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index e21b512..2817034 100644
--- a/Makefile
+++ b/Makefile
@@ -110,6 +110,7 @@ lint: $(BIN)/golint $(BIN)/staticcheck $(BIN)/misspell
go list ./... | xargs -L1 golint -set_exit_status
staticcheck ./...
misspell -source=text $(FILES)
+ shellcheck -s bash cmd/fscrypt/fscrypt_bash_completion
( cd cli-tests && shellcheck -x *.sh)
clean:
@@ -158,8 +159,8 @@ coverage.out: $(BIN)/gocovmerge $(COVERAGE_FILES)
@go test -coverpkg=./... -covermode=count -coverprofile=$@ -p 1 ./$* 2> /dev/null
###### Installation Commands (require sudo) #####
-.PHONY: install install-bin install-pam uninstall
-install: install-bin install-pam
+.PHONY: install install-bin install-pam uninstall install-completion
+install: install-bin install-pam install-completion
PREFIX := /usr/local
BINDIR := $(PREFIX)/bin
@@ -181,10 +182,16 @@ install-pam: $(PAM_MODULE)
install -d $(DESTDIR)$(PAM_CONFIG_DIR)
install $(PAM_CONFIG) $(DESTDIR)$(PAM_CONFIG_DIR)/$(NAME)
+COMPLETION_INSTALL_DIR := $(PREFIX)/share/bash-completion/completions
+
+install-completion: cmd/fscrypt/fscrypt_bash_completion
+ install -Dm644 $< $(DESTDIR)$(COMPLETION_INSTALL_DIR)/fscrypt
+
uninstall:
rm -f $(DESTDIR)$(BINDIR)/$(NAME) \
$(DESTDIR)$(PAM_INSTALL_PATH) \
- $(DESTDIR)$(PAM_CONFIG_DIR)/$(NAME)
+ $(DESTDIR)$(PAM_CONFIG_DIR)/$(NAME) \
+ $(DESTDIR)$(COMPLETION_INSTALL_DIR)/fscrypt
#### Tool Building Commands ####
TOOLS := $(addprefix $(BIN)/,protoc golint protoc-gen-go goimports staticcheck gocovmerge misspell)