-
Notifications
You must be signed in to change notification settings - Fork 66
/
Makefile
40 lines (33 loc) · 1.19 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
PREFIX ?= /usr/local
BINPREFIX ?= "$(PREFIX)/bin"
LIBPREFIX ?= "$(PREFIX)/lib"
MANPREFIX ?= "$(PREFIX)/share/man/man1"
SYSCONFDIR ?= "$(PREFIX)/etc"
default: install
install:
@mkdir -p "$(DESTDIR)$(MANPREFIX)"
@mkdir -p "$(DESTDIR)$(BINPREFIX)"
@mkdir -p "$(DESTDIR)$(LIBPREFIX)/git-issue"
sed "s|/usr/local|$(PREFIX)|g" git-issue.sh > git-issue
install git-issue "$(DESTDIR)$(BINPREFIX)/git-issue"
install lib/git-issue/import-export.sh "$(DESTDIR)$(LIBPREFIX)/git-issue/import-export.sh"
install -m 644 git-issue.1 "$(DESTDIR)$(MANPREFIX)/"
@mkdir -p "$(DESTDIR)$(SYSCONFDIR)/bash_completion.d"
install -m 644 gi-completion.sh "$(DESTDIR)$(SYSCONFDIR)/bash_completion.d/git-issue"
# Synchronize man page and usage with the contents of the README file
sync-docs:
./sync-docs.sh
test:
if shellcheck --version >/dev/null 2>&1 ; then \
shellcheck -x *.sh lib/git-issue/*.sh ; \
else \
echo 'Skipping shellcheck; consider installing it' ; \
fi
./test.sh
uninstall:
rm -f "$(DESTDIR)$(BINPREFIX)/git-issue"
rm -f "$(DESTDIR)$(MANPREFIX)/git-issue."
rm -f "$(DESTDIR)$(SYSCONFDIR)/bash_completion.d/git-issue"
clean:
rm -f git-issue
.PHONY: default clean install uninstall sync-docs test