2018-03-06 14:54:44 +08:00
|
|
|
# Minimal makefile for Sphinx documentation
|
|
|
|
#
|
|
|
|
|
2018-03-09 07:59:55 +08:00
|
|
|
ifeq ($(VERBOSE),1)
|
|
|
|
Q =
|
|
|
|
else
|
|
|
|
Q = @
|
|
|
|
endif
|
|
|
|
|
2018-03-06 14:54:44 +08:00
|
|
|
# You can set these variables from the command line.
|
2018-04-14 05:36:25 +08:00
|
|
|
SPHINXOPTS ?= -q
|
2018-03-06 14:54:44 +08:00
|
|
|
SPHINXBUILD = sphinx-build
|
|
|
|
SPHINXPROJ = "Project ACRN"
|
|
|
|
SOURCEDIR = .
|
2018-06-12 17:38:43 +08:00
|
|
|
BUILDDIR ?= _build
|
2018-03-06 14:54:44 +08:00
|
|
|
|
2018-06-15 04:54:59 +08:00
|
|
|
# document publication assumes the folder structure is setup
|
|
|
|
# with the acrn-hypervisor and projectacrn.github.io repos as
|
|
|
|
# sibling folders and make is run inside the acrn-hypervisor/docs
|
|
|
|
# folder.
|
|
|
|
|
|
|
|
ACRN_BASE = "$(CURDIR)/../.."
|
2018-04-14 05:36:25 +08:00
|
|
|
DOC_TAG ?= development
|
|
|
|
RELEASE ?= latest
|
2018-06-15 04:54:59 +08:00
|
|
|
PUBLISHDIR = $(ACRN_BASE)/projectacrn.github.io/$(RELEASE)
|
2018-03-07 07:12:49 +08:00
|
|
|
|
2018-03-06 14:54:44 +08:00
|
|
|
# Put it first so that "make" without argument is like "make help".
|
|
|
|
help:
|
2018-06-12 17:34:54 +08:00
|
|
|
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(OPTS)
|
2018-05-05 00:41:59 +08:00
|
|
|
@echo ""
|
|
|
|
@echo "make publish"
|
|
|
|
@echo " publish generated html to projectacrn.github.io site:"
|
|
|
|
@echo " specify RELEASE=name to publish as a tagged release version"
|
2018-05-15 18:02:07 +08:00
|
|
|
@echo " and placed in a version subfolder. Requires repo merge permission."
|
2018-03-06 14:54:44 +08:00
|
|
|
|
|
|
|
.PHONY: help Makefile
|
|
|
|
|
2018-03-07 04:26:59 +08:00
|
|
|
# Generate the doxygen xml (for Sphinx) and copy the doxygen html to the
|
|
|
|
# api folder for publishing along with the Sphinx-generated API docs.
|
|
|
|
|
2018-04-26 21:53:27 +08:00
|
|
|
doxy:
|
2018-04-14 05:36:25 +08:00
|
|
|
$(Q)(cat acrn.doxyfile) | doxygen - > doc.log 2>&1
|
2018-03-06 14:54:44 +08:00
|
|
|
|
2018-05-30 05:07:34 +08:00
|
|
|
content:
|
2018-08-31 04:58:20 +08:00
|
|
|
$(Q)scripts/extract_content.py . tools
|
2018-05-30 05:07:34 +08:00
|
|
|
|
2018-06-15 04:54:59 +08:00
|
|
|
kconfig:
|
|
|
|
$(Q)srctree=../hypervisor \
|
2018-10-02 05:25:21 +08:00
|
|
|
python3 scripts/genrest.py Kconfig reference/kconfig/
|
2018-06-15 04:54:59 +08:00
|
|
|
|
2018-07-25 07:57:40 +08:00
|
|
|
pullsource:
|
|
|
|
$(Q)scripts/pullsource.sh
|
|
|
|
|
|
|
|
|
2018-06-15 04:54:59 +08:00
|
|
|
html: doxy content kconfig
|
2018-06-12 17:34:54 +08:00
|
|
|
-$(Q)$(SPHINXBUILD) -t $(DOC_TAG) -b html -d $(BUILDDIR)/doctrees $(SOURCEDIR) $(BUILDDIR)/html $(SPHINXOPTS) $(OPTS) >> doc.log 2>&1
|
2018-03-14 07:24:35 +08:00
|
|
|
$(Q)./scripts/filter-doc-log.sh doc.log
|
|
|
|
|
2018-11-13 01:36:15 +08:00
|
|
|
singlehtml: doxy content kconfig
|
|
|
|
-$(Q)$(SPHINXBUILD) -t $(DOC_TAG) -b singlehtml -d $(BUILDDIR)/doctrees $(SOURCEDIR) $(BUILDDIR)/html $(SPHINXOPTS) $(OPTS) >> doc.log 2>&1
|
|
|
|
$(Q)./scripts/filter-doc-log.sh doc.log
|
2018-03-14 07:24:35 +08:00
|
|
|
|
2018-03-07 07:12:49 +08:00
|
|
|
# Remove generated content (Sphinx and doxygen)
|
2018-03-06 14:54:44 +08:00
|
|
|
|
|
|
|
clean:
|
2018-03-09 07:59:55 +08:00
|
|
|
rm -fr $(BUILDDIR) doxygen
|
2018-05-30 05:07:34 +08:00
|
|
|
rm -fr tools
|
2018-06-15 04:54:59 +08:00
|
|
|
rm -fr reference/kconfig/*.rst
|
2018-03-07 07:12:49 +08:00
|
|
|
|
|
|
|
# Copy material over to the GitHub pages staging repo
|
2018-03-09 07:59:55 +08:00
|
|
|
# along with a README
|
2018-03-07 07:12:49 +08:00
|
|
|
|
|
|
|
publish:
|
2018-07-12 21:47:55 +08:00
|
|
|
mkdir -p $(PUBLISHDIR)
|
2018-09-17 05:22:09 +08:00
|
|
|
cd $(PUBLISHDIR)/..; git pull origin master
|
2018-03-09 07:59:55 +08:00
|
|
|
rm -fr $(PUBLISHDIR)/*
|
|
|
|
cp -r $(BUILDDIR)/html/* $(PUBLISHDIR)
|
2018-04-14 05:36:25 +08:00
|
|
|
cp scripts/publish-README.md $(PUBLISHDIR)/../README.md
|
|
|
|
cp scripts/publish-index.html $(PUBLISHDIR)/../index.html
|
2019-04-05 06:37:49 +08:00
|
|
|
cp scripts/publish-robots.txt $(PUBLISHDIR)/../robots.txt
|
2018-04-14 05:36:25 +08:00
|
|
|
cd $(PUBLISHDIR)/..; git add -A; git commit -s -m "publish $(RELEASE)"; git push origin master;
|
2018-03-06 14:54:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
# Catch-all target: route all unknown targets to Sphinx using the new
|
2018-06-12 17:34:54 +08:00
|
|
|
# "make mode" option. $(OPTS) is meant as a shortcut for $(SPHINXOPTS).
|
2018-03-06 14:54:44 +08:00
|
|
|
%: Makefile doxy
|
2018-06-12 17:34:54 +08:00
|
|
|
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(OPTS)
|