# 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 demo-report

# Refresh the hosted example report suite under source/_static/demo/dune2/ from
# the dune2_1_2026 fixture reports.  Those fixtures are regenerated by the test
# suite (tests/unit/test_report_golden.py); run pytest first if they are stale.
demo-report:
	rm -rf source/_static/demo/dune2
	mkdir -p source/_static/demo/dune2/instrument
	cp ../tests/fixtures/proc/dune2_1_2026/report/*.html source/_static/demo/dune2/
	cp ../tests/fixtures/proc/dune2_1_2026/report/instrument/*.html \
		source/_static/demo/dune2/instrument/

# 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)
