-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (38 loc) · 1.04 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
.SUFFIXES:
.PHONY: all check clean dist distclean doc release
all: doc
include install.mk
ASCIIDOC ?= asciidoctor
DIST_VERSION ?= $(shell git describe --always)
dist_name = $(bin)-$(DIST_VERSION)
dist_tar_name = $(dist_name).tar
doc: $(manpath)
%.1: %.1.adoc
$(ASCIIDOC) --backend manpage --doctype manpage $<
test -f $@
# Multiple manpage names can't be disabled but I don't want it.
# asciidoctor/asciidoctor#1811
$(RM) doc/git-abort.1 doc/git-skip.1
check:
shellcheck $(bin)
clean:
$(RM) doc/*.1
dist: $(dist_tar_name).gz
$(dist_tar_name).gz: $(manpath)
mkdir -p $(dist_name)
cp -t $(dist_name) $(bin) README.md
mkdir -p $(dist_name)/doc
cp $(manpath) $(dist_name)/doc
cp install.mk $(dist_name)/Makefile
tar cf $(dist_tar_name) $(dist_name)
gzip -f -9 $(dist_tar_name)
@$(RM) -r $(dist_name)
distclean:
$(RM) $(bin)-*.gz
$(RM) -r $(bin)-*/
release:
test -n "$(v)"
sed -i "s/^\(:mansource: git continue\).\+$$/\1 $(v)/" $(manpath).adoc
git add -p $(manpath).adoc
git commit -m "$(bin) $(v)"
git tag -a -m "$(bin) $(v)" "v$(v)"