forked from toksea/git-extras
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (46 loc) · 1.32 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
PREFIX ?= /usr/local
BINPREFIX ?= "$(PREFIX)/bin"
MANPREFIX ?= "$(PREFIX)/share/man/man1"
BINS = $(wildcard bin/git-*)
MANS = $(wildcard man/git-*.md)
MAN_HTML = $(MANS:.md=.html)
MAN_PAGES = $(MANS:.md=.1)
docs: $(MAN_HTML) $(MAN_PAGES)
install:
@mkdir -p $(DESTDIR)$(MANPREFIX)
@mkdir -p $(DESTDIR)$(BINPREFIX)
@echo "... installing bins to $(DESTDIR)$(BINPREFIX)"
@echo "... installing man pages to $(DESTDIR)$(MANPREFIX)"
@$(foreach BIN, $(BINS), \
echo "... installing $(notdir $(BIN))"; \
cp -f $(BIN) $(DESTDIR)$(BINPREFIX); \
)
cp -f man/git-*.1 $(DESTDIR)$(MANPREFIX)
@mkdir -p $(DESTDIR)/etc/bash_completion.d
cp -f etc/bash_completion.sh $(DESTDIR)/etc/bash_completion.d/git-extras
man/%.html: man/%.md
ronn \
--manual "Git Extras" \
--html \
--pipe \
$< > $@
man/%.1: man/%.md
ronn -r \
--manual "Git Extras" \
--pipe \
$< > $@
uninstall:
@$(foreach BIN, $(BINS), \
echo "... uninstalling $(DESTDIR)$(BINPREFIX)/$(notdir $(BIN))"; \
rm -f $(DESTDIR)$(BINPREFIX)/$(notdir $(BIN)); \
)
@$(foreach MAN, $(MAN_PAGES), \
echo "... uninstalling $(DESTDIR)$(MANPREFIX)/$(notdir $(MAN))"; \
rm -f $(DESTDIR)$(MANPREFIX)/$(notdir $(MAN)); \
)
rm -f $(DESTDIR)/etc/bash_completion.d/git-extras
clean: docclean
docclean:
rm -f man/*.1
rm -f man/*.html
.PHONY: docs clean docclean install uninstall