diff --git a/Makefile b/Makefile
new file mode 100755
index 0000000..0f17362
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,39 @@
+
+ABFLAGS = --backend=docbook --doctype=book --attribute=revisionhistory
+adocs = book.asciidoc
+ # introduction.asciidoc \
+ # preface.asciidoc \
+ # compiler.asciidoc \
+ # beam.asciidoc \
+ # beam_modules.asciidoc \
+ # processes.asciidoc \
+ # type_system.asciidoc \
+ # memory.asciidoc \
+ # erts-book.asciidoc \
+ # ap-beam_instructions.asciidoc \
+ # opcodes_doc.asciidoc
+
+all: beam-book.pdf
+
+book-revhistory.xml: .git
+ ./gitlog.sh git-log.xml $@
+
+beam-book-from-ab.xml: $(adocs)\
+ book-revhistory.xml
+ asciidoc $(ABFLAGS) -o $@ book.asciidoc
+
+beam-book.pdf: beam-book-from-ab.xml book-revhistory.xml
+ dblatex beam-book-from-ab.xml -o $@
+
+
+# $(subst .asciidoc,.html, $(adocs)): %.html: %.asciidoc
+# asciidoc -a icons -a toc2 $<
+
+# index.html: *.asciidoc
+# asciidoc -o index.html -a icons -a toc2 book.asciidoc
+
+# generate_op_doc.beam: generate_op_doc.erl
+# erlc generate_op_doc.erl
+
+# opcodes_doc.asciidoc: ../otp/lib/compiler/src/genop.tab generate_op_doc.beam
+# erl -noshell -s generate_op_doc from_shell ../otp/lib/compiler/src/genop.tab opcodes_doc.asciidoc
diff --git a/book.asciidoc b/book.asciidoc
new file mode 100644
index 0000000..78881aa
--- /dev/null
+++ b/book.asciidoc
@@ -0,0 +1,67 @@
+= The Erlang Runtime System
+
+// include::preface.asciidoc[]
+
+// Part I
+
+// include::introduction.asciidoc[]
+
+// include::compiler.asciidoc[]
+
+// include::processes.asciidoc[]
+
+// include::type_system.asciidoc[]
+
+// include::beam.asciidoc[]
+
+// include::beam_modules.asciidoc[]
+
+// include::beam_instructions.asciidoc[]
+
+// include::calls.asciidoc[]
+
+// include::beam_loader.asciidoc[]
+
+// include::beam_internal_instructions.asciidoc[]
+
+// include::scheduling.asciidoc[]
+
+// include::memory.asciidoc[]
+
+// include::data_structures.asciidoc[]
+
+// include::io.asciidoc[]
+
+// include::distribution.asciidoc[]
+
+// include::c.asciidoc[]
+
+// include::hipe.asciidoc[]
+
+// Part II
+[[P-Running]]
+= Running ERTS
+
+// include::building.asciidoc[] - moved to ops
+// include::shell.asciidoc[] - moved to ops
+
+// include::ops.asciidoc[]
+
+// include::crash_dumps.asciidoc[] - moved to ops
+// include::debugger.asciidoc[] - moved to ops
+// include::tracing.asciidoc[] - mode to ops
+
+// include::tweak.asciidoc[]
+
+// Appendix
+
+// include::index.asciidoc[]
+
+
+// include::ap-beam_instructions.asciidoc[]
+
+// include::ap-code_listings.asciidoc[]
+
+
+
+
diff --git a/gitlog.sh b/gitlog.sh
new file mode 100755
index 0000000..e15b48a
--- /dev/null
+++ b/gitlog.sh
@@ -0,0 +1,4 @@
+rm -f $1
+git log --date=short --pretty=format:"%n %an%n %ad%n %s%n" | sed -e '1i' -e '$a' > $1 && rm -f $2
+xsltproc hg2revhistory.xsl $1 > $2
+echo git-log done