-
Notifications
You must be signed in to change notification settings - Fork 65
/
Makefile
38 lines (30 loc) · 1.29 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
SPEC=bitmanip
DATE=$(shell date +%Y%m%d)
VERSION=$(shell git describe --tag --always --dirty)
$(SPEC)-$(VERSION).pdf: $(SPEC)/$(SPEC).adoc \
$(SPEC)/*.adoc \
$(SPEC)/insns/*.adoc \
$(SPEC)/autogenerated/revision.adoc-snippet
asciidoctor-pdf -r asciidoctor-diagram \
-D . \
-a toc \
-a compress \
-a pdf-style=resources/themes/risc-v_spec-pdf.yml \
-a pdf-fontsdir=resources/fonts \
-o $@ \
$<
gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -sOutputFile=opt-$@ $@ && mv opt-$@ $@
DATE=$(shell date +%Y.%m.%d)
VERSION=$(shell git describe --tag --always --dirty)
COMMITDATE=$(shell git show -s --format=%ci | cut -d ' ' -f 1)
$(SPEC)/autogenerated:
-mkdir $@
STAGE ?= "This document is in the Frozen state. Change is extremely unlikely. A high threshold will be used, and a change will only occur because of some truly critical issue being identified during the public review cycle. Any other desired or needed changes can be the subject of a follow-on new extension."
$(SPEC)/autogenerated/revision.adoc-snippet: Makefile $(SPEC)/autogenerated FORCE
echo ":revdate: ${COMMITDATE}" > $@-tmp
echo ":revnumber: ${VERSION}" >> $@-tmp
echo ":revremark: ${STAGE}" >> $@-tmp
diff $@ $@-tmp || mv $@-tmp $@
clean:
rm -f $(SPEC)-*.pdf
FORCE: