aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorStephano Cetola <scetola@linuxfoundation.org>2021-12-20 17:35:05 -0800
committerStephano Cetola <scetola@linuxfoundation.org>2021-12-20 17:35:05 -0800
commit5099c4a4f393dacf0085fe951a0102d7fd50b68d (patch)
treeadf5eca6aa0673df1647087fa099b5ab817bae71 /build
parent7224171878f7ceb2adcfbd5cc07c19f531e280a1 (diff)
downloadriscv-isa-manual-5099c4a4f393dacf0085fe951a0102d7fd50b68d.zip
riscv-isa-manual-5099c4a4f393dacf0085fe951a0102d7fd50b68d.tar.gz
riscv-isa-manual-5099c4a4f393dacf0085fe951a0102d7fd50b68d.tar.bz2
Update Makefile to use asciidoctor build
This switches the make build from a LaTeX build over to asciidoctor. In doing so, several new generated files need to be ignored, so update the gitignore for the build directory and add a gitignore for the images directory. Signed-off-by: Stephano Cetola <scetola@linuxfoundation.org>
Diffstat (limited to 'build')
-rw-r--r--build/.gitignore2
-rw-r--r--build/Makefile90
2 files changed, 24 insertions, 68 deletions
diff --git a/build/.gitignore b/build/.gitignore
index dba8159..3b37eba 100644
--- a/build/.gitignore
+++ b/build/.gitignore
@@ -5,3 +5,5 @@
*.out
*.pdf
*.toc
+images
+.asciidoctor
diff --git a/build/Makefile b/build/Makefile
index 7a64a4c..3260bea 100644
--- a/build/Makefile
+++ b/build/Makefile
@@ -1,68 +1,22 @@
-#=======================================================================
-# Makefile for generating LaTeX documents
-#-----------------------------------------------------------------------
-#
-# This is a simple makefile for generating LaTeX documents. It will
-# run bibtex, generate eps from xfig figures, and make pdfs. The
-# makefile supports builds in non-source directories: just make a
-# build directory, copy the makefile there, and change the srcdir
-# variable accordingly.
-#
-# Note that the makefile assumes that the default dvips/ps2pdfwr
-# commands "do the right thing" for fonts in pdfs. This is true on
-# Athena/Linux and Fedora Core but is not true for older redhat installs ...
-#
-# At a minimum you should just change the main variable to be
-# the basename of your toplevel tex file. If you use a bibliography
-# then you should set the bibfile variable to be the name of your
-# .bib file (assumed to be in the source directory).
-#
-
-srcdir = ../src
-
-docs_with_bib = riscv-spec riscv-privileged
-docs_without_bib =
-
-srcs = $(wildcard $(srcdir)/*.tex)
-figs = $(wildcard $(srcdir)/figs/*)
-bibs = $(srcdir)/riscv-spec.bib
-
-#=======================================================================
-# You shouldn't need to change anything below this
-#=======================================================================
-
-PDFLATEX := TEXINPUTS=$(srcdir): pdflatex -interaction=nonstopmode -halt-on-error
-BIBTEX := BIBINPUTS=$(srcdir): bibtex
-
-default : pdf
-
-#------------------------------------------------------------
-# PDF
-
-pdfs_with_bib = $(addsuffix .pdf, $(docs_with_bib))
-pdfs_without_bib = $(addsuffix .pdf, $(docs_without_bib))
-pdfs = $(pdfs_with_bib) $(pdfs_without_bib)
-
-pdf : $(pdfs)
-.PHONY: pdf open
-
-open: $(pdfs)
- open $(pdfs)
-
-$(pdfs_with_bib): %.pdf: $(srcdir)/%.tex $(srcs) $(figs) $(bibs)
- $(PDFLATEX) $*
- $(BIBTEX) $*
- $(PDFLATEX) $*
- $(PDFLATEX) $*
-
-$(pdfs_without_bib): %.pdf: $(srcdir)/%.tex $(srcs) $(figs)
- $(PDFLATEX) $*
- $(PDFLATEX) $*
-
-junk += $(pdfs) *.aux *.log *.bbl *.blg *.toc *.out
-
-#------------------------------------------------------------
-# Other Targets
-
-clean :
- rm -rf $(junk) *~ \#*
+HEADER_SOURCE := ../src/riscv-isa-unpr-conv-review.adoc
+PDF_RESULT := unpriv-isa-asciidoc.pdf
+# Not all document sources are yet listed here. Not just adoc files but
+# images/ and resources/ content. Once they are the target can remove the
+# phony use.
+SOURCES := $(HEADER_SOURCE)
+
+all: $(PDF_RESULT)
+
+.PHONY: $(PDF_RESULT)
+$(PDF_RESULT): $(SOURCES)
+ asciidoctor-pdf \
+ --attribute=mathematical-format=svg \
+ --attribute=pdf-fontsdir=../src/resources/fonts \
+ --attribute=pdf-style=../src/resources/themes/riscv-spec.yml \
+ --failure-level=ERROR \
+ --require=asciidoctor-bibtex \
+ --require=asciidoctor-diagram \
+ --require=asciidoctor-mathematical \
+ --trace \
+ --out-file=$@ \
+ $(HEADER_SOURCE)