From 43c6fc509e3224b1769f39b699999d198a1a9ff4 Mon Sep 17 00:00:00 2001 From: cchndl <28229098+cchndl@users.noreply.github.com> Date: Tue, 21 Oct 2025 13:49:10 +0200 Subject: [PATCH] add target for cloning and building with spec - builds rfcs - only html option right now - svg images missing, needs to be done in secop-img repo --- .gitignore | 1 + Makefile | 25 +++++++++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e7f9d25..0ba5783 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ build/ +buildsrc/ .venv/ diff --git a/Makefile b/Makefile index d0c3cbf..df0b7e8 100644 --- a/Makefile +++ b/Makefile @@ -6,13 +6,34 @@ SPHINXOPTS ?= SPHINXBUILD ?= sphinx-build SOURCEDIR = source +SPECDIR = spec BUILDDIR = build +BUILDSRCDIR = buildsrc # Put it first so that "make" without argument is like "make help". help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + @$(SPHINXBUILD) -M help "$(BUILDSRCDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -.PHONY: help Makefile +.PHONY: help Makefile rfcs with_spec clone_spec clean_spec + +with_spec: Makefile $(BUILDSRCDIR) rfcs + @$(SPHINXBUILD) -M html "$(BUILDSRCDIR)/$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +$(BUILDSRCDIR): spec + @cp "secop_sphinx.py" "$(BUILDSRCDIR)" + @cp -r "$(SOURCEDIR)" "$(BUILDSRCDIR)" + @cp -r $(BUILDSRCDIR)/spec/protocol/specification/* "$(BUILDSRCDIR)/$(SOURCEDIR)/specification" + +rfcs: + python process_rfcs.py "$(BUILDSRCDIR)/spec/rfcs" "$(BUILDSRCDIR)/$(SOURCEDIR)/rfcs" + +spec: + @if [ ! -d "$(BUILDSRCDIR)/spec" ]; then \ + git clone "https://github.com/SampleEnvironment/SECoP.git" "$(BUILDSRCDIR)/spec"; \ + fi + +clean_spec: + rm -rf $(BUILDSRCDIR) # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).