From 1a4ada40fe679a1cf309558f43200dc9af146220 Mon Sep 17 00:00:00 2001 From: Krystine Sherwin <93062060+KrystalDelusion@users.noreply.github.com> Date: Mon, 15 Apr 2024 10:32:02 +1200 Subject: [PATCH] Docs: Add cell gen to makefile Generate in a temp directory and use `rsync -rc` to only update rst files that have changed. This prevents sphinx from having to re-generate every cmd/cell page any time the git sha changes. Also change cmd gen to match. --- Makefile | 13 +++++++++++-- docs/Makefile | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 86e5064c9..eaf133ff7 100644 --- a/Makefile +++ b/Makefile @@ -981,8 +981,17 @@ endif # also others, but so long as it doesn't fail this is enough to know we tried docs/source/cmd/abc.rst: $(TARGETS) $(EXTRA_TARGETS) - mkdir -p docs/source/cmd - ./$(PROGRAM_PREFIX)yosys -p 'help -write-rst-command-reference-manual' + $(Q) mkdir -p docs/source/cmd + $(Q) mkdir -p temp/docs/source/cmd + $(Q) cd temp && ./../$(PROGRAM_PREFIX)yosys -p 'help -write-rst-command-reference-manual' + $(Q) rsync -rc temp/docs/source/cmd docs/source + $(Q) rm -rf temp +docs/source/cell/add.rst: $(TARGETS) $(EXTRA_TARGETS) + $(Q) mkdir -p docs/source/cell + $(Q) mkdir -p temp/docs/source/cell + $(Q) cd temp && ./../$(PROGRAM_PREFIX)yosys -p 'help -write-rst-cells-manual' + $(Q) rsync -rc temp/docs/source/cell docs/source + $(Q) rm -rf temp PHONY: docs/gen_examples docs/gen_images docs/guidelines docs/usage docs/reqs docs/gen_examples: $(TARGETS) diff --git a/docs/Makefile b/docs/Makefile index 6dbf6f490..9be050d35 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -47,7 +47,7 @@ help: .PHONY: clean clean: clean-examples rm -rf $(BUILDDIR)/* - rm -rf source/cmd util/__pycache__ + rm -rf source/cell source/cmd util/__pycache__ rm -rf source/generated $(MAKE) -C source/_images clean