Update documentation makefile
Adds a target to rebuild the cocotb package. This is useful when
updating documentation of C extensions. Also uses `.` to source shell
files which is more portable and fixes a bug.
@@ -15,6 +15,12 @@ BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help: .venv
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+ @echo "Other targets"
+ @echo " .venv Create virtual environment used to generate documentation"
+ @echo " rebuild_cocotb Rebuilds the cocotb package and installs in the virtual environment"
+ @echo " clean Deletes Sphinx-build artifacts"
+ @echo " distclean Deletes the virtual environment and Sphinx-build artifacts"
+ @echo " help Prints this help message"
.venv: requirements.txt
@echo Creating Python venv for Sphinx build
@@ -23,6 +29,10 @@ help: .venv
.venv/bin/pip -q install -r requirements.txt
.venv/bin/pip -q install -e ..
+.PHONY: rebuild_cocotb
+rebuild_cocotb:
+ .venv/bin/pip -q install -e ..
+
.PHONY: clean
clean: .venv Makefile
@$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -41,4 +51,4 @@ distclean:
# We hack around that by calling the target explicitly.
make .venv
- source .venv/bin/activate; $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+ . .venv/bin/activate; $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
