sync_up: Discussion page for tomorrow's meeting
[libreriscv.git] / openpower / Makefile
index fd1c2e0a3b1bef622ac13c6f8d9490acf8093681..f3899f7895b47ed0d3a75b77acfe65677efdbdc3 100755 (executable)
 #!/usr/bin/make -f
+.PHONY: tex clean upload pdf
 
-tex:
+pdf : simple_v_spec.pdf
+
+ISA_DIR := ../../openpower-isa/openpower/isa
+SOURCE_TEX := \
+       tex_out/remap.tex \
+       tex_out/remap_appendix.tex \
+       tex_out/bitmanip.tex tex_out/vector_ops.tex \
+       tex_out/sv.tex tex_out/svp64_appendix.tex \
+       tex_out/overview.tex tex_out/svp64.tex \
+       tex_out/executive_summary.tex \
+       tex_out/compliancy_levels.tex tex_out/svp64_quirks.tex \
+       tex_out/sprs.tex tex_out/opcode_regs_deduped.tex \
+       tex_out/normal.tex tex_out/ldst.tex \
+       tex_out/branches.tex tex_out/cr_ops.tex \
+       tex_out/setvl.tex tex_out/svstep.tex \
+       tex_out/mv_swizzle.tex tex_out/mv_vec.tex \
+       tex_out/pseudocode_simplev.tex \
+       tex_out/pseudocode_bitmanip.tex \
+       tex_out/cr_int_predication.tex \
+       tex_out/fcvt.tex tex_out/fclass.tex \
+       tex_out/int_fp_mv.tex tex_out/av_opcodes.tex \
+       tex_out/big_integer.tex \
+       tex_out/pseudocode_fixedshift.tex \
+       tex_out/pseudocode_bcd.tex tex_out/pseudocode_branch.tex \
+       tex_out/pseudocode_comparefixed.tex \
+       tex_out/pseudocode_condition.tex \
+       tex_out/pseudocode_svfparith.tex \
+       tex_out/pseudocode_fixedarith.tex \
+       tex_out/pseudocode_fixedload.tex \
+       tex_out/pseudocode_fixedlogical.tex \
+       tex_out/pseudocode_fixedstore.tex \
+       tex_out/pseudocode_fixedtrap.tex \
+       tex_out/pseudocode_sprset.tex \
+       tex_out/pseudocode_stringldst.tex \
+       tex_out/pseudocode_system.tex \
+       tex_out/pseudocode_fpload.tex tex_out/pseudocode_fpstore.tex \
+       tex_out/pseudocode_fpmove.tex tex_out/pseudocode_fparith.tex \
+       tex_out/pseudocode_fpcvt.tex \
+       tex_out/pseudocode_svfixedarith.tex \
+       tex_out/big_integer_analysis.tex \
+       tex_out/transcendentals.tex \
+       tex_out/atomics.tex \
+       tex_out/sv_analysis.tex \
+       tex_out/vector_isas.tex \
+       tex_out/comparison_table.tex \
+       tex_out/fields.tex
+
+# Does this umbrella rule need to be modified?
+tex: $(SOURCE_TEX)
        mkdir -p tex_out
+
+tex_out/sv_analysis.tex : sv/sv_analysis.mdwn mdwn_inline.py \
+                       ../../openpower-isa/src/openpower/sv/sv_analysis.py
+       mkdir -p tex_out
+       ./mdwn_inline.py sv/sv_analysis.mdwn tex_out/sv_analysis.mdwn
        pandoc -f markdown -t latex --top-level-division=section \
-            -N -o tex_out/sv.tex sv.mdwn
+                       --filter pandoc_img.py \
+                       -N -o tex_out/sv_analysis.tex tex_out/sv_analysis.mdwn
+
+tex_out/comparison_table.tex : sv/comparison_table.mdwn texmunge.py
+       mkdir -p tex_out
        pandoc -f markdown -t latex --top-level-division=section \
-            -N -o tex_out/overview.tex sv/overview.mdwn
+                       --filter pandoc_img.py \
+                       -N -o tex_out/comparison_table_pre.tex sv/comparison_table.mdwn
+       ./texmunge.py tex_out/comparison_table_pre.tex tex_out/comparison_table.tex 
+
+tex_out/vector_isas.tex : sv/vector_isa_comparison.mdwn
+       mkdir -p tex_out
        pandoc -f markdown -t latex --top-level-division=section \
