[19dcb933] | 1 | # Makefile for Sphinx documentation |
---|
| 2 | # |
---|
| 3 | |
---|
| 4 | # You can set these variables from the command line. |
---|
| 5 | PYTHON ?= python |
---|
| 6 | SPHINXOPTS = |
---|
| 7 | SPHINXBUILD = $(PYTHON) -m sphinx.__init__ |
---|
| 8 | PAPER ?= letter |
---|
| 9 | BUILDDIR = _build |
---|
| 10 | ifdef ComSpec |
---|
| 11 | RMDIR = del /s/q/f |
---|
| 12 | CPDIR = xcopy /q/e/i |
---|
| 13 | MKDIR = mkdir |
---|
| 14 | PATHSEP = $(strip \) |
---|
| 15 | COPY = copy |
---|
| 16 | else |
---|
| 17 | RMDIR = rm -rf |
---|
| 18 | CPDIR = cp -rp |
---|
| 19 | MKDIR = mkdir -p |
---|
| 20 | PATHSEP = $(strip /) |
---|
| 21 | COPY = cp |
---|
| 22 | endif |
---|
| 23 | |
---|
| 24 | # Internal variables. |
---|
| 25 | PAPEROPT_a4 = -D latex_paper_size=a4 |
---|
| 26 | PAPEROPT_letter = -D latex_paper_size=letter |
---|
| 27 | ALLSPHINXOPTS = -d _build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . |
---|
| 28 | |
---|
| 29 | IMG_SOURCE = $(wildcard ../sasmodels/models/img/*) |
---|
| 30 | IMG_DEST = $(patsubst ../sasmodels/models/img/%,model/img/%,$(IMG_SOURCE)) |
---|
| 31 | MODELS_PY = $(wildcard ../sasmodels/models/[a-z]*.py) |
---|
| 32 | MODELS_RST = $(patsubst ../sasmodels/models/%.py,model/%.rst,$(MODELS_PY)) |
---|
| 33 | |
---|
| 34 | model/img/%: ../sasmodels/models/img/% |
---|
| 35 | $(COPY) $< $@ |
---|
| 36 | |
---|
| 37 | model/%.rst: ../sasmodels/models/%.py |
---|
| 38 | $(PYTHON) genmodel.py $< $@ |
---|
| 39 | |
---|
| 40 | .PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest build |
---|
| 41 | |
---|
| 42 | help: |
---|
| 43 | @echo "Please use \`make <target>' where <target> is one of" |
---|
| 44 | @echo " html to make standalone HTML files" |
---|
| 45 | @echo " dirhtml to make HTML files named index.html in directories" |
---|
| 46 | @echo " pickle to make pickle files" |
---|
| 47 | @echo " json to make JSON files" |
---|
| 48 | @echo " htmlhelp to make HTML files and a HTML help project" |
---|
| 49 | @echo " qthelp to make HTML files and a qthelp project" |
---|
| 50 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" |
---|
| 51 | @echo " changes to make an overview of all changed/added/deprecated items" |
---|
| 52 | @echo " linkcheck to check all external links for integrity" |
---|
| 53 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" |
---|
| 54 | |
---|
| 55 | api: genapi.py |
---|
| 56 | $(RMDIR) api |
---|
| 57 | $(PYTHON) genapi.py |
---|
| 58 | |
---|
| 59 | model: |
---|
| 60 | $(MKDIR) model |
---|
| 61 | $(MKDIR) model/img |
---|
| 62 | |
---|
| 63 | build: model $(MODELS_RST) $(IMG_DEST) api |
---|
| 64 | #cd ../.. && python setup.py build |
---|
| 65 | |
---|
| 66 | upload: |
---|
| 67 | scp -r _build/html/* reflectometry.org:web/danse/docs/sasmodels |
---|
| 68 | scp _build/latex/SASModels.pdf reflectometry.org:web/danse/download |
---|
| 69 | |
---|
| 70 | clean: |
---|
| 71 | -rm -rf _build model api |
---|
| 72 | |
---|
| 73 | html: build |
---|
| 74 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) _build/html |
---|
| 75 | @echo |
---|
| 76 | @echo "Build finished. The HTML pages are in _build/html." |
---|
| 77 | |
---|
| 78 | dirhtml: |
---|
| 79 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) _build/dirhtml |
---|
| 80 | @echo |
---|
| 81 | @echo "Build finished. The HTML pages are in _build/dirhtml." |
---|
| 82 | |
---|
| 83 | pickle: |
---|
| 84 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) _build/pickle |
---|
| 85 | @echo |
---|
| 86 | @echo "Build finished; now you can process the pickle files." |
---|
| 87 | |
---|
| 88 | json: |
---|
| 89 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) _build/json |
---|
| 90 | @echo |
---|
| 91 | @echo "Build finished; now you can process the JSON files." |
---|
| 92 | |
---|
| 93 | htmlhelp: |
---|
| 94 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) _build/htmlhelp |
---|
| 95 | @echo |
---|
| 96 | @echo "Build finished; now you can run HTML Help Workshop with the" \ |
---|
| 97 | ".hhp project file in _build/htmlhelp." |
---|
| 98 | |
---|
| 99 | qthelp: |
---|
| 100 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) _build/qthelp |
---|
| 101 | @echo |
---|
| 102 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ |
---|
| 103 | ".qhcp project file in _build/qthelp, like this:" |
---|
| 104 | @echo "# qcollectiongenerator _build/qthelp/Periodic Table.qhcp" |
---|
| 105 | @echo "To view the help file:" |
---|
| 106 | @echo "# assistant -collectionFile _build/qthelp/Periodic Table.qhc" |
---|
| 107 | |
---|
| 108 | latex: build |
---|
| 109 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) _build/latex |
---|
| 110 | @echo |
---|
| 111 | @echo "Build finished; the LaTeX files are in _build/latex." |
---|
| 112 | @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ |
---|
| 113 | "run these through (pdf)latex." |
---|
| 114 | |
---|
| 115 | pdf: latex |
---|
| 116 | $(MAKE) -C _build/latex all-pdf |
---|
| 117 | |
---|
| 118 | changes: |
---|
| 119 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) _build/changes |
---|
| 120 | @echo |
---|
| 121 | @echo "The overview file is in _build/changes." |
---|
| 122 | |
---|
| 123 | linkcheck: |
---|
| 124 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) _build/linkcheck |
---|
| 125 | @echo |
---|
| 126 | @echo "Link check complete; look for any errors in the above output " \ |
---|
| 127 | "or in _build/linkcheck/output.txt." |
---|
| 128 | |
---|
| 129 | doctest: |
---|
| 130 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) _build/doctest |
---|
| 131 | @echo "Testing of doctests in the sources finished, look at the " \ |
---|
| 132 | "results in _build/doctest/output.txt." |
---|