Skip to content

Commit 4b7dbfb

Browse files
committed
Portability Fix for Makefile
`install -D` is actually a non-portable gnu extension, so I've replaced it wit `install -d` so this will work on BSD. I've also suppressed errors for pkg-config, which should prevent the errors the makefile was spitting out for OS X (unverified)
1 parent 2200aff commit 4b7dbfb

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

Makefile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
11
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)
33
# pkg-config adds a space for some reason, we have to strip it off.
44
BASH_COMPLETION_DIR := $(strip $(BASH_COMPLETION_DIR))
55
USERDIR ?= $(HOME)
66

77
# The @ symbols make the output silent.
88

9-
install:
10-
@if [ -d $(BASH_COMPLETION_DIR) ]; then \
9+
install:
10+
@if [ $(BASH_COMPLETION_DIR) ]; then \
1111
cp notes.bash_completion "$(BASH_COMPLETION_DIR)/notes"; \
1212
else \
1313
echo "Bash Completion was not installed, because the directory was" \
1414
"not found. if you have bash completion installed, follow the" \
1515
"README (https://github.com/pimterry/notes#installing-bash-completion)" \
1616
"to manually install it."; \
1717
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/
2124
@mandb 1>/dev/null 2>&1 # Fail silently if we don't have a mandb
2225
@echo -e "Notes has been installed to $(PREFIX)/bin/notes." \
2326
"A configuration file has also been created at" \

0 commit comments

Comments
 (0)