-            -N -o tex_out/svp64.tex sv/svp64.mdwn
+                       --filter pandoc_img.py \
+                       -N -o tex_out/vector_isas.tex sv/vector_isa_comparison.mdwn
+
+tex_out/big_integer_analysis.tex : sv/biginteger/analysis.mdwn
+       mkdir -p tex_out
        pandoc -f markdown -t latex --top-level-division=section \
-            -N -o tex_out/svp64_appendix.tex sv/svp64/appendix.mdwn
+                       --filter pandoc_img.py \
+                       -N -o tex_out/big_integer_analysis.tex sv/biginteger/analysis.mdwn
+
+tex_out/pseudocode_fixedlogical.tex : $(ISA_DIR)/fixedlogical.mdwn
+       mkdir -p tex_out
        pandoc -f markdown -t latex --top-level-division=section \
-            -N -o tex_out/compliancy_levels.tex sv/compliancy_levels.mdwn
+                       --filter pandoc_img.py \
+                       -N -o tex_out/pseudocode_fixedlogical.tex \
+                       $(ISA_DIR)/fixedlogical.mdwn
+
+tex_out/pseudocode_fixedarith.tex : $(ISA_DIR)/fixedarith.mdwn
+       mkdir -p tex_out
        pandoc -f markdown -t latex --top-level-division=section \
-            -N -o tex_out/svp64_quirks.tex sv/svp64_quirks.mdwn
+                       --filter pandoc_img.py \
+                       -N -o tex_out/pseudocode_fixedarith.tex \
+                       $(ISA_DIR)/fixedarith.mdwn
+
+tex_out/pseudocode_svfixedarith.tex : $(ISA_DIR)/svfixedarith.mdwn
+       mkdir -p tex_out
        pandoc -f markdown -t latex --top-level-division=section \
-            -N -o tex_out/sprs.tex sv/sprs.mdwn
+                       --filter pandoc_img.py \
+                       -N -o tex_out/pseudocode_svfixedarith.tex \
+                       $(ISA_DIR)/svfixedarith.mdwn
+
+tex_out/pseudocode_svfparith.tex : $(ISA_DIR)/svfparith.mdwn
+       mkdir -p tex_out
        pandoc -f markdown -t latex --top-level-division=section \
-            -N -o tex_out/opcode_regs_deduped.tex opcode_regs_deduped.mdwn
+                       --filter pandoc_img.py \
+                       -N -o tex_out/pseudocode_svfparith.tex \
+                       $(ISA_DIR)/svfparith.mdwn
+
+tex_out/sv.tex : sv.mdwn
+       mkdir -p tex_out
        pandoc -f markdown -t latex --top-level-division=section \
-            -N -o tex_out/normal.tex sv/normal.mdwn
+                       --filter pandoc_img.py \
+                       -N -o tex_out/sv.tex sv.mdwn
+
+tex_out/overview.tex : sv/overview.mdwn
+       mkdir -p tex_out
        pandoc -f markdown -t latex --top-level-division=section \
-            -N -o tex_out/ldst.tex sv/ldst.mdwn
+                       --filter pandoc_img.py \
+                       -N -o tex_out/overview.tex sv/overview.mdwn
+
+tex_out/svp64.tex : sv/svp64.mdwn
+       mkdir -p tex_out
        pandoc -f markdown -t latex --top-level-division=section \
-            -N -o tex_out/branches.tex sv/branches.mdwn
+                       --filter pandoc_img.py \
+                       -N -o tex_out/svp64.tex sv/svp64.mdwn
+
+tex_out/compliancy_levels.tex : sv/compliancy_levels.mdwn
+       mkdir -p tex_out
        pandoc -f markdown -t latex --top-level-division=section \
-            -N -o tex_out/cr_ops.tex sv/cr_ops.mdwn
+                       --filter pandoc_img.py \
+                       -N -o tex_out/compliancy_levels.tex sv/compliancy_levels.mdwn
+
+tex_out/svp64_quirks.tex : sv/svp64_quirks.mdwn
+       mkdir -p tex_out
        pandoc -f markdown -t latex --top-level-division=section \
