blob: aa0c21bbe8abb847e3041f1b0e5be92e791a3e99 [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
Zack Williamsa719e4a2018-05-16 14:44:36 -070015LINT_STYLE ?= mdl_relaxed.rb
16
Zack Williamsad366132018-05-14 14:45:47 -070017serve: setup
18 gitbook serve --port 4040
19
20build: setup
21 gitbook build
22
23setup: cord-tester xos xos-gui xos-tosca swagger $(GENERATED_DOCS)
24 gitbook init
25 gitbook install
26
27test: linkcheck lint
28
29linkcheck: build
30 linkchecker --check-extern -a _book/
31
32lint:
33 @echo "markdownlint(mdl) version: `mdl --version`"
34 @echo "style config:"
35 @echo "---"
Zack Williamsa719e4a2018-05-16 14:44:36 -070036 @cat $(LINT_STYLE)
Zack Williamsad366132018-05-14 14:45:47 -070037 @echo "---"
Zack Williamsa719e4a2018-05-16 14:44:36 -070038 mdl -s $(LINT_STYLE) `find -L . ! -path "./partials/*" ! -path "./_book/*" ! -path "./node_modules/*" ! -path "./cord-tester/modules/*" -name "*.md"`
Zack Williamsad366132018-05-14 14:45:47 -070039
40# link directories that contain other documentation
41cord-tester:
42 ln -s ../test/cord-tester/docs cord-tester
43
44xos:
45 ln -s ../orchestration/xos/docs xos
46
47xos-gui:
48 ln -s ../orchestration/xos-gui/docs xos-gui
49
50xos-tosca:
51 ln -s ../orchestration/xos-tosca/docs xos-tosca
52
53swagger: xos
54 pushd ../orchestration/xos/docs/; make swagger_docs; popd;
55
56clean:
57 rm -rf $(GENERATED_DOCS)
58 rm -rf _book
59 rm -rf node_modules
60 rm -rf cord-tester test xos xos-gui xos-tosca
61