-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
79 lines (65 loc) · 1.88 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
SHELL = /usr/bin/env bash
STATIC_RESOURCES := Contents/Info.plist icon.png icon@2x.png
.SECONDARY:
#
# Publishing
#
.build/%/AWS-CLI.tgz: .build/%/AWS-CLI.docset/.done
cd "$(dir $@)" && \
tar --exclude='.DS_Store' -czf AWS-CLI.tgz AWS-CLI.docset
#
# Docset
#
.build/%/AWS-CLI.docset/.done: \
.build/%/AWS-CLI.docset/Contents/Resources/Documents \
.build/%/AWS-CLI.docset/Contents/Resources/docSet.dsidx \
$(addprefix .build/%/AWS-CLI.docset/,$(STATIC_RESOURCES))
touch "$@"
.build/%/AWS-CLI.docset/Contents/Resources/Documents: \
.build/%/aws-cli/doc/build/html \
.build/%/.venv
mkdir -p "$(dir $@)"
set -e && \
tmp="$$(mktemp -d)" && \
cp -r "$<" "$$tmp" && \
source ".build/$*/.venv/bin/activate" && \
./scripts/transform.py "$$tmp/html" && \
mv "$$tmp/html" "$@"
.build/%/AWS-CLI.docset/Contents/Resources/docSet.dsidx: \
.build/%/aws-cli/doc/build/html \
.build/%/.venv
mkdir -p "$(dir $@)"
set -e && \
source ".build/$*/.venv/bin/activate" && \
./scripts/index.py ".build/$*/aws-cli/doc/build/html" "$@"
.build/%/AWS-CLI.docset/Contents/Info.plist: static/Info.plist
mkdir -p "$(dir $@)"
cp "static/$(notdir $@)" "$@"
.build/%/AWS-CLI.docset/icon.png: static/icon.png
mkdir -p "$(dir $@)"
cp "static/$(notdir $@)" "$@"
.build/%/AWS-CLI.docset/icon@2x.png: static/icon@2x.png
mkdir -p "$(dir $@)"
cp "static/$(notdir $@)" "$@"
.build/%/.venv:
python3 -m venv "$@" && \
source "$@/bin/activate" && \
pip install -r requirements.txt
#
# AWS CLI v2 documentation
#
.build/%/aws-cli/doc/build/html: .build/%/aws-cli
cd ".build/$*/aws-cli" && \
python3 -m venv .venv && \
source .venv/bin/activate && \
pip install -r requirements.txt -r requirements-docs.txt && \
pip install 'docutils<0.18' && \
pip install -e . && \
cd doc && \
make html
.build/%/aws-cli:
git clone \
--depth 1 \
--branch "$*" \
https://github.com/aws/aws-cli.git \
$@