sphinx
sphinx copied to clipboard
Quickstart `make -f` error: `path/to/Makefile is not a directory`
Describe the bug
When using the quickstart project, calling the Makefile with the --file
option (https://www.gnu.org/software/make/manual/make.html#index-_002d_002dfile) results in a weird error:
make -f /path/to/doc/Makefile -j 1 html
Application error:
Output directory (/path/to/doc/Makefile) is not a directory
How to Reproduce
$ mkdir test_sphinx_makefile
$ cd test_sphinx_makefile
$ pip install sphinx
$ sphinx-quickstart
> separate source: n
> project name: test
> project author: test
> project release:
> project language: en
$ cd ..
$ make -f test_sphinx_makefile/Makefile html
Running Sphinx v5.1.0
Configuration error:
config directory doesn't contain a conf.py file (/home/germond/Labs/repro)
make: *** [test_sphinx_makefile/Makefile:20: test_sphinx_makefile/Makefile] Error 2
Error text can vary, the main issue is that the Makefile path is taken as if it were the target.
Expected behavior
A html build should be run and finish successfully, as it would by calling make -C test_sphinx_makefile html
make: Entering directory '/home/germond/Labs/repro/test_sphinx_makefile'
Running Sphinx v5.1.0
making output directory... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 1 source files that are out of date
updating environment: [new config] 1 added, 0 changed, 0 removed
reading sources... [100%] index
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index
generating indices... genindex done
writing additional pages... search done
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded.
The HTML pages are in _build/html.
Your project
github.com/adacore/cuda
Screenshots
No response
OS
Linux
Python version
3.8.10
Sphinx version
5.1.0
Sphinx extensions
No response
Extra tools
No response
Additional context
No response
I think problems are to be expected from make -f
if the make is not executed from same directory as where Makefile resides, correct way is make -C
then. (cf discussion at #10707). At my locale make -f Makefile html
works already, if executed from soure directory (make -f /path/to/Makefile html
from another location does not work).
Can you check if https://github.com/jfbu/sphinx/commit/a9c2c7f24608ec1d3ae689638d67cd9740e1c80f works, in the sense of allowing make -f RenamedMakefile html
(from source directory).