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