Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
dgptha committed Nov 26, 2024
2 parents bed083b + 5831bbd commit 3a0add1
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 27 deletions.
65 changes: 38 additions & 27 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,27 @@
# the Doc Template for RISC-V Extensions.

DOCS := \
spec-sample.adoc fusa-whitepaper.adoc
fusa-whitepaper.adoc

DATE ?= $(shell date +%Y-%m-%d)
VERSION ?= v0.0.0
REVMARK ?= Draft
DOCKER_IMG := riscvintl/riscv-docs-base-container-image:latest
ifneq ($(SKIP_DOCKER),true)
DOCKER_IS_PODMAN = \
$(shell ! docker -v 2>&1 | grep podman >/dev/null ; echo $$?)
ifeq "$(DOCKER_IS_PODMAN)" "1"
DOCKER_VOL_SUFFIX = :z
endif

DOCKER_CMD := \
docker run --rm \
-v ${PWD}:/build${DOCKER_VOL_SUFFIX} \
-w /build \
${DOCKER_IMG} \
/bin/sh -c
DOCKER_QUOTE := "
DOCKER_IS_PODMAN = \
$(shell ! docker -v 2>&1 | grep podman >/dev/null ; echo $$?)
ifeq "$(DOCKER_IS_PODMAN)" "1"
DOCKER_VOL_SUFFIX = :z
endif

DOCKER_CMD := \
docker run --rm \
-u `id -u`:`id -g` \
-v ${PWD}:/build${DOCKER_VOL_SUFFIX} \
-w /build \
${DOCKER_IMG} \
/bin/sh -c
DOCKER_QUOTE := "
endif

SRC_DIR := src
Expand All @@ -45,20 +46,29 @@ XTRA_ADOC_OPTS :=
ASCIIDOCTOR_PDF := asciidoctor-pdf
ASCIIDOCTOR_HTML := asciidoctor
OPTIONS := --trace \
-a compress \
-a mathematical-format=svg \
-a revnumber=${VERSION} \
-a revremark=${REVMARK} \
-a revdate=${DATE} \
-a pdf-fontsdir=docs-resources/fonts \
-a pdf-theme=docs-resources/themes/riscv-pdf.yml \
$(XTRA_ADOC_OPTS) \
-D build \
--failure-level=ERROR
-a compress \
-a mathematical-format=svg \
-a revnumber=${VERSION} \
-a revremark=${REVMARK} \
-a revdate=${DATE} \
-a imagesoutdir=${BUILD_DIR}/images \
-a pdf-fontsdir=docs-resources/fonts \
-a pdf-theme=docs-resources/themes/riscv-pdf.yml \
$(XTRA_ADOC_OPTS) \
-D ${BUILD_DIR}/adoc \
--failure-level=ERROR
REQUIRES := --require=asciidoctor-bibtex \
--require=asciidoctor-diagram \
--require=asciidoctor-lists \
--require=asciidoctor-mathematical
-a compress \
-a mathematical-format=svg \
-a revnumber=${VERSION} \
-a revremark=${REVMARK} \
-a revdate=${DATE} \
-a imagesoutdir=${BUILD_DIR}/images \
-a pdf-fontsdir=docs-resources/fonts \
-a pdf-theme=docs-resources/themes/riscv-pdf.yml \
$(XTRA_ADOC_OPTS) \
-D ${BUILD_DIR}/adoc \
--failure-level=ERROR

.PHONY: all build clean build-container build-no-container build-docs

Expand All @@ -83,6 +93,7 @@ build:
echo "Docker is not available, building without Docker..."; \
$(MAKE) build-no-container; \
fi
@echo "Generated documents can be found in the 'build/adoc' folder."

build-container:
@echo "Starting build inside Docker container..."
Expand Down
1 change: 1 addition & 0 deletions src/fusa-whitepaper.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ include::../docs-resources/global-config.adoc[]
:experimental:
:reproducible:
//:WaveDromEditorApp: app/wavedrom-editor.app
// imagesoutdir is overrided in Makefile
:imagesoutdir: images
//:srcdir: src
:bibtex-file: src/fusa-whitepaper.bib
Expand Down

0 comments on commit 3a0add1

Please sign in to comment.