aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2017-02-01 20:41:47 -0800
committerAndrew Waterman <andrew@sifive.com>2017-02-01 20:41:47 -0800
commitab6f8c9bd7bc85361fcf35667d1fddfaf367a53f (patch)
tree716a2118ca0565dbb4e7903723f283ae4dd13c46 /build
parent207a7c6ee51aa2fd74d4618cd1369ddc21706b9e (diff)
downloadriscv-isa-manual-ab6f8c9bd7bc85361fcf35667d1fddfaf367a53f.zip
riscv-isa-manual-ab6f8c9bd7bc85361fcf35667d1fddfaf367a53f.tar.gz
riscv-isa-manual-ab6f8c9bd7bc85361fcf35667d1fddfaf367a53f.tar.bz2
Reorganize directory structure
Diffstat (limited to 'build')
-rw-r--r--build/.gitignore7
-rw-r--r--build/Makefile68
2 files changed, 75 insertions, 0 deletions
diff --git a/build/.gitignore b/build/.gitignore
new file mode 100644
index 0000000..dba8159
--- /dev/null
+++ b/build/.gitignore
@@ -0,0 +1,7 @@
+*.aux
+*.bbl
+*.blg
+*.log
+*.out
+*.pdf
+*.toc
diff --git a/build/Makefile b/build/Makefile
new file mode 100644
index 0000000..ae4c9df
--- /dev/null
+++ b/build/Makefile
@@ -0,0 +1,68 @@
+#=======================================================================
+# Makefile for generating latex documents
+#-----------------------------------------------------------------------
+#
+# This is a simple makefile for generating latex documents. It will
+# run bibtex, generate eps from xfig figures, and make pdfs. The
+# makefile supports builds in non-source directories: just make a
+# build directory, copy the makefile there, and change the srcdir
+# variable accordingly.
+#
+# Note that the makefile assumes that the default dvips/ps2pdfwr
+# commands "do the right thing" for fonts in pdfs. This is true on
+# Athena/Linux and Fedora Core but is not true for older redhat installs ...
+#
+# At a minimum you should just change the main variable to be
+# the basename of your toplevel tex file. If you use a bibliography
+# then you should set the bibfile variable to be the name of your
+# .bib file (assumed to be in the source directory).
+#
+
+srcdir = ../src
+
+docs_with_bib = riscv-spec riscv-privileged
+docs_without_bib =
+
+srcs = $(wildcard $(srcdir)/*.tex)
+figs = $(wildcard $(srcdir)/figs/*)
+bibs = $(srcdir)/riscv-spec.bib
+
+#=======================================================================
+# You shouldn't need to change anything below this
+#=======================================================================
+
+PDFLATEX := TEXINPUTS=$(srcdir): pdflatex
+BIBTEX := BIBINPUTS=$(srcdir): bibtex
+
+default : pdf
+
+#------------------------------------------------------------
+# PDF
+
+pdfs_with_bib = $(addsuffix .pdf, $(docs_with_bib))
+pdfs_without_bib = $(addsuffix .pdf, $(docs_without_bib))
+pdfs = $(pdfs_with_bib) $(pdfs_without_bib)
+
+pdf : $(pdfs)
+.PHONY: pdf open
+
+open: $(pdfs)
+ open $(pdfs)
+
+$(pdfs_with_bib): %.pdf: $(srcdir)/%.tex $(srcs) $(figs) $(bibs)
+ $(PDFLATEX) $*
+ $(BIBTEX) $*
+ $(PDFLATEX) $*
+ $(PDFLATEX) $*
+
+$(pdfs_without_bib): %.pdf: $(srcdir)/%.tex $(srcs) $(figs)
+ $(PDFLATEX) $*
+ $(PDFLATEX) $*
+
+junk += $(pdfs) *.aux *.log *.bbl *.blg *.toc *.out
+
+#------------------------------------------------------------
+# Other Targets
+
+clean :
+ rm -rf $(junk) *~ \#*