Zack Williams | ad36613 | 2018-05-14 14:45:47 -0700 | [diff] [blame] | 1 | # 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 | |
| 8 | default: serve |
| 9 | |
| 10 | # use bash for pushd/popd, and to fail if commands within a pipe fail |
| 11 | SHELL = bash -o pipefail |
| 12 | |
| 13 | GENERATED_DOCS = |
| 14 | |
| 15 | serve: setup |
| 16 | gitbook serve --port 4040 |
| 17 | |
| 18 | build: setup |
| 19 | gitbook build |
| 20 | |
| 21 | setup: cord-tester xos xos-gui xos-tosca swagger $(GENERATED_DOCS) |
| 22 | gitbook init |
| 23 | gitbook install |
| 24 | |
| 25 | test: linkcheck lint |
| 26 | |
| 27 | linkcheck: build |
| 28 | linkchecker --check-extern -a _book/ |
| 29 | |
| 30 | lint: |
| 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 |
| 39 | cord-tester: |
| 40 | ln -s ../test/cord-tester/docs cord-tester |
| 41 | |
| 42 | xos: |
| 43 | ln -s ../orchestration/xos/docs xos |
| 44 | |
| 45 | xos-gui: |
| 46 | ln -s ../orchestration/xos-gui/docs xos-gui |
| 47 | |
| 48 | xos-tosca: |
| 49 | ln -s ../orchestration/xos-tosca/docs xos-tosca |
| 50 | |
| 51 | swagger: xos |
| 52 | pushd ../orchestration/xos/docs/; make swagger_docs; popd; |
| 53 | |
| 54 | clean: |
| 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 | |