bug 1055: add fixed/fp load/store shifted to ls004
[libreriscv.git] / openpower / sv / rfc / Makefile
index a06826d424601740d818d47d08ab391680518a38..62d0cc31d97475fe1f1aead2733f00f9306f88dd 100644 (file)
@@ -1,51 +1,53 @@
-all: ls001.pdf ls002.pdf ls003.pdf ls004.pdf ls005.pdf ls006.pdf ls007.pdf
-
-LSO10_FILES = ls010.mdwn ../svp64.mdwn \
-              ../normal.mdwn \
-              ../ldst.mdwn \
-              ../branches.mdwn \
-              ../po9_encoding.mdwn \
-              ../cr_ops.mdwn
-
-ls010.pdf: $(LS010_FILES)
-       cd ../.. && pandoc \
-            --filter pandoc_img.py \
-               -V margin-top=0.9in \
-               -V margin-bottom=0.9in \
-               -V margin-left=0.4in \
-               -V margin-right=0.4in \
-               -V fontsize=9pt \
-               -V papersize=legal \
-               -V linkcolor=blue \
-               -f markdown \
-                    sv/rfc/ls010.mdwn \
-                    sv/po9_encoding.mdwn \
-                    sv/svp64.mdwn \
-                    sv/normal.mdwn \
-                    sv/ldst.mdwn \
-                    sv/branches.mdwn \
-                    sv/cr_ops.mdwn \
-               -s --self-contained \
-               --mathjax \
-               -o sv/rfc/ls010.pdf
+.PHONY: all clean upload
+
+.SECONDARY:
 
-%.pdf: %.mdwn
+main_sources = $(wildcard ls*.mdwn)
+pdfs = $(patsubst %.mdwn,%.pdf,$(main_sources))
+deps = $(patsubst %,tex_out/%.d,$(main_sources))
+
+all: $(pdfs)
+
+ls012 = $(realpath ls012)
+
+$(ls012)/areas.mdwn $(ls012)/xo_cost.mdwn \
+$(ls012)/level.mdwn: ls012_optable.py ls012/optable.csv
+       @echo making optables
+       python3 ls012_optable.py
+
+tex_out/%.mdwn.d: %.mdwn ../../mdwn_inline.py
+       @mkdir -p $(dir $@)
+       @../../mdwn_inline.py --deps $< tex_out/$*.mdwn
+
+tex_out/%.mdwn: %.mdwn ../../mdwn_inline.py
+       mkdir -p $(dir $@)
+       ../../mdwn_inline.py $< tex_out/$*.mdwn
+
+%.pdf: tex_out/%.mdwn ../../pandoc_img.py
        pandoc \
-               -V margin-top=0.9in \
-               -V margin-bottom=0.9in \
+               --pdf-engine=xelatex \
+           -V 'mainfont:DejaVuSerif' \
+           -V 'sansfont:DejaVuSans' \
+           -V 'monofont:DejaVuSansMono' \
+           -V 'mathfont:Latin Modern Math' \
+               --filter ../../pandoc_img.py \
+               -V margin-top=0.6in \
+               -V margin-bottom=0.6in \
                -V margin-left=0.4in \
                -V margin-right=0.4in \
                -V fontsize=9pt \
                -V papersize=legal \
                -V linkcolor=blue \
-               -f markdown $*.mdwn \
+               -f markdown $< \
                -s --self-contained \
                --mathjax \
-               -o $*.pdf
+               -o $@
 
 upload:
        rsync -HPavz *.pdf libre-soc.org:opf_isa_wg/
        ssh libre-soc.org 'cp opf_isa_wg/*.pdf /var/www/ftp.libre-riscv.org/opf_ext_rfc/'
 
 clean:
-       rm -fr *.pdf
+       rm -fr *.pdf tex_out ls012/areas.mdwn ls012/xo_cost.mdwn
+
+-include $(deps)