Add Jmk for lisp reference, LaTeX CI
diff --git a/.build.yml b/.build.yml
index 6f7943b..8f6eb05 100644
--- a/.build.yml
+++ b/.build.yml
@@ -8,7 +8,10 @@
   - python3
   - gawk
   - nasm
-  - libreadline-dev:i386
+  - texlive
+  - texlive-latex-extra
+  - texlive-xetex
+  - global
 tasks:
   - build-kernel: |
       cd bluejay
@@ -20,6 +23,12 @@
       ./bin/jmk
       cd src/lisp
       make
+  - build-latex: |
+      cd bluejay
+      ./bin/jmk
+      cd doc/lisp_reference
+      make
 artifacts:
   - bluejay/src/lisp/lisp
   - bluejay/src/kernel/kernel.elf
+  - bluejay/doc/lisp_reference/lisp_reference.pdf
diff --git a/doc/lisp_reference/Jmk b/doc/lisp_reference/Jmk
new file mode 100644
index 0000000..8bad19f
--- /dev/null
+++ b/doc/lisp_reference/Jmk
@@ -0,0 +1,12 @@
+# -*- mode:makefile -*-
+
+init(lisp_reference, lisp_reference.pdf)
+
+preset(glossaries)
+preset(xelatex)
+
+LATEX_SOURCES = lisp_reference.tex
+
+type(latex)
+
+finish
diff --git a/share/jmk/jmk.m4 b/share/jmk/jmk.m4
index e4bbadf..be6fe3d 100644
--- a/share/jmk/jmk.m4
+++ b/share/jmk/jmk.m4
@@ -22,6 +22,9 @@
 ASM ?= nasm
 CC ?= gcc
 LD ?= ld
+LATEXC ?= pdflatex
+LATEX_MAKE_GLOSSARIES = 0
+LATEX_EXTRAS = *.aux *.glg *.glo *.gls *.idx *.ilg *ind *.ist *.log *.toc
 CFLAGS += -I$(ROOT)/include
 ASMFLAGS += -felf
 jmk_clean_libs =
@@ -43,7 +46,9 @@
 ASMFLAGS += -Fdwarf',
         $1, `32', `CFLAGS += -m32',
         $1, `warn', `CFLAGS += -Wall -Wno-unused-function -Wno-unused-variable -Wno-incompatible-pointer-types',
-        $1, `nasm', `ASM = nasm')')
+        $1, `nasm', `ASM = nasm',
+		$1, `glossaries', `LATEX_MAKE_GLOSSARIES = 1',
+		$1, xelatex, `LATEXC = xelatex')')
 
 dnl this is really, really terrible, but to my knowledge there is no
 dnl other way to escape a $. The manual says nothing about this.
@@ -95,7 +100,16 @@
 `$(jmk_target): $(OBJECTS)
 status_log(LD, dollar_at)
 	@gen_gtags
-	@$(LD) $(LDFLAGS) -o dollar_at $^')')
+	@$(LD) $(LDFLAGS) -o dollar_at $^',
+	$1, latex,
+`$(jmk_target): $(LATEX_SOURCES)
+status_log(LATEX, dollar_at)
+	@$(LATEXC) $<
+ifeq ($(LATEX_MAKE_GLOSSARIES),1)
+status_log(GLOSSARY, dollar_at)
+	@makeglossaries $(patsubst %.tex,%,$<)
+	@$(LATEXC) $<
+endif')')
 
 define(option,
 `$1 ?= $3
@@ -107,7 +121,7 @@
 
 define(finish,
 `clean: $(jmk_clean_libs)
-	@rm -f **/*.o **/*.a *.so $(jmk_target) $(OBJECTS)
+	@rm -f **/*.o **/*.a *.so $(jmk_target) $(OBJECTS) $(LATEX_EXTRAS)
 
 Makefile: Jmk
 status_log(JMK, jmk_build_dir)
diff --git a/src/lisp/compiler.dasc b/src/lisp/compiler.dasc
index 213b644..7e71c51 100644
--- a/src/lisp/compiler.dasc
+++ b/src/lisp/compiler.dasc
@@ -505,11 +505,11 @@
 					| cmp eax, nil;
 					if (or)
 					{
-						| jne =>early;
+						| jne =>after;
 					}
 					else
 					{
-						| je =>early;
+						| je =>after;
 					}
 				}
 			}