-            -N -o tex_out/setvl.tex sv/setvl.mdwn
+                       --filter pandoc_img.py \
+                       -N -o tex_out/svp64_quirks.tex sv/svp64_quirks.mdwn
+
+tex_out/sprs.tex : sv/sprs.mdwn
+       mkdir -p tex_out
        pandoc -f markdown -t latex --top-level-division=section \
-            -N -o tex_out/svstep.tex sv/svstep.mdwn
+                       --filter pandoc_img.py \
+                       -N -o tex_out/sprs.tex sv/sprs.mdwn
+
+tex_out/opcode_regs_deduped.tex : opcode_regs_deduped.mdwn
+       mkdir -p tex_out
        pandoc -f markdown -t latex --top-level-division=section \
-            -N -o tex_out/remap.tex sv/remap.mdwn
+                       --filter pandoc_img.py \
+                       -N -o tex_out/opcode_regs_deduped.tex opcode_regs_deduped.mdwn
+
+tex_out/normal.tex : sv/normal.mdwn
+       mkdir -p tex_out
        pandoc -f markdown -t latex --top-level-division=section \
-            -N -o tex_out/mv_swizzle.tex sv/mv.swizzle.mdwn
+                       --filter pandoc_img.py \
+                       -N -o tex_out/normal.tex sv/normal.mdwn
+
+tex_out/ldst.tex : sv/ldst.mdwn
+       mkdir -p tex_out
        pandoc -f markdown -t latex --top-level-division=section \
-            -N -o tex_out/mv_vec.tex sv/mv.vec.mdwn
+                       --filter pandoc_img.py \
+                       -N -o tex_out/ldst.tex sv/ldst.mdwn
+
+tex_out/branches.tex : sv/branches.mdwn
+       mkdir -p tex_out
        pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/branches.tex sv/branches.mdwn
+
+tex_out/cr_ops.tex : sv/cr_ops.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/cr_ops.tex sv/cr_ops.mdwn
+
+tex_out/setvl.tex : sv/setvl.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/setvl.tex sv/setvl.mdwn
+
+tex_out/svstep.tex : sv/svstep.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/svstep.tex sv/svstep.mdwn
+
+tex_out/mv_swizzle.tex : sv/mv.swizzle.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/mv_swizzle.tex sv/mv.swizzle.mdwn
+
+tex_out/fields.tex : sv/fields.mdwn mdwn_inline.py \
+                       ../../openpower-isa/openpower/isatables/fields.text
+       mkdir -p tex_out
+       ./mdwn_inline.py sv/fields.mdwn tex_out/fields.mdwn
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/fields.tex tex_out/fields.mdwn
+       sed -i 's/\\section{/\\section*{/g' tex_out/fields.tex
+
+tex_out/mv_vec.tex : sv/mv.vec.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/mv_vec.tex sv/mv.vec.mdwn
+
+tex_out/pseudocode_simplev.tex : $(ISA_DIR)/simplev.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
                        -N -o tex_out/pseudocode_simplev.tex \
-                       ../../openpower-isa/openpower/isa/simplev.mdwn 
+                       $(ISA_DIR)/simplev.mdwn
+
+tex_out/pseudocode_bitmanip.tex : $(ISA_DIR)/bitmanip.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/pseudocode_bitmanip.tex \
+                       $(ISA_DIR)/bitmanip.mdwn
+
+tex_out/cr_int_predication.tex : sv/cr_int_predication.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/cr_int_predication.tex sv/cr_int_predication.mdwn
 
+tex_out/fcvt.tex : sv/fcvt.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/fcvt.tex sv/fcvt.mdwn
 
