-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile.pwsh
54 lines (43 loc) · 1.58 KB
/
Makefile.pwsh
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#
# Makefile.pwsh
#
# Makefile for Windows powershell; assumes make has been installed (in addition to the standard doc
# flow tools):
# http://gnuwin32.sourceforge.net/packages/make.htm
#
# This file is the currently approved pdf publishing flow
#
PWSHCMD=powershell -noprofile -command
SPEC=cmobase
# version is TG version number; should be updated in both Makefiles
VERSION=1.0.1
DATE=$(shell date -UFormat \"%Y.%m.%d\")
COMMITDATE=$(shell git log -1 --format=%cs)
GITVERSION=$(shell git describe --tag --always --dirty)
# moved STAGE/revremark to cmobase.adoc
$(SPEC)-v$(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 $@ \
$<
# ignore ghostscript optimization for now
# gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -sOutputFile=opt-$@ $@ && mv opt-$@ $@
$(SPEC)/autogenerated:
$(PWSHCMD) mkdir $@
# the original Makefile wrote to a temp file ($@-tmp) and compared with the
# previous version; ignore that for now
$(SPEC)/autogenerated/revision.adoc-snippet: Makefile $(SPEC)/autogenerated FORCE
$(PWSHCMD) echo (':revdate: ' + '${COMMITDATE}') > $@
$(PWSHCMD) echo (':revnumber: ' + '${VERSION}' + '-' + '${GITVERSION}') >> $@
# $(PWSHCMD) echo (':revremark: ' + '${STAGE}') >> $@
# $(PWSHCMD) diff (cat $@) (cat $@-tmp) || $(PWSHCMD) mv $@-tmp $@
clean:
$(PWSHCMD) rm $(SPEC)-*.pdf
FORCE: