I'm trying to understand the Makefile that is automatically produced by sphinx-quickstart
. Here it is:
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = myproj
SOURCEDIR = source
BUILDDIR = build
.PHONY: help Makefile
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
The lines that confuse me are:
.PHONY: help Makefile
%: Makefile
I think I understand:
- The
%
target means capture anything (wildcard). E.g., if I typedmake html
,%
would capturehtml
. .PHONY Makefile
means thatmake
shouldn't look for a file calledMakefile
in its directory, thus, shouldn't check the file's modified time to determine whether or not to run a rule.
I don't understand:
Why Makefile
is listed as a prerequisite for the target %
. The way I interpret this is:
The target rule captured by %
should run when the Makefile
is changed.
But that doesn't make any sense in the context. What I would expect is:
The target rule captured by %
should run when the source files for the project documentation or the API source files have changed.
Directory structure
.
├── build
├── Makefile
├── source
└── utils