-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from riscv/78-update-version-and-add-template
- Loading branch information
Showing
6 changed files
with
60 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "docs-resources"] | ||
path = docs-resources | ||
url = https://github.com/riscv/docs-resources.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Submodule docs-resources
added at
35203a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters