-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
69 lines (59 loc) · 2.37 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
PROG ?= genphrase
PREFIX ?= /usr
DESTDIR ?=
LIBDIR ?= $(PREFIX)/lib
SYSTEM_EXTENSION_DIR ?= $(LIBDIR)/password-store/extensions
MANDIR ?= $(PREFIX)/share/man
GLOBAL_EXT_DIR = $(DESTDIR)$(SYSTEM_EXTENSION_DIR)
GLOBAL_EXT_DIR_RESOURCES = $(GLOBAL_EXT_DIR)/$(PROG)-resources
ifdef PASSWORD_STORE_EXTENSIONS_DIR
LOCAL_EXT_DIR = $(PASSWORD_STORE_EXTENSIONS_DIR)
else
ifdef PASSWORD_STORE_DIR
LOCAL_EXT_DIR = $(PASSWORD_STORE_DIR)/.extensions
else
LOCAL_EXT_DIR = $(HOME)/.password-store/.extensions
endif
endif
LOCAL_EXT_DIR_RESOURCES = $(LOCAL_EXT_DIR)/$(PROG)-resources
all:
@echo "pass-$(PROG) are scripts and plain-text files, and no compilation is needed."
@echo ""
@echo "To run pass-$(PROG) the following tools must be present on the system:"
@echo " pass (Password Store)"
@echo " Python (version 2.7 or 3.x)"
@echo ""
@echo "Please read the file INSTALL for more information."
@echo ""
@echo "To install locally for the current user (recommended), type \`make install'."
@echo ""
@echo "To install system-wide, type \`make globalinstall'."
globalinstall:
install -v -d "$(DESTDIR)$(MANDIR)/man1"
install -m0644 -v pass-$(PROG).1 "$(DESTDIR)$(MANDIR)/man1/pass-$(PROG).1"
install -v -d "$(GLOBAL_EXT_DIR)"
install -m0755 $(PROG).bash "$(GLOBAL_EXT_DIR)/$(PROG).bash"
install -v -d "$(GLOBAL_EXT_DIR_RESOURCES)"
install -m0755 "$(PROG)-resources/_phrase.py" "$(GLOBAL_EXT_DIR_RESOURCES)/_phrase.py"
install -m0444 "$(PROG)-resources/eff_large_wordlist.txt" "$(GLOBAL_EXT_DIR_RESOURCES)/eff_large_wordlist.txt"
globaluninstall:
rm -rf "$(DESTDIR)$(MANDIR)/man1/pass-$(PROG).1"
rm -rf "$(GLOBAL_EXT_DIR_RESOURCES)"
rm -rf "$(GLOBAL_EXT_DIR)/$(PROG).bash"
install:
install -v -d "$(LOCAL_EXT_DIR)"
install -m0755 $(PROG).bash "$(LOCAL_EXT_DIR)/$(PROG).bash"
install -v -d "$(LOCAL_EXT_DIR_RESOURCES)"
install -m0755 "$(PROG)-resources/_phrase.py" "$(LOCAL_EXT_DIR_RESOURCES)/_phrase.py"
install -m0444 "$(PROG)-resources/eff_large_wordlist.txt" "$(LOCAL_EXT_DIR_RESOURCES)/eff_large_wordlist.txt"
uninstall:
rm -rf "$(LOCAL_EXT_DIR_RESOURCES)"
rm -rf "$(LOCAL_EXT_DIR)/$(PROG).bash"
test:
$(MAKE) -C tests
headlesstest:
TEST_QR_SUPPRESS_DISPLAY=1 $(MAKE) -C tests
doc: README.txt
README.txt: pass-genphrase.1
groff -m mandoc -T ascii pass-genphrase.1 | col -bx > README.txt
.PHONY: install globalinstall uninstall globaluninstall test headlesstest