3
3
BINDIR ?= $(PREFIX)/bin
4
4
LIBDIR ?= $(PREFIX)/lib
5
5
MANDIR ?= $(PREFIX)/share/man
8
7
PLATFORMFILE := src/platform/$(shell uname | tr '[:upper:]' '[:lower:]').sh
10
.PHONY: install uninstall install-platform
9
.PHONY: install uninstall install-pass
13
12
@echo "Password store is a shell script, so there is nothing to do. Try \"make install\" instead."
16
@mkdir -p "$(DESTDIR)$(BINDIR)" "$(DESTDIR)$(LIBDIR)" "$(DESTDIR)$(MANDIR)/man1" "$(DESTDIR)$(SYSCONFDIR)/bash_completion.d" "$(DESTDIR)$(PREFIX)/share/zsh/vendor-completions"
15
@mkdir -p "$(DESTDIR)$(BINDIR)" "$(DESTDIR)$(LIBDIR)" "$(DESTDIR)$(MANDIR)/man1" "$(DESTDIR)$(PREFIX)/share/bash-completion/completions/" "$(DESTDIR)$(PREFIX)/share/zsh/vendor-completions"
17
16
@install -m 0755 -v src/password-store.sh "$(DESTDIR)$(BINDIR)/pass"
18
17
@install -m 0644 -v man/pass.1 "$(DESTDIR)$(MANDIR)/man1/pass.1"
19
@install -m 0644 -v contrib/pass.bash-completion "$(DESTDIR)$(SYSCONFDIR)/bash_completion.d/password-store"
20
@install -m 0644 -v contrib/pass.zsh-completion "$(DESTDIR)$(PREFIX)/share/zsh/vendor-completions/_pass"
18
@install -m 0644 -v src/completion/pass.bash-completion "$(DESTDIR)$(PREFIX)/share/bash-completion/completions/pass"
19
@install -m 0644 -v src/completion/pass.zsh-completion "$(DESTDIR)$(PREFIX)/share/zsh/vendor-completions/_pass"
22
21
# Uncomment to install the fish completion file.
23
# @install -m 0644 -v contrib/pass.fish-completion "$(DESTDIR)$(PREFIX)/share/fish/completions/pass.fish"
25
@$(MAKE) -s install-platform
22
# @install -m 0644 -v src/completion/pass.fish-completion "$(DESTDIR)$(PREFIX)/share/fish/completions/pass.fish"
27
24
ifneq ($(strip $(wildcard $(PLATFORMFILE))),)
29
26
@install -m 0644 -v "$(PLATFORMFILE)" "$(DESTDIR)$(LIBDIR)/password-store.platform.sh"
30
27
# The -i "" doesn't work on GNU, where the extra argument isn't needed. Fortuantely, platform file is for non-GNU only.
31
28
sed -i "" 's:.*platform-defined-functions.*:source $(DESTDIR)$(LIBDIR)/password-store.platform.sh:' "$(DESTDIR)$(BINDIR)/pass"
37
@rm -vf "$(DESTDIR)$(BINDIR)/pass" "$(DESTDIR)$(MANDIR)/man1/pass.1" "$(DESTDIR)$(SYSCONFDIR)/bash_completion.d/password-store" "$(DESTDIR)$(LIBDIR)/password-store.platform.sh"
34
@rm -vf "$(DESTDIR)$(BINDIR)/pass" "$(DESTDIR)$(MANDIR)/man1/pass.1" "$(DESTDIR)$(PREFIX)/share/bash-completion/completions/password-store" "$(DESTDIR)$(LIBDIR)/password-store.platform.sh"