aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: f54f275389b217700a77e3f6ed26d364e52d65a4 (plain)
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
DOCS_WORKTREE := /tmp/fastcgi-conduit-docs


.PHONY: docs
docs: target/doc/* \
	$(DOCS_WORKTREE) \
	$(DOCS_WORKTREE)/* \
	$(DOCS_WORKTREE)/index.html
	git -C $(DOCS_WORKTREE) add .
	git -C $(DOCS_WORKTREE) commit

target/doc/*:
	cargo doc --no-deps

$(DOCS_WORKTREE):
	git worktree add $(DOCS_WORKTREE) gh-pages

$(DOCS_WORKTREE)/*:
	cp -R target/doc/* $(DOCS_WORKTREE)/

$(DOCS_WORKTREE)/index.html:
	cp doc/index.html $(DOCS_WORKTREE)/

.PHONY: docs-clean
docs-clean:
	git worktree remove --force $(DOCS_WORKTREE)