<Multi_key> <percent> <M> : "Ⅿ" U216F
# Swastika's
-<multi_key> <h> <a> <k> <e> <n> : "卍" U534D
-<multi_key> <h> <a> <k> <e> <i> : "卐" U5350
+<Multi_key> <h> <a> <k> <e> <n> : "卍" U534D
+<Multi_key> <h> <a> <k> <e> <i> : "卐" U5350
--- /dev/null
+.PHONY: clean clobber
+
+DOCUMENT:=$(shell grep -Fl documentclass *.tex)
+LATEX?=pdflatex
+LATEXFLAGS?=--no-shell-escape -file-line-error -halt-on-error
+BIBTEX?=bibtex
+MAKEGLOSSARIES?=makeglossaries
+MAKEINDEX?=makeindex
+
+all: $(subst tex,pdf,$(shell grep -Fl documentclass *.tex))
+
+%.pdf: %.tex $(wildcard *.tex)
+ $(LATEX) $(LATEXFLAGS) $*
+ grep -q '^\\bibdata{' $*.aux && $(BIBTEX) $(BIBTEXFLAGS) $* || true
+ grep -q '\@istfilename' $*.aux && $(MAKEGLOSSARIES) $(MAKEGLOSSARIESFLAGS) $* || true
+ [ -f $*.idx ] && $(MAKEINDEX) $(MAKEINDEXFLAGS) $* || true
+ $(LATEX) $(LATEXFLAGS) $*
+ $(LATEX) $(LATEXFLAGS) $*
+
+clean:
+ $(RM) $(addprefix *.,acn acr alg aux bbl blg fmt glg glo gls idx ilg ind ist loa lof log lol lot nav out snm tdo toc vrb)
+
+clobber: clean
+ $(RM) -i *.pdf