acebf478d3d84c44a3ed41faedeb3ae2f1947db6
[libreriscv.git] / openpower / sv / rfc / Makefile
1 .PHONY: all clean upload
2
3 .SECONDARY:
4
5 main_sources = $(wildcard ls[0-9][0-9][0-9].mdwn)
6 pdfs = $(patsubst %.mdwn,%.pdf,$(main_sources))
7 deps = $(patsubst %,tex_out/%.d,$(main_sources))
8
9 all: $(pdfs)
10
11 ls012 = $(realpath ls012)
12
13 $(ls012)/areas.mdwn $(ls012)/xo_cost.mdwn: ls012_optable.py ls012/optable.csv
14 python3 ls012_optable.py
15
16 tex_out/%.mdwn.d: %.mdwn ../../mdwn_inline.py
17 @mkdir -p $(dir $@)
18 @../../mdwn_inline.py --deps $< tex_out/$*.mdwn
19
20 tex_out/%.mdwn: %.mdwn ../../mdwn_inline.py
21 mkdir -p $(dir $@)
22 ../../mdwn_inline.py $< tex_out/$*.mdwn
23
24 %.pdf: tex_out/%.mdwn ../../pandoc_img.py
25 pandoc \
26 --filter ../../pandoc_img.py \
27 -V margin-top=0.9in \
28 -V margin-bottom=0.9in \
29 -V margin-left=0.4in \
30 -V margin-right=0.4in \
31 -V fontsize=9pt \
32 -V papersize=legal \
33 -V linkcolor=blue \
34 -f markdown $< \
35 -s --self-contained \
36 --mathjax \
37 -o $@
38
39 upload:
40 rsync -HPavz *.pdf libre-soc.org:opf_isa_wg/
41 ssh libre-soc.org 'cp opf_isa_wg/*.pdf /var/www/ftp.libre-riscv.org/opf_ext_rfc/'
42
43 clean:
44 rm -fr *.pdf tex_out ls012/areas.mdwn ls012/xo_cost.mdwn
45
46 -include $(deps)