diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..cde1eb5 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "docs-resources"] + path = docs-resources + url = https://github.com/riscv/docs-resources.git diff --git a/Makefile b/Makefile index 0fee170..a1bbbad 100644 --- a/Makefile +++ b/Makefile @@ -1,28 +1,61 @@ -all: zjid-spec.pdf zjpm-spec.pdf +DOCKER_RUN := docker run --rm -v ${PWD}:/build -w /build \ +riscvintl/riscv-docs-base-container-image:latest -zjid-spec.pdf: zjid/*.adoc docs-templates - mkdir -p zjid/images - cp docs-templates/src/images/risc-v_logo.png zjid/images - cp docs-templates/src/images/backpage.png zjid/images - asciidoctor-pdf \ +HEADER_SOURCE := zjpm/header.adoc +PDF_RESULT := zjpm-spec.pdf + +ASCIIDOCTOR_PDF := asciidoctor-pdf +OPTIONS := --trace \ + -a compress \ + -a mathematical-format=svg \ + -a pdf-fontsdir=docs-resources/fonts \ + -a pdf-theme=docs-resources/themes/riscv-pdf.yml \ + --failure-level=ERROR +REQUIRES := --require=asciidoctor-diagram + +.PHONY: all build clean build-container build-no-container + +all: build + +#zjid-spec.pdf: zjid/*.adoc +# asciidoctor-pdf \ --attribute=mathematical-format=svg \ - --attribute=pdf-fontsdir=docs-templates/resources/fonts \ - --attribute=pdf-style=docs-templates/resources/themes/riscv-pdf.yml \ + --attribute=pdf-fontsdir=docs-resources/fonts \ + --attribute=pdf-theme=docs-resources/themes/riscv-pdf.yml \ --failure-level=ERROR \ --out-file=$@ \ zjid/header.adoc -zjpm-spec.pdf: zjpm/*.adoc docs-templates - mkdir -p zjpm/images - cp docs-templates/src/images/risc-v_logo.png zjpm/images - cp docs-templates/src/images/backpage.png zjpm/images - asciidoctor-pdf \ +build: + @echo "Checking if Docker is available..." + @if command -v docker >/dev/null 2>&1 ; then \ + echo "Docker is available, building inside Docker container..."; \ + $(MAKE) build-container; \ + else \ + echo "Docker is not available, building without Docker..."; \ + $(MAKE) build-no-container; \ + fi + +build-container: + @echo "Starting build inside Docker container..." + $(DOCKER_RUN) /bin/sh -c "$(ASCIIDOCTOR_PDF) $(OPTIONS) $(REQUIRES) --out-file=$(PDF_RESULT) $(HEADER_SOURCE)" + @echo "Build completed successfully inside Docker container." + +build-no-container: + @echo "Starting build..." + $(ASCIIDOCTOR_PDF) $(OPTIONS) $(REQUIRES) --out-file=$(PDF_RESULT) $(HEADER_SOURCE) + @echo "Build completed successfully." + +clean: + @echo "Cleaning up generated files..." + rm -f $(PDF_RESULT) + @echo "Cleanup completed." + +#zjpm-spec.pdf: zjpm/*.adoc +# asciidoctor-pdf \ --attribute=mathematical-format=svg \ - --attribute=pdf-fontsdir=docs-templates/resources/fonts \ - --attribute=pdf-style=docs-templates/resources/themes/riscv-pdf.yml \ + --attribute=pdf-fontsdir=docs-resources/fonts \ + --attribute=pdf-theme=docs-resources/themes/riscv-pdf.yml \ --failure-level=ERROR \ --out-file=$@ \ zjpm/header.adoc - -docs-templates: - git clone https://github.com/riscv/docs-templates.git diff --git a/docs-resources b/docs-resources new file mode 160000 index 0000000..35203a4 --- /dev/null +++ b/docs-resources @@ -0,0 +1 @@ +Subproject commit 35203a4f123d0be162b6b5ea213a657b594f8c36 diff --git a/zjid/header.adoc b/zjid/header.adoc index 52d5541..e08d654 100644 --- a/zjid/header.adoc +++ b/zjid/header.adoc @@ -15,11 +15,11 @@ :preface-title: Preamble :colophon: :appendix-caption: Appendix -:imagesdir: images +:imagesdir: ../docs-resources/images :title-logo-image: image:risc-v_logo.png[pdfwidth=3.25in,align=center] //:page-background-image: image:draft.svg[opacity=20%] //:title-page-background-image: none -:back-cover-image: image:backpage.png[opacity=25%] +//:back-cover-image: image:backpage.png[opacity=25%] // Settings: :experimental: :reproducible: diff --git a/zjpm-spec.pdf b/zjpm-spec.pdf index 0db455e..0887789 100644 Binary files a/zjpm-spec.pdf and b/zjpm-spec.pdf differ diff --git a/zjpm/header.adoc b/zjpm/header.adoc index 8cacd96..93b0b0c 100644 --- a/zjpm/header.adoc +++ b/zjpm/header.adoc @@ -3,7 +3,7 @@ :description: RISC-V J Extension: Pointer Masking :company: RISC-V.org :revdate: 05/2024 -:revnumber: 1.0.0-rc2 +:revnumber: 1.0-rc3 :revremark: Frozen //development: assume everything can change //stable: assume everything could change @@ -15,11 +15,11 @@ :preface-title: Preamble :colophon: :appendix-caption: Appendix -:imagesdir: images +:imagesdir: ../docs-resources/images :title-logo-image: image:risc-v_logo.png[pdfwidth=3.25in,align=center] //:page-background-image: image:draft.svg[opacity=20%] //:title-page-background-image: none -:back-cover-image: image:backpage.png[opacity=25%] +//:back-cover-image: image:backpage.png[opacity=25%] // Settings: :experimental: :reproducible: