Makefile 1.7 KB
Newer Older
M
Mislav Marohnić 已提交
1
SOURCES = $(shell script/build files)
M
Mislav Marohnić 已提交
2
SOURCES_FMT = $(shell script/build files | cut -d/ -f1-2 | sort -u)
M
Mislav Marohnić 已提交
3

M
Mislav Marohnić 已提交
4 5
MIN_COVERAGE = 83

M
Mislav Marohnić 已提交
6
HELP_CMD = \
7 8 9 10 11
	share/man/man1/hub-alias.1 \
	share/man/man1/hub-browse.1 \
	share/man/man1/hub-ci-status.1 \
	share/man/man1/hub-compare.1 \
	share/man/man1/hub-create.1 \
12
	share/man/man1/hub-delete.1 \
13
	share/man/man1/hub-fork.1 \
J
Johan Walles 已提交
14
	share/man/man1/hub-pr.1 \
15 16
	share/man/man1/hub-pull-request.1 \
	share/man/man1/hub-release.1 \
17
	share/man/man1/hub-issue.1 \
18
	share/man/man1/hub-sync.1 \
M
Mislav Marohnić 已提交
19 20

HELP_EXT = \
21 22 23 24 25 26 27 28 29 30 31 32 33 34
	share/man/man1/hub-am.1 \
	share/man/man1/hub-apply.1 \
	share/man/man1/hub-checkout.1 \
	share/man/man1/hub-cherry-pick.1 \
	share/man/man1/hub-clone.1 \
	share/man/man1/hub-fetch.1 \
	share/man/man1/hub-help.1 \
	share/man/man1/hub-init.1 \
	share/man/man1/hub-merge.1 \
	share/man/man1/hub-push.1 \
	share/man/man1/hub-remote.1 \
	share/man/man1/hub-submodule.1 \

HELP_ALL = share/man/man1/hub.1 $(HELP_CMD) $(HELP_EXT)
M
Mislav Marohnić 已提交
35 36 37

TEXT_WIDTH = 87

M
Mislav Marohnić 已提交
38
.PHONY: clean test test-all man-pages fmt install
M
Mislav Marohnić 已提交
39 40 41 42 43 44 45 46 47 48

all: bin/hub

bin/hub: $(SOURCES)
	script/build -o $@

test:
	script/build test

test-all: bin/cucumber
M
Mislav Marohnić 已提交
49 50 51
ifdef CI
	script/test --coverage $(MIN_COVERAGE)
else
M
Mislav Marohnić 已提交
52
	script/test
M
Mislav Marohnić 已提交
53
endif
M
Mislav Marohnić 已提交
54 55 56 57

bin/ronn bin/cucumber:
	script/bootstrap

M
Mislav Marohnić 已提交
58 59 60 61
fmt:
	go fmt $(filter %.go,$(SOURCES_FMT))
	go fmt $(filter-out %.go,$(SOURCES_FMT))

M
Mislav Marohnić 已提交
62 63 64 65 66 67
man-pages: $(HELP_ALL:=.ronn) $(HELP_ALL) $(HELP_ALL:=.txt)

%.txt: %.ronn
	groff -Wall -mtty-char -mandoc -Tutf8 -rLL=$(TEXT_WIDTH)n $< | col -b >$@

%.1: %.1.ronn bin/ronn
68
	bin/ronn --organization=GITHUB --manual="Hub Manual" share/man/man1/*.ronn
M
Mislav Marohnić 已提交
69 70 71 72

%.1.ronn: bin/hub
	bin/hub help $(*F) --plain-text | script/format-ronn $(*F) $@

73
share/man/man1/hub.1.ronn:
M
Mislav Marohnić 已提交
74 75
	true

M
Mislav Marohnić 已提交
76 77 78
install: bin/hub man-pages
	bash < script/install.sh

M
Mislav Marohnić 已提交
79
clean:
M
Mislav Marohnić 已提交
80
	git clean -fdx bin share/man