-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (31 loc) · 1.11 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
SUBTREE_REPO_NAME := fish-shell
SUBTREE_REPO_URL := [email protected]:fish-shell/$(SUBTREE_REPO_NAME).git
TEMP_DIR := $(shell mktemp -d 2>/dev/null || mktemp -d -t 'temp')
build: fish.tgz
fish.tgz: fish.docset
tar --exclude='.DS_Store' -cvzf fish.tgz fish.docset
fish.docset: stripped_html
dashing build --source html fish
stripped_html: HTML_FILES = $(shell find html -name "*.html")
stripped_html: html
@for file in $(HTML_FILES); do \
perl -0777 -i -pe 's/<div.+role="navigation".*>(?s:.)*?<\/div>//g' $$file; \
perl -0777 -i -pe 's/<div.+role="contentinfo".*>(?s:.)*?<\/div>//g' $$file; \
done
html:
sphinx-build -b html source html
rm -f html/genindex.html html/search.html
fetch_subtree:
@git clone $(SUBTREE_REPO_URL) $(TEMP_DIR); \
cd $(TEMP_DIR); \
git filter-repo --paths-from-file $(CURDIR)/$(SUBTREE_REPO_NAME).gitfilter
git remote add $(SUBTREE_REPO_NAME) file://$(TEMP_DIR)
git fetch --no-tags $(SUBTREE_REPO_NAME) master:$(SUBTREE_REPO_NAME)
git remote rm $(SUBTREE_REPO_NAME)
rm -rf $(TEMP_DIR)
clean:
rm -f fish.tgz
rm -rf fish.docset
rm -rf html
.PHONY:
build stripped_html fetch_subtree clean