@@ -6,13 +6,16 @@ PYTHON = python3
66SPHINXOPTS =
77SPHINXBUILD = sphinx-build
88PAPER =
9- BUILDDIR = build/$(MICROPY_PORT )
10- CPYDIFFDIR = ../tools
11- CPYDIFF = gen-cpydiff.py
12- GENRSTDIR = genrst
9+ # path to build the generated docs
10+ BUILDDIR = _build
11+ # path to source files to process
12+ SOURCEDIR = .
13+ # path to conf.py
14+ CONFDIR = .
1315# Run "make FORCE= ..." to avoid rebuilding from scratch (and risk
1416# producing incorrect docs).
1517FORCE = -E
18+ VERBOSE = -v
1619
1720# User-friendly check for sphinx-build
1821ifeq ($(shell which $(SPHINXBUILD ) >/dev/null 2>&1; echo $$? ) , 1)
2225# Internal variables.
2326PAPEROPT_a4 = -D latex_paper_size=a4
2427PAPEROPT_letter = -D latex_paper_size=letter
25- ALLSPHINXOPTS = -d $(BUILDDIR ) /doctrees $(PAPEROPT_$(PAPER ) ) $(SPHINXOPTS ) .
28+ BASEOPTS = -c $(CONFDIR ) $(PAPEROPT_$(PAPER ) ) $(FORCE ) $(VERBOSE ) $(SPHINXOPTS ) $(SOURCEDIR )
29+ ALLSPHINXOPTS = -d $(BUILDDIR ) /doctrees $(BASEOPTS )
2630# the i18n builder cannot share the environment and doctrees with the others
27- I18NSPHINXOPTS = $(PAPEROPT_ $( PAPER ) ) $( SPHINXOPTS ) .
31+ I18NSPHINXOPTS = $(BASEOPTS )
2832
2933.PHONY : help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
3034
@@ -52,19 +56,12 @@ help:
5256 @echo " pseudoxml to make pseudoxml-XML files for display purposes"
5357 @echo " linkcheck to check all external links for integrity"
5458 @echo " doctest to run all doctests embedded in the documentation (if enabled)"
55- @echo " cpydiff to generate the MicroPython differences from CPython"
5659
5760clean :
5861 rm -rf $(BUILDDIR ) /*
59- rm -f $(GENRSTDIR ) /*
6062
61- cpydiff :
62- @echo " Generating MicroPython Differences."
63- rm -f $(GENRSTDIR ) /*
64- cd $(CPYDIFFDIR ) && $(PYTHON ) $(CPYDIFF )
65-
66- html : cpydiff
67- $(SPHINXBUILD ) $(FORCE ) -b html $(ALLSPHINXOPTS ) $(BUILDDIR ) /html
63+ html :
64+ $(SPHINXBUILD ) -b html $(ALLSPHINXOPTS ) $(BUILDDIR ) /html
6865 @echo
6966 @echo " Build finished. The HTML pages are in $( BUILDDIR) /html."
7067
@@ -117,30 +114,34 @@ epub:
117114 @echo
118115 @echo " Build finished. The epub file is in $( BUILDDIR) /epub."
119116
120- latex : cpydiff
117+ latex :
121118 $(SPHINXBUILD ) -b latex $(ALLSPHINXOPTS ) $(BUILDDIR ) /latex
122119 @echo
123120 @echo " Build finished; the LaTeX files are in $( BUILDDIR) /latex."
124121 @echo " Run \` make' in that directory to run these through (pdf)latex" \
125122 " (use \` make latexpdf' here to do that automatically)."
126123
127- latexpdf : cpydiff
128- $(SPHINXBUILD ) $(FORCE ) -b latex $(ALLSPHINXOPTS ) $(BUILDDIR ) /latex
124+ # seems to be malfunctioning
125+ latexpdf :
126+ $(SPHINXBUILD ) -b latex $(ALLSPHINXOPTS ) $(BUILDDIR ) /latex
129127 @echo " Running LaTeX files through pdflatex..."
130128 $(MAKE ) -C $(BUILDDIR ) /latex all-pdf
131129 @echo " pdflatex finished; the PDF files are in $( BUILDDIR) /latex."
132130
133- latexpdfja : cpydiff
131+ # seems to be malfunctioning
132+ latexpdfja :
134133 $(SPHINXBUILD ) -b latex $(ALLSPHINXOPTS ) $(BUILDDIR ) /latex
135134 @echo " Running LaTeX files through platex and dvipdfmx..."
136135 $(MAKE ) -C $(BUILDDIR ) /latex all-pdf-ja
137136 @echo " pdflatex finished; the PDF files are in $( BUILDDIR) /latex."
138137
138+ # seems to be malfunctioning
139139text :
140140 $(SPHINXBUILD ) -b text $(ALLSPHINXOPTS ) $(BUILDDIR ) /text
141141 @echo
142142 @echo " Build finished. The text files are in $( BUILDDIR) /text."
143143
144+ # seems to be malfunctioning
144145man :
145146 $(SPHINXBUILD ) -b man $(ALLSPHINXOPTS ) $(BUILDDIR ) /man
146147 @echo
0 commit comments