-pdf:
+tex_out/fclass.tex : sv/fclass.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/fclass.tex sv/fclass.mdwn
+
+tex_out/int_fp_mv.tex : sv/int_fp_mv.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/int_fp_mv.tex sv/int_fp_mv.mdwn
+
+tex_out/av_opcodes.tex : sv/av_opcodes.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/av_opcodes.tex sv/av_opcodes.mdwn
+
+tex_out/big_integer.tex : sv/biginteger.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/big_integer.tex sv/biginteger.mdwn
+
+tex_out/pseudocode_fixedshift.tex : $(ISA_DIR)/fixedshift.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/pseudocode_fixedshift.tex \
+                       $(ISA_DIR)/fixedshift.mdwn
+
+tex_out/atomics.tex: atomics.mdwn mdwn_inline.py \
+                       ../../openpower-isa/src/openpower/sv/sv_analysis.py
+       mkdir -p tex_out
+       ./mdwn_inline.py atomics.mdwn tex_out/atomics.mdwn
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/atomics.tex tex_out/atomics.mdwn
+
+tex_out/transcendentals.tex: transcendentals.mdwn power_trans_ops.mdwn \
+                       mdwn_inline.py
+       mkdir -p tex_out
+       ./mdwn_inline.py transcendentals.mdwn tex_out/transcendentals.mdwn
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/transcendentals.tex tex_out/transcendentals.mdwn
+
+tex_out/executive_summary.tex: sv/executive_summary.mdwn mdwn_inline.py
+       mkdir -p tex_out
+       ./mdwn_inline.py sv/executive_summary.mdwn tex_out/executive_summary.mdwn
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/executive_summary.tex tex_out/executive_summary.mdwn
+
+tex_out/svp64_appendix.tex: sv/svp64/appendix.mdwn mdwn_inline.py \
+                       sv/preduce.py
+       mkdir -p tex_out
+       ./mdwn_inline.py sv/svp64/appendix.mdwn tex_out/appendix.mdwn
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/svp64_appendix.tex tex_out/appendix.mdwn
+
+tex_out/vector_ops.tex: sv/vector_ops.mdwn mdwn_inline.py sv/bmask.py
+       mkdir -p tex_out
+       ./mdwn_inline.py sv/vector_ops.mdwn tex_out/vector_ops.mdwn
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/vector_ops.tex tex_out/vector_ops.mdwn
+
+tex_out/remap_appendix.tex: sv/remap/appendix.mdwn mdwn_inline.py sv/remap.py \
+                       sv/remapyield.py sv/remap_fft_yield.py
+       mkdir -p tex_out
+       ./mdwn_inline.py sv/remap/appendix.mdwn tex_out/remap_appendix.mdwn
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/remap_appendix.tex tex_out/remap_appendix.mdwn
+
+tex_out/remap.tex: sv/remap.mdwn mdwn_inline.py
+       mkdir -p tex_out
+       ./mdwn_inline.py sv/remap.mdwn tex_out/remap.mdwn
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/remap.tex tex_out/remap.mdwn
+
+tex_out/bitmanip.tex: sv/bitmanip.mdwn pandoc_img.py mdwn_inline.py \
+                       sv/draft_opcode_tables.mdwn \
+                       ../../nmigen-gf/gf_reference/pack_poly.py \
+                       ../../nmigen-gf/gf_reference/clmul.py \
+                       ../../nmigen-gf/gf_reference/clmulh.py \
+                       ../../nmigen-gf/gf_reference/clmulr.py \
+                       ../../nmigen-gf/gf_reference/cldivrem.py \
+                       ../../nmigen-gf/gf_reference/decode_reducing_polynomial.py \
+                       ../../nmigen-gf/gf_reference/gfbredpoly.py \
+                       ../../nmigen-gf/gf_reference/gfbmul.py \
+                       ../../nmigen-gf/gf_reference/gfbmadd.py \
+                       ../../nmigen-gf/gf_reference/gfbinv.py \
+                       ../../nmigen-gf/gf_reference/gfpadd.py \
+                       ../../nmigen-gf/gf_reference/gfpsub.py \
+                       ../../nmigen-gf/gf_reference/gfpmul.py \
+                       ../../nmigen-gf/gf_reference/gfpinv.py \
+                       ../../nmigen-gf/gf_reference/gfpmadd.py \
+                       ../../nmigen-gf/gf_reference/gfpmsub.py \
+                       ../../nmigen-gf/gf_reference/gfpmsubr.py
+       mkdir -p tex_out
+       ./mdwn_inline.py sv/bitmanip.mdwn tex_out/bitmanip.mdwn
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/bitmanip.tex tex_out/bitmanip.mdwn
+
+tex_out/pseudocode_bcd.tex : $(ISA_DIR)/bcd.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/pseudocode_bcd.tex \
+                       $(ISA_DIR)/bcd.mdwn
+
+tex_out/pseudocode_branch.tex : $(ISA_DIR)/branch.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/pseudocode_branch.tex \
+                       $(ISA_DIR)/branch.mdwn
+
+tex_out/pseudocode_comparefixed.tex : $(ISA_DIR)/comparefixed.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/pseudocode_comparefixed.tex \
+                       $(ISA_DIR)/comparefixed.mdwn
+
+tex_out/pseudocode_condition.tex : $(ISA_DIR)/condition.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/pseudocode_condition.tex \
+                       $(ISA_DIR)/condition.mdwn
+
+tex_out/pseudocode_fixedload.tex : $(ISA_DIR)/fixedload.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/pseudocode_fixedload.tex \
+                       $(ISA_DIR)/fixedload.mdwn
+
+tex_out/pseudocode_fixedstore.tex : $(ISA_DIR)/fixedstore.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/pseudocode_fixedstore.tex \
+                       $(ISA_DIR)/fixedstore.mdwn
+
+tex_out/pseudocode_fixedtrap.tex : $(ISA_DIR)/fixedtrap.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/pseudocode_fixedtrap.tex \
+                       $(ISA_DIR)/fixedtrap.mdwn
+
+tex_out/pseudocode_sprset.tex : $(ISA_DIR)/sprset.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/pseudocode_sprset.tex \
+                       $(ISA_DIR)/sprset.mdwn
+
+tex_out/pseudocode_stringldst.tex : $(ISA_DIR)/stringldst.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/pseudocode_stringldst.tex \
+                       $(ISA_DIR)/stringldst.mdwn
+
+tex_out/pseudocode_system.tex : $(ISA_DIR)/system.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/pseudocode_system.tex \
+                       $(ISA_DIR)/system.mdwn
+
+tex_out/pseudocode_fpload.tex : $(ISA_DIR)/fpload.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/pseudocode_fpload.tex \
+                       $(ISA_DIR)/fpload.mdwn
+
+tex_out/pseudocode_fpstore.tex : $(ISA_DIR)/fpstore.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/pseudocode_fpstore.tex \
+                       $(ISA_DIR)/fpstore.mdwn
+
+tex_out/pseudocode_fpmove.tex : $(ISA_DIR)/fpmove.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/pseudocode_fpmove.tex \
+                       $(ISA_DIR)/fpmove.mdwn
+
+tex_out/pseudocode_fparith.tex : $(ISA_DIR)/fparith.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/pseudocode_fparith.tex \
+                       $(ISA_DIR)/fparith.mdwn
+
+tex_out/pseudocode_fpcvt.tex : $(ISA_DIR)/fpcvt.mdwn
+       mkdir -p tex_out
+       pandoc -f markdown -t latex --top-level-division=section \
+                       --filter pandoc_img.py \
+                       -N -o tex_out/pseudocode_fpcvt.tex \
+                       $(ISA_DIR)/fpcvt.mdwn
+
+simple_v_spec.pdf : $(SOURCE_TEX) simple_v_spec.tex
+       # clean up old files to make it more reproducable
+       rm -vfr simple_v_spec.aux simple_v_spec.log simple_v_spec.pdf \
+                       simple_v_spec.out simple_v_spec.toc simple_v_spec.bbl \
+                       simple_v_spec.blg simple_v_spec.synctex.gz \
+                       svp64-primer/summary.aux
+       # run pdflatex twice because the first run creates files needed to
+       # properly create the PDF outline by the second run
        pdflatex -synctex=1 -interaction=nonstopmode simple_v_spec.tex
+       pdflatex -synctex=1 -interaction=nonstopmode simple_v_spec.tex
+       bibtex simple_v_spec.aux
+
+upload : pdf
+       rsync -HPavz simple_v_spec.pdf libre-soc.org:
+       ssh libre-soc.org 'cp simple_v_spec.pdf /var/www/ftp.libre-riscv.org'
 
-upload: tex pdf
-       rsync -HPavz simple_v_spec.pdf \
-        libre-soc.org:/var/www/ftp.libre-riscv.org
+clean:
+       rm -fr tex_out simple_v_spec.aux simple_v_spec.log simple_v_spec.pdf \
+                       simple_v_spec.out simple_v_spec.toc simple_v_spec.bbl \
+                       simple_v_spec.blg simple_v_spec.synctex.gz \
+                       svp64-primer/summary.aux