Makefile 1.3 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 4 5 6 7 8 9 10 11

HELP_CMD = \
	man/hub-alias.1 \
	man/hub-browse.1 \
	man/hub-ci-status.1 \
	man/hub-compare.1 \
	man/hub-create.1 \
	man/hub-fork.1 \
	man/hub-pull-request.1 \
M
Mislav Marohnić 已提交
12
	man/hub-release.1 \
M
Mislav Marohnić 已提交
13 14 15 16 17 18 19 20

HELP_EXT = \
	man/hub-am.1 \
	man/hub-apply.1 \
	man/hub-checkout.1 \
	man/hub-cherry-pick.1 \
	man/hub-clone.1 \
	man/hub-fetch.1 \
M
Mislav Marohnić 已提交
21
	man/hub-help.1 \
M
Mislav Marohnić 已提交
22 23 24 25 26 27 28 29 30 31
	man/hub-init.1 \
	man/hub-merge.1 \
	man/hub-push.1 \
	man/hub-remote.1 \
	man/hub-submodule.1 \

HELP_ALL = man/hub.1 $(HELP_CMD) $(HELP_EXT)

TEXT_WIDTH = 87

M
Mislav Marohnić 已提交
32
.PHONY: clean test test-all man-pages fmt
M
Mislav Marohnić 已提交
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47

all: bin/hub

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

test:
	script/build test

test-all: bin/cucumber
	script/test

bin/ronn bin/cucumber:
	script/bootstrap

M
Mislav Marohnić 已提交
48 49 50 51
fmt:
	go fmt $(filter %.go,$(SOURCES_FMT))
	go fmt $(filter-out %.go,$(SOURCES_FMT))

M
Mislav Marohnić 已提交
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
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
	bin/ronn --organization=GITHUB --manual="Hub Manual" man/*.ronn

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

man/hub.1.ronn:
	true

clean:
	rm -rf bin/hub
	git clean -fdx man/