@@ -6,6 +6,9 @@ SPHINXOPTS =
66SPHINXBUILD = sphinx-build
77PAPER =
88BUILDDIR = build/$(MICROPY_PORT )
9+ CPYDIFFDIR = ../tools
10+ CPYDIFF = gen-cpydiff.py
11+ GENRSTDIR = genrst
912# Run "make FORCE= ..." to avoid rebuilding from scratch (and risk
1013# producing incorrect docs).
1114FORCE = -E
@@ -48,11 +51,18 @@ help:
4851 @echo " pseudoxml to make pseudoxml-XML files for display purposes"
4952 @echo " linkcheck to check all external links for integrity"
5053 @echo " doctest to run all doctests embedded in the documentation (if enabled)"
54+ @echo " cpydiff to generate the MicroPython differences from CPython"
5155
5256clean :
5357 rm -rf $(BUILDDIR ) /*
58+ rm -f $(GENRSTDIR ) /*
5459
55- html :
60+ cpydiff :
61+ @echo " Generating MicroPython Differences."
62+ rm -f $(GENRSTDIR ) /*
63+ cd $(CPYDIFFDIR ) && python $(CPYDIFF )
64+
65+ html : cpydiff
5666 $(SPHINXBUILD ) $(FORCE ) -b html $(ALLSPHINXOPTS ) $(BUILDDIR ) /html
5767 @echo
5868 @echo " Build finished. The HTML pages are in $( BUILDDIR) /html."
@@ -106,20 +116,20 @@ epub:
106116 @echo
107117 @echo " Build finished. The epub file is in $( BUILDDIR) /epub."
108118
109- latex :
119+ latex : cpydiff
110120 $(SPHINXBUILD ) -b latex $(ALLSPHINXOPTS ) $(BUILDDIR ) /latex
111121 @echo
112122 @echo " Build finished; the LaTeX files are in $( BUILDDIR) /latex."
113123 @echo " Run \` make' in that directory to run these through (pdf)latex" \
114124 " (use \` make latexpdf' here to do that automatically)."
115125
116- latexpdf :
126+ latexpdf : cpydiff
117127 $(SPHINXBUILD ) $(FORCE ) -b latex $(ALLSPHINXOPTS ) $(BUILDDIR ) /latex
118128 @echo " Running LaTeX files through pdflatex..."
119129 $(MAKE ) -C $(BUILDDIR ) /latex all-pdf
120130 @echo " pdflatex finished; the PDF files are in $( BUILDDIR) /latex."
121131
122- latexpdfja :
132+ latexpdfja : cpydiff
123133 $(SPHINXBUILD ) -b latex $(ALLSPHINXOPTS ) $(BUILDDIR ) /latex
124134 @echo " Running LaTeX files through platex and dvipdfmx..."
125135 $(MAKE ) -C $(BUILDDIR ) /latex all-pdf-ja
0 commit comments