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 = .
|
|
|
|
BUILDDIR = _build
|
|
|
|
|
2018-04-14 05:36:25 +08:00
|
|
|
DOC_TAG ?= development
|
|
|
|
RELEASE ?= latest
|
2018-05-15 18:02:07 +08:00
|
|
|
PUBLISHDIR = ../../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:
|
|
|
|
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
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:
|
|
|
|
$(Q)scripts/extract_content.py
|
|
|
|
|
|
|
|
html: doxy content
|
2018-04-14 05:36:25 +08:00
|
|
|
-$(Q)$(SPHINXBUILD) -t $(DOC_TAG) -b html -d $(BUILDDIR)/doctrees $(SOURCEDIR) $(BUILDDIR)/html $(SPHINXOPTS) $(O) >> doc.log 2>&1
|
2018-03-14 07:24:35 +08:00
|
|
|
$(Q)./scripts/filter-doc-log.sh doc.log
|
|
|
|
|
|
|
|
|
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-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-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
|
|
|
|
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
|
|
|
|
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
|
|
%: Makefile doxy
|
|
|
|
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|