aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile46
-rw-r--r--README2
-rw-r--r--document/format.tex (renamed from document/format.orig.tex)0
-rwxr-xr-xmake40
4 files changed, 47 insertions, 41 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..cc90f91
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,46 @@
+IMGS := imgs/2019-10-16.png imgs/2019-10-30.png imgs/2019-12-19.png imgs/2019-12-20.png imgs/2019-12-3.png imgs/2019-12-5.png
+GRAPHS := graph/depth_width.png graph/nearest_neighbor.png
+ASSETS := $(IMGS) $(GRAPHS)
+
+$(shell mkdir -p imgs graph outputs)
+
+.PHONY: all
+all: outputs/posterboard.pdf outputs/report.pdf outputs/logbook.pdf
+.PHONY: png
+png: outputs/posterboard.png
+.PHONY: clean
+clean:
+ rm -rf imgs graph outputs
+
+$(IMGS): data.py
+ cd imgs && \
+ python3 ../data.py img
+
+$(GRAPHS): data.py
+ cd graph && \
+ python3 ../data.py depwid && \
+ python3 ../data.py nei
+
+outputs/posterboard.png: outputs/posterboard.pdf
+ gs -sDEVICE=pngalpha -r288 -o outputs/posterboard.png outputs/posterboard.pdf
+
+outputs/posterboard.pdf: $(wildcard poster/*.tex) outputs/qr-source.png outputs/qr.png $(ASSETS)
+ cd poster && pdftex document.tex >/dev/null
+ rm poster/document.log
+ mv poster/document.pdf outputs/posterboard.pdf
+
+outputs/logbook.pdf: logbook.tex document/research.tex document/biblio.tex poster/hypothesis.tex data/mats.tex poster/vars.tex poster/methods.tex document/tables.tex poster/conclusion.tex data/bulletnotes.tex $(ASSETS)
+ pdftex logbook.tex >/dev/null
+ rm logbook.log
+ mv logbook.pdf outputs
+
+outputs/report.pdf: $(wildcard outputs/*.tex) $(ASSETS)
+ cd document && pdftex report.tex >/dev/null
+ rm document/report.log
+ mv document/report.pdf outputs
+
+outputs/qr.png:
+ qrencode https://hrhr.dev/report.pdf -o outputs/qr.png
+
+outputs/qr-source.png:
+ qrencode https://git.hrhr.dev/scifair -o outputs/qr-source.png
diff --git a/README b/README
index 75335e5..d7d1fa8 100644
--- a/README
+++ b/README
@@ -6,7 +6,7 @@ Contains some .tex files for generating the report in plain TeX and .py files fo
## Compiling
-Run `./make`, a portable shell script that requires python3 and pdftex in the PATH
+Run `make` to build with the portable Makefile that requires python3, gs (ghostscript), and pdftex in the PATH
## Results
diff --git a/document/format.orig.tex b/document/format.tex
index 6238f1c..6238f1c 100644
--- a/document/format.orig.tex
+++ b/document/format.tex
diff --git a/make b/make
deleted file mode 100755
index fc5da29..0000000
--- a/make
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/sh
-
-create(){
-mkdir imgs
-cd imgs
-python3 ../data.py img || python ../data.py img || echo "You must install python3"
-cd ..
-mkdir graph
-cd graph
-python3 ../data.py depwid || python ../data.py depwid
-python3 ../data.py nei || python ../data.py nei
-cd ..
-mkdir outputs
-cd document
-cp format.orig.tex format.tex
-pdftex report.tex || echo "You must install \`pdftex\` (MacTeX, TeXLive, MikTeX, etc)"
-mv report.pdf ../outputs/report-double.pdf
-sed format.orig.tex -e 's/\\baselineskip=24pt/\\baselineskip=14pt/g' >format.tex
-pdftex report.tex
-mv report.pdf ../outputs/report-single.pdf
-cd ..
-rm *.log
-rm document/report.log
-cp assets/* outputs/
-qrencode https://hrhr.dev/report.pdf -o outputs/qr.png || echo "For QR code, install \`qrencode\`"
-qrencode https://git.hrhr.dev/scifair -o outputs/qr-source.png
-cd poster
-pdftex document.tex
-mv document.pdf ../outputs/posterboard.pdf
-cd ..
-gs -sDEVICE=pngalpha -r288 -o outputs/posterboard.png outputs/posterboard.pdf || echo "You must install ghostscript to obtain a posterboard png"
-pdftex logbook.tex
-mv logbook.pdf outputs/
-rm document/format.tex document.log logbook.log
-}
-
-export orig="$(pwd)"
-cd $(dirname $0)
-create 2>/dev/null
-cd $orig