blob: c9883afe2329aab835e099805556e78283b0b439 [file] [log] [blame]
Zack Williamsad366132018-05-14 14:45:47 -07001# Makefile for building CORD docs site, guide.opencord.org
2# Building docs requires the following tools:
3# - Gitbook toolchain: https://toolchain.gitbook.com/setup.html
4# - NPM (for Gitbook and Swagger)
5# - Python (for build glossary script)
6# - linkchecker (for test target) http://wummel.github.io/linkchecker/
7
8default: serve
9
10# use bash for pushd/popd, and to fail if commands within a pipe fail
11SHELL = bash -o pipefail
12
13GENERATED_DOCS =
14
15serve: setup
16 gitbook serve --port 4040
17
18build: setup
19 gitbook build
20
21setup: cord-tester xos xos-gui xos-tosca swagger $(GENERATED_DOCS)
22 gitbook init
23 gitbook install
24
25test: linkcheck lint
26
27linkcheck: build
28 linkchecker --check-extern -a _book/
29
30lint:
31 @echo "markdownlint(mdl) version: `mdl --version`"
32 @echo "style config:"
33 @echo "---"
34 @cat mdlstyle.rb
35 @echo "---"
36 mdl -s mdlstyle.rb `find -L . ! -path "./partials/*" ! -path "./_book/*" ! -path "./node_modules/*" ! -path "./cord-tester/modules/*" -name "*.md"`
37
38# link directories that contain other documentation
39cord-tester:
40 ln -s ../test/cord-tester/docs cord-tester
41
42xos:
43 ln -s ../orchestration/xos/docs xos
44
45xos-gui:
46 ln -s ../orchestration/xos-gui/docs xos-gui
47
48xos-tosca:
49 ln -s ../orchestration/xos-tosca/docs xos-tosca
50
51swagger: xos
52 pushd ../orchestration/xos/docs/; make swagger_docs; popd;
53
54clean:
55 rm -rf $(GENERATED_DOCS)
56 rm -rf _book
57 rm -rf node_modules
58 rm -rf cord-tester test xos xos-gui xos-tosca
59