|
1 | 1 | PREFIX ?= /usr/local
|
2 |
| -BASH_COMPLETION_DIR := $(shell pkg-config --variable=completionsdir bash-completion) |
| 2 | +BASH_COMPLETION_DIR := $(shell pkg-config --silence-errors --variable=completionsdir bash-completion) |
3 | 3 | # pkg-config adds a space for some reason, we have to strip it off.
|
4 | 4 | BASH_COMPLETION_DIR := $(strip $(BASH_COMPLETION_DIR))
|
5 | 5 | USERDIR ?= $(HOME)
|
6 | 6 |
|
7 | 7 | # The @ symbols make the output silent.
|
8 | 8 |
|
9 |
| -install: |
10 |
| - @if [ -d $(BASH_COMPLETION_DIR) ]; then \ |
| 9 | +install: |
| 10 | + @if [ $(BASH_COMPLETION_DIR) ]; then \ |
11 | 11 | cp notes.bash_completion "$(BASH_COMPLETION_DIR)/notes"; \
|
12 | 12 | else \
|
13 | 13 | echo "Bash Completion was not installed, because the directory was" \
|
14 | 14 | "not found. if you have bash completion installed, follow the" \
|
15 | 15 | "README (https://github.com/pimterry/notes#installing-bash-completion)" \
|
16 | 16 | "to manually install it."; \
|
17 | 17 | fi # Small test for bash completion support
|
18 |
| - @install -m755 -D notes $(PREFIX)/bin/notes |
19 |
| - @install -m777 -D config $(USERDIR)/.config/notes/config |
20 |
| - @install -D notes.1 $(PREFIX)/share/man/man1/notes.1 |
| 18 | + @install -m755 -d $(PREFIX)/bin/ |
| 19 | + @install -m755 notes $(PREFIX)/bin/ |
| 20 | + @install -m777 -d $(USERDIR)/.config/notes/ |
| 21 | + @install -m777 config $(USERDIR)/.config/notes/ |
| 22 | + @install -d $(PREFIX)/share/man/man1/ |
| 23 | + @install notes.1 $(PREFIX)/share/man/man1/ |
21 | 24 | @mandb 1>/dev/null 2>&1 # Fail silently if we don't have a mandb
|
22 | 25 | @echo -e "Notes has been installed to $(PREFIX)/bin/notes." \
|
23 | 26 | "A configuration file has also been created at" \
|
|
0 commit comments