Re: [PATCH v2 1/2] Add a makefile to build usable documents


atishp@...
 

On Thu, 2020-11-19 at 10:54 +0530, Anup Patel wrote:
Add a simple makefile to build PDF and HTML documents using
asciidoctor. These documents (PDF/HTML) are easy to read and
can be shared/distributed.

Signed-off-by: Anup Patel <anup.patel@...>
---
Makefile | 29 +++++++++++++++++++++++++++++
README.adoc | 13 +++++++++++++
2 files changed, 42 insertions(+)
create mode 100644 Makefile

diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..70ce3db
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,29 @@
+#
+# Build usable documents
+#
+
+ASCIIDOCTOR = asciidoctor
+ASCIIDOCTOR-PDF = asciidoctor-pdf
+TARGETS = riscv-sbi.pdf
+TARGETS += riscv-sbi.html
+
+.PHONY: all
+all: $(TARGETS)
+
+%.html: %.adoc
+ $(ASCIIDOCTOR) -a toc -a sectnums $<
+
+%.pdf: %.adoc
+ $(ASCIIDOCTOR-PDF) -a toc -a sectnums $<
+
+.PHONY: clean
+clean:
+ rm -f $(TARGETS)
+
+.PHONY: install-debs
+install-debs:
+ sudo apt-get install pandoc asciidoctor ruby-asciidoctor-pdf
+
+.PHONY: install-rpms
+install-rpms:
+ sudo dnf install pandoc rubygem-asciidoctor rubygem-
asciidoctor-pdf
diff --git a/README.adoc b/README.adoc
index 2c479eb..9b5ef04 100644
--- a/README.adoc
+++ b/README.adoc
@@ -15,3 +15,16 @@ there before being merged.

https://github.com/riscv/opensbi[OpenSBI] is the reference
implementation,
but other implementations exist; see section "SBI Implementation
IDs".
+
+= Licensing
+
+The files in this repository are licensed under the Creative Commons
+Attribution 4.0 International License (CC-BY 4.0). The full license
+text is available at https://creativecommons.org/licenses/by/4.0/.
+
+= Building Documents
+
+The final specification in form of PDF and HTML can be generated
using
+`make` command. The `makefile` internally uses asciidoctor so the
packages
+required by the `makefile` need to be installed on the build system
using
+`make install-debs` or `make install-rpms`.
Reviewed-by: Atish Patra <atish.patra@...>

--
Regards,
Atish

Join tech-unixplatformspec@lists.riscv.org to automatically receive all group messages.