2018-01-21 14:39:26 +00:00
|
|
|
PREFIX ?= /usr/local
|
2018-01-20 05:16:25 +00:00
|
|
|
BINDIR ?= $(PREFIX)/bin
|
2018-10-28 16:52:59 +00:00
|
|
|
MANDIR ?= $(PREFIX)/share/man/man1
|
2018-03-05 22:33:38 +00:00
|
|
|
|
|
|
|
# Attempt to find bash completion dir in order of preference
|
2018-03-03 23:24:05 +00:00
|
|
|
ifneq ($(wildcard /etc/bash_completion.d/.),)
|
2018-03-05 22:33:38 +00:00
|
|
|
CPLDIR ?= /etc/bash_completion.d
|
|
|
|
endif
|
|
|
|
|
|
|
|
HAS_BREW := $(shell command -v brew 2> /dev/null)
|
|
|
|
ifdef HAS_BREW
|
|
|
|
CPLDIR ?= $$(brew --prefix)/etc/bash_completion.d
|
|
|
|
endif
|
|
|
|
|
|
|
|
HAS_PKGCONFIG := $(shell command -v pkg-config 2> /dev/null)
|
|
|
|
ifdef HAS_PKGCONFIG
|
2018-10-28 16:52:59 +00:00
|
|
|
CPLDIR ?= $(shell pkg-config --variable=completionsdir bash-completion 2> /dev/null)
|
2018-03-03 23:24:05 +00:00
|
|
|
endif
|
2018-01-20 05:16:25 +00:00
|
|
|
|
|
|
|
install:
|
2018-03-03 23:38:11 +00:00
|
|
|
@echo Installing the executable to $(BINDIR)
|
|
|
|
@mkdir -p $(BINDIR)
|
2018-10-28 16:52:59 +00:00
|
|
|
@install -m 755 burrow $(BINDIR)
|
2018-03-03 23:38:11 +00:00
|
|
|
@echo Installing the manual page to $(MANDIR)/man1
|
|
|
|
@mkdir -p $(MANDIR)
|
2018-10-28 16:52:59 +00:00
|
|
|
@install -m 644 burrow.1 $(MANDIR)
|
2018-03-05 22:33:38 +00:00
|
|
|
ifdef CPLDIR
|
2018-10-28 16:52:59 +00:00
|
|
|
ifneq ($(CPLDIR),)
|
2018-03-03 23:38:11 +00:00
|
|
|
@echo Installing the command completion to $(CPLDIR)
|
2018-03-06 15:03:48 +00:00
|
|
|
@mkdir -p $(CPLDIR)
|
2018-10-28 16:52:59 +00:00
|
|
|
@install -m 644 burrow.d $(CPLDIR)/burrow
|
|
|
|
endif
|
2018-03-05 22:33:38 +00:00
|
|
|
endif
|
2018-01-20 05:16:25 +00:00
|
|
|
|
|
|
|
uninstall:
|
2018-03-03 23:38:11 +00:00
|
|
|
@echo Removing the executable from $(BINDIR)
|
|
|
|
@rm -f $(BINDIR)/burrow
|
|
|
|
@echo Removing the manual page from $(MANDIR)/man1
|
|
|
|
@rm -f $(BINDIR)/man1/burrow.1
|
2018-03-05 22:33:38 +00:00
|
|
|
ifdef CPLDIR
|
2018-10-28 16:52:59 +00:00
|
|
|
ifneq ($(CPLDIR),)
|
2018-03-03 23:38:11 +00:00
|
|
|
@echo Removing the command completion from $(CPLDIR)
|
|
|
|
@rm -f $(CPLDIR)/burrow
|
2018-03-05 22:33:38 +00:00
|
|
|
endif
|
2018-10-28 16:52:59 +00:00
|
|
|
endif
|
2018-01-20 05:16:25 +00:00
|
|
|
|
|
|
|
.PHONY: install uninstall
|