Skip to content

Commit 1794d99

Browse files
Geoffroy Van Cutsemdeb-intel
authored andcommitted
doc: update doc generation tooling to only work within the $BUILDDIR
Modify the documentation Makefile (doc/Makefile) and scripts to only modify and create content inside the $BUILDDIR folder. The folders that were created inside 'doc/' previously are now all created inside '$BUILDDIR/rst'. The '.gitignore' file has also been updated accordingly. Tracked-On: #3686 Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
1 parent 0dac373 commit 1794d99

File tree

3 files changed

+24
-19
lines changed

3 files changed

+24
-19
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
doc/doxygen
21
doc/_build
3-
doc/reference/kconfig/*.rst
4-
doc/misc
52
build
63
*.bak
74
*.sav

doc/Makefile

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ endif
1111
SPHINXOPTS ?= -q
1212
SPHINXBUILD = sphinx-build
1313
SPHINXPROJ = "Project ACRN"
14-
SOURCEDIR = .
1514
BUILDDIR ?= _build
15+
SOURCEDIR = $(BUILDDIR)/rst/
1616

1717
# document publication assumes the folder structure is setup
1818
# with the acrn-hypervisor and projectacrn.github.io repos as
@@ -33,40 +33,47 @@ help:
3333
@echo " specify RELEASE=name to publish as a tagged release version"
3434
@echo " and placed in a version subfolder. Requires repo merge permission."
3535

36-
.PHONY: help Makefile
36+
.PHONY: help Makefile copy-to-sourcedir doxy content kconfig html singlehtml clean publish
3737

3838
# Generate the doxygen xml (for Sphinx) and copy the doxygen html to the
3939
# api folder for publishing along with the Sphinx-generated API docs.
4040

41-
doxy:
42-
$(Q)(cat acrn.doxyfile) | doxygen - > doc.log 2>&1
43-
$(Q)find doxygen/xml/* | xargs sed -i 's/simplesect kind="pre"/simplesect kind="preconditions"/'
41+
copy-to-sourcedir:
42+
$(Q)mkdir -p $(SOURCEDIR)
43+
$(Q)rsync -rt --exclude=$(BUILDDIR) . $(SOURCEDIR)
4444

45-
content:
46-
$(Q)scripts/extract_content.py . misc
45+
doxy: copy-to-sourcedir
46+
$(Q)(cat acrn.doxyfile ; echo "OUTPUT_DIRECTORY=$(SOURCEDIR)/doxygen" ) | doxygen - > $(BUILDDIR)/doc.log 2>&1
47+
$(Q)find $(SOURCEDIR)/doxygen/xml/* | xargs sed -i 's/simplesect kind="pre"/simplesect kind="preconditions"/'
4748

48-
kconfig:
49+
content: copy-to-sourcedir
50+
$(Q)scripts/extract_content.py $(SOURCEDIR) misc
51+
52+
kconfig: copy-to-sourcedir
4953
$(Q)srctree=../hypervisor \
50-
python3 scripts/genrest.py Kconfig reference/kconfig/
54+
python3 scripts/genrest.py Kconfig $(SOURCEDIR)/reference/kconfig/
5155

5256
pullsource:
5357
$(Q)scripts/pullsource.sh
5458

55-
html: doxy content kconfig
56-
-$(Q)$(SPHINXBUILD) -t $(DOC_TAG) -b html -d $(BUILDDIR)/doctrees $(SOURCEDIR) $(BUILDDIR)/html $(SPHINXOPTS) $(OPTS) >> doc.log 2>&1
57-
$(Q)./scripts/filter-doc-log.sh doc.log
59+
html: copy-to-sourcedir doxy content kconfig
60+
-$(Q)$(SPHINXBUILD) -t $(DOC_TAG) -b html -d $(BUILDDIR)/doctrees $(SOURCEDIR) $(BUILDDIR)/html $(SPHINXOPTS) $(OPTS) >> $(BUILDDIR)/doc.log 2>&1
61+
$(Q)./scripts/filter-doc-log.sh $(BUILDDIR)/doc.log
5862

5963
singlehtml: doxy content kconfig
60-
-$(Q)$(SPHINXBUILD) -t $(DOC_TAG) -b singlehtml -d $(BUILDDIR)/doctrees $(SOURCEDIR) $(BUILDDIR)/html $(SPHINXOPTS) $(OPTS) >> doc.log 2>&1
61-
$(Q)./scripts/filter-doc-log.sh doc.log
64+
-$(Q)$(SPHINXBUILD) -t $(DOC_TAG) -b singlehtml -d $(BUILDDIR)/doctrees $(SOURCEDIR) $(BUILDDIR)/html $(SPHINXOPTS) $(OPTS) >> $(BUILDDIR)/doc.log 2>&1
65+
$(Q)./scripts/filter-doc-log.sh $(BUILDDIR)/doc.log
6266

6367
# Remove generated content (Sphinx and doxygen)
6468

6569
clean:
66-
rm -fr $(BUILDDIR) doxygen
70+
rm -fr $(BUILDDIR)
71+
# Keeping these temporarily, but no longer strictly needed.
72+
rm -fr doxygen
6773
rm -fr misc
6874
rm -fr reference/kconfig/*.rst
6975

76+
7077
# Copy material over to the GitHub pages staging repo
7178
# along with a README
7279

doc/scripts/filter-doc-log.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ KI_SCRIPT=scripts/filter-known-issues.py
1010
CONFIG_DIR=.known-issues/doc
1111

1212
LOG_FILE=$1
13+
BUILDDIR=$(dirname $LOG_FILE)
1314

1415
if [ -z "${LOG_FILE}" ]; then
1516
echo "Error in $0: missing input parameter <logfile>"
@@ -29,7 +30,7 @@ else
2930
fi
3031

3132
if [ -s "${LOG_FILE}" ]; then
32-
$KI_SCRIPT --config-dir ${CONFIG_DIR} ${LOG_FILE} > doc.warnings 2>&1
33+
$KI_SCRIPT --config-dir ${CONFIG_DIR} ${LOG_FILE} > ${BUILDDIR}/doc.warnings 2>&1
3334
if [ -s doc.warnings ]; then
3435
echo
3536
echo -e "${red}New errors/warnings found, please fix them:"

0 commit comments

Comments
 (0)