-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
129 lines (98 loc) · 4.66 KB
/
Makefile
File metadata and controls
129 lines (98 loc) · 4.66 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# (C) Copyright Open Permissions Platform Coalition 2016
.PHONY: clean requirements docs
# You should not set these variables from the command line.
# Directory that this Makfile is in
SERVICEDIR = $(shell pwd)
# Python script directory
PYTHON_SCRIPT_DIR = $(SERVICEDIR)/python
# Directory to build docs in
BUILDDIR = $(SERVICEDIR)/_build
DOC_DIR = $(SERVICEDIR)/documents
MARKDOWN_DOC_DIR_IN = $(DOC_DIR)/markdown
# Directory to output architecture markdown converted docs to
ARCH_DOC_DIR_OUT = $(BUILDDIR)/arch
# Directory to find architecture markdown docs
ARCH_DOC_DIR_IN = $(MARKDOWN_DOC_DIR_IN)/arch
# Directory to output authentication markdown converted docs to
AUTH_DOC_DIR_OUT = $(BUILDDIR)/auth
# Directory to find authentication markdown docs
AUTH_DOC_DIR_IN = $(MARKDOWN_DOC_DIR_IN)/auth
# Directory to output guides markdown converted docs to
GUIDES_DOC_DIR_OUT = $(BUILDDIR)/guides
# Directory to find guides markdown docs
GUIDES_DOC_DIR_IN = $(MARKDOWN_DOC_DIR_IN)/guides
# Directory to output tocs markdown converted docs to
TOCS_DOC_DIR_OUT = $(BUILDDIR)/tocs
# Directory to find tocs markdown docs
TOCS_DOC_DIR_IN = $(MARKDOWN_DOC_DIR_IN)/tocs
# Directory to output types markdown converted docs to
TYPES_DOC_DIR_OUT = $(BUILDDIR)/types
# Directory to find types markdown docs
TYPES_DOC_DIR_IN = $(MARKDOWN_DOC_DIR_IN)/types
# Directory to output versioning markdown converted docs to
VERSION_DOC_DIR_OUT = $(BUILDDIR)/versioning
# Directory to find versioning markdown docs
VERSION_DOC_DIR_IN = $(MARKDOWN_DOC_DIR_IN)/versioning
# Grip app
GRIP_APP = grip
# Grip switches
GRIP_SWITCHES =
# Create list of target .html file names to be created based on all .md files found in the 'doc directory'
md_docs := $(patsubst $(ARCH_DOC_DIR_IN)/%.md,$(ARCH_DOC_DIR_OUT)/%.html,$(wildcard $(ARCH_DOC_DIR_IN)/*.md)) \
$(patsubst $(AUTH_DOC_DIR_IN)/%.md,$(AUTH_DOC_DIR_OUT)/%.html,$(wildcard $(AUTH_DOC_DIR_IN)/*.md)) \
$(patsubst $(GUIDES_DOC_DIR_IN)/%.md,$(GUIDES_DOC_DIR_OUT)/%.html,$(wildcard $(GUIDES_DOC_DIR_IN)/*.md)) \
$(patsubst $(TOCS_DOC_DIR_IN)/%.md,$(TOCS_DOC_DIR_OUT)/%.html,$(wildcard $(TOCS_DOC_DIR_IN)/*.md)) \
$(patsubst $(TYPES_DOC_DIR_IN)/%.md,$(TYPES_DOC_DIR_OUT)/%.html,$(wildcard $(TYPES_DOC_DIR_IN)/*.md)) \
$(patsubst $(VERSION_DOC_DIR_IN)/%.md,$(VERSION_DOC_DIR_OUT)/%.html,$(wildcard $(VERSION_DOC_DIR_IN)/*.md)) \
$(patsubst $(SERVICEDIR)/%.md,$(BUILDDIR)/%.html,$(wildcard $(SERVICEDIR)/*.md))
clean:
rm -rf $(BUILDDIR)
# Install requirements
requirements:
pip install -r $(SERVICEDIR)/requirements.txt
# Dependencies of .html document files created from files in the 'architecture doc directory'
$(ARCH_DOC_DIR_OUT)/%.html : $(ARCH_DOC_DIR_IN)/%.md
mkdir -p $(dir $@)
$(GRIP_APP) $(GRIP_SWITCHES) $< --export $@
file_translate -c $(DOC_DIR)/translate.json -i $@ -o $@
# Dependencies of .html document files created from files in the 'auth doc directory'
$(AUTH_DOC_DIR_OUT)/%.html : $(AUTH_DOC_DIR_IN)/%.md
mkdir -p $(dir $@)
$(GRIP_APP) $(GRIP_SWITCHES) $< --export $@
file_translate -c $(DOC_DIR)/translate.json -i $@ -o $@
# Dependencies of .html document files created from files in the 'guides doc directory'
$(GUIDES_DOC_DIR_OUT)/%.html : $(GUIDES_DOC_DIR_IN)/%.md
mkdir -p $(dir $@)
$(GRIP_APP) $(GRIP_SWITCHES) $< --export $@
file_translate -c $(DOC_DIR)/translate.json -i $@ -o $@
# Dependencies of .html document files created from files in the 'tocs doc directory'
$(TOCS_DOC_DIR_OUT)/%.html : $(TOCS_DOC_DIR_IN)/%.md
mkdir -p $(dir $@)
$(GRIP_APP) $(GRIP_SWITCHES) $< --export $@
file_translate -c $(DOC_DIR)/translate.json -i $@ -o $@
# Dependencies of .html document files created from files in the 'types doc directory'
$(TYPES_DOC_DIR_OUT)/%.html : $(TYPES_DOC_DIR_IN)/%.md
mkdir -p $(dir $@)
$(GRIP_APP) $(GRIP_SWITCHES) $< --export $@
file_translate -c $(DOC_DIR)/translate.json -i $@ -o $@
# Dependencies of .html document files created from files in the 'versioning doc directory'
$(VERSION_DOC_DIR_OUT)/%.html : $(VERSION_DOC_DIR_IN)/%.md
mkdir -p $(dir $@)
$(GRIP_APP) $(GRIP_SWITCHES) $< --export $@
file_translate -c $(DOC_DIR)/translate.json -i $@ -o $@
# Dependencies of .html document files created from README.md
$(BUILDDIR)/%.html : $(SERVICEDIR)/%.md
mkdir -p $(dir $@)
$(GRIP_APP) $(GRIP_SWITCHES) $< --export $@
file_translate -c $(DOC_DIR)/translate.json -i $@ -o $@
# Create .html docs from all markdown files
md_docs: $(md_docs)
# Copy dependent files required to render the views, e.g. images
rsync \
--exclude '*.md' \
--exclude 'eap' \
--exclude 'drawio' \
-r \
$(MARKDOWN_DOC_DIR_IN)/ $(BUILDDIR)
# Create all docs
docs: md_docs