From 008fd0125faa30300348c1663853eadefa2995d2 Mon Sep 17 00:00:00 2001
From: Malin Freeborn <malinfreeborn@tutamail.com>
Date: Tue, 15 Dec 2020 14:15:48 +0100
Subject: [PATCH] replace autocompile with Makefile

---
 Makefile       | 12 ++++++++++++
 autocompile.sh | 30 ------------------------------
 2 files changed, 12 insertions(+), 30 deletions(-)
 create mode 100644 Makefile
 delete mode 100755 autocompile.sh

diff --git a/Makefile b/Makefile
new file mode 100644
index 00000000..2926c4d6
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,12 @@
+filename=example
+output: ${filename}.pdf
+	pdflatex ${filename}.tex
+${filename}.pdf:
+	pdflatex ${filename}.tex
+new:
+	if [ ! -d .git ] && [ -e ../.git ]
+	then
+		cp -n main.tex .gitignore ..
+	fi
+clean:
+	rm -r *.{aux,toc,acn,acr,log,ptc,out,idx,ist,alg,glo} 2>/dev/null
diff --git a/autocompile.sh b/autocompile.sh
deleted file mode 100755
index cb580ace..00000000
--- a/autocompile.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-
-# if you're in the subtree, back up
-[ ! -d .git ] && [ -e ../.git ] && \
-	cd ..
-
-# If you're setting up:
-[ ! -e main.tex ] && [ -e config/main.tex ] && \
-	cp config/main.tex . && \
-	ln -s config/autocompile.sh . && \
-	ln -s config/latexmkrc . && \
-	ln -s config/.gitignore .
-
-git gc --auto
-
-if [ $1 = clean ]; then
-	rm -r *aux *log main.{i,g}* *toc *.ptc *.out svg-inkscape 2>/dev/null
-	exit 0
-fi
-
-if [ $1 = tree ]; then
-	[ -e ../config ] || ( echo "You don't have a local config repo" && exit 1 )
-	git status
-	git subtree -P config pull ../config master || exit 1
-	git subtree -P config push ../config master || exit 1
-fi
-pdflatex -shell-escape main.tex
-makeglossaries main
-makeindex main.idx
-pdflatex main.tex
-- 
GitLab