Sphinx: command : sudo make html

Created on 23 Aug 2016  路  3Comments  路  Source: sphinx-doc/sphinx

make: *** No rule to make target `html'. Stop.

question

Most helpful comment

Do you run "make html" in the folder that has a 'Makefile'?

All 3 comments

Do you run "make html" in the folder that has a 'Makefile'?

Now I close this.
Please reopen if you still have problem.

I hit the exact same issue after I tested the make latex and accidentally overwrote Makefile in the doc directory. Shibukawa's advice is correct and I would add one more thing: ensure you have the right Makefile. It's a text file so you can check if yours is the right one. For example, mine is

# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS    ?=
SPHINXBUILD   ?= sphinx-build
SOURCEDIR     = source
BUILDDIR      = build

# Put it first so that "make" without argument is like "make help".
help:
        @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
        @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

Compare this with the one for LaTeX:

# Makefile for Sphinx LaTeX output

ALLDOCS = $(basename $(wildcard *.tex))
ALLPDF = $(addsuffix .pdf,$(ALLDOCS))
ALLDVI = $(addsuffix .dvi,$(ALLDOCS))
ALLXDV =
ALLPS  = $(addsuffix .ps,$(ALLDOCS))
ALLIMGS = $(wildcard *.png *.gif *.jpg *.jpeg)

# Prefix for archive names
ARCHIVEPREFIX =
# Additional LaTeX options (passed via variables in latexmkrc/latexmkjarc file)
export LATEXOPTS =
# Additional latexmk options
LATEXMKOPTS =
# format: pdf or dvi (used only by archive targets)
FMT = pdf
...

I replaced ./doc/Makefile that was the second text by the first one; and make html worked. Hope someone finds this note helpful.

Was this page helpful?
0 / 5 - 0 ratings