doc/Makefile
branch1.1 Korean release
changeset 968 eee7625de1f7
parent 812 d7251818be37
child 1723 e0cefb1d5206
equal deleted inserted replaced
808:6e205c1f05a0 968:eee7625de1f7
       
     1 # Makefile for Sphinx documentation
       
     2 #
       
     3 
       
     4 # You can set these variables from the command line.
       
     5 SPHINXOPTS    =
       
     6 SPHINXBUILD   = sphinx-build
       
     7 PAPER         =
       
     8 BUILDDIR      = _build
       
     9 
       
    10 # Internal variables.
       
    11 PAPEROPT_a4     = -D latex_paper_size=a4
       
    12 PAPEROPT_letter = -D latex_paper_size=letter
       
    13 ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
       
    14 # the i18n builder cannot share the environment and doctrees with the others
       
    15 I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
       
    16 
       
    17 .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
       
    18 
       
    19 mofiles :=
       
    20 sitelist := dirhtml
       
    21 langs = fr kr
       
    22 rstfiles = $(shell find * -name '*.rst')
       
    23 define by_lang
       
    24 mos = $$(rstfiles:%.rst=locale/$(1)/LC_MESSAGES/%.mo)
       
    25 $$(mos):locale/$(1)/LC_MESSAGES/%.mo: %_$(1).po
       
    26 	mkdir -p `dirname $$@`
       
    27 	msgfmt $$^ -o $$@
       
    28 mofiles += $$(mos)
       
    29 pos = $$(rstfiles:%.rst=%_$(1).po)
       
    30 $$(pos):%_$(1).po: $(BUILDDIR)/locale/%.pot 
       
    31 	if [ -e $$@ ] ; then msgmerge -U $$@ $$<; else cat $$< > $$@; fi
       
    32 
       
    33 site_$(1): $$(mos)
       
    34 	$(SPHINXBUILD) -D language=$(1) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml_$(1)
       
    35 	find $(BUILDDIR)/dirhtml_$(1) -name "index.html" -print -exec mv {} {}.$(1) ';'
       
    36 sitelist += site_$(1)
       
    37 
       
    38 endef
       
    39 $(foreach lang, $(langs), $(eval $(call by_lang,$(lang))))
       
    40 
       
    41 
       
    42 all: $(sitelist)
       
    43 	mkdir -p $(BUILDDIR)/final
       
    44 	#cp -av $(BUILDDIR)/dirhtml*/* $(BUILDDIR)/final || true
       
    45 
       
    46 mofiles: $(mofiles)
       
    47 
       
    48 help:
       
    49 	@echo "Please use \`make <target>' where <target> is one of"
       
    50 	@echo "  html       to make standalone HTML files"
       
    51 	@echo "  dirhtml    to make HTML files named index.html in directories"
       
    52 	@echo "  singlehtml to make a single large HTML file"
       
    53 	@echo "  pickle     to make pickle files"
       
    54 	@echo "  json       to make JSON files"
       
    55 	@echo "  htmlhelp   to make HTML files and a HTML help project"
       
    56 	@echo "  qthelp     to make HTML files and a qthelp project"
       
    57 	@echo "  devhelp    to make HTML files and a Devhelp project"
       
    58 	@echo "  epub       to make an epub"
       
    59 	@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
       
    60 	@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
       
    61 	@echo "  text       to make text files"
       
    62 	@echo "  man        to make manual pages"
       
    63 	@echo "  texinfo    to make Texinfo files"
       
    64 	@echo "  info       to make Texinfo files and run them through makeinfo"
       
    65 	@echo "  gettext    to make PO message catalogs"
       
    66 	@echo "  changes    to make an overview of all changed/added/deprecated items"
       
    67 	@echo "  linkcheck  to check all external links for integrity"
       
    68 	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
       
    69 
       
    70 clean:
       
    71 	-rm -rf $(BUILDDIR)/*
       
    72 
       
    73 html:
       
    74 	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
       
    75 	@echo
       
    76 	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
       
    77 
       
    78 dirhtml:
       
    79 	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
       
    80 	@echo
       
    81 	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
       
    82 
       
    83 singlehtml:
       
    84 	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
       
    85 	@echo
       
    86 	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
       
    87 
       
    88 pickle:
       
    89 	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
       
    90 	@echo
       
    91 	@echo "Build finished; now you can process the pickle files."
       
    92 
       
    93 json:
       
    94 	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
       
    95 	@echo
       
    96 	@echo "Build finished; now you can process the JSON files."
       
    97 
       
    98 htmlhelp:
       
    99 	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
       
   100 	@echo
       
   101 	@echo "Build finished; now you can run HTML Help Workshop with the" \
       
   102 	      ".hhp project file in $(BUILDDIR)/htmlhelp."
       
   103 
       
   104 qthelp:
       
   105 	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
       
   106 	@echo
       
   107 	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
       
   108 	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
       
   109 	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Beremiz.qhcp"
       
   110 	@echo "To view the help file:"
       
   111 	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Beremiz.qhc"
       
   112 
       
   113 devhelp:
       
   114 	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
       
   115 	@echo
       
   116 	@echo "Build finished."
       
   117 	@echo "To view the help file:"
       
   118 	@echo "# mkdir -p $$HOME/.local/share/devhelp/Beremiz"
       
   119 	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Beremiz"
       
   120 	@echo "# devhelp"
       
   121 
       
   122 epub:
       
   123 	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
       
   124 	@echo
       
   125 	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
       
   126 
       
   127 latex:
       
   128 	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
       
   129 	@echo
       
   130 	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
       
   131 	@echo "Run \`make' in that directory to run these through (pdf)latex" \
       
   132 	      "(use \`make latexpdf' here to do that automatically)."
       
   133 
       
   134 latexpdf:
       
   135 	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
       
   136 	@echo "Running LaTeX files through pdflatex..."
       
   137 	$(MAKE) -C $(BUILDDIR)/latex all-pdf
       
   138 	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
       
   139 
       
   140 text:
       
   141 	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
       
   142 	@echo
       
   143 	@echo "Build finished. The text files are in $(BUILDDIR)/text."
       
   144 
       
   145 man:
       
   146 	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
       
   147 	@echo
       
   148 	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
       
   149 
       
   150 texinfo:
       
   151 	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
       
   152 	@echo
       
   153 	@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
       
   154 	@echo "Run \`make' in that directory to run these through makeinfo" \
       
   155 	      "(use \`make info' here to do that automatically)."
       
   156 
       
   157 info:
       
   158 	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
       
   159 	@echo "Running Texinfo files through makeinfo..."
       
   160 	make -C $(BUILDDIR)/texinfo info
       
   161 	@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
       
   162 
       
   163 gettext:
       
   164 	$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
       
   165 	@echo
       
   166 	@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
       
   167 
       
   168 
       
   169 changes:
       
   170 	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
       
   171 	@echo
       
   172 	@echo "The overview file is in $(BUILDDIR)/changes."
       
   173 
       
   174 linkcheck:
       
   175 	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
       
   176 	@echo
       
   177 	@echo "Link check complete; look for any errors in the above output " \
       
   178 	      "or in $(BUILDDIR)/linkcheck/output.txt."
       
   179 
       
   180 doctest:
       
   181 	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
       
   182 	@echo "Testing of doctests in the sources finished, look at the " \
       
   183 	      "results in $(BUILDDIR)/doctest/output.txt."