From 8381e3df41b6c8d04c2bae2bb65eba0fb08368e2 Mon Sep 17 00:00:00 2001
From: Holden Rohrer
Date: Thu, 6 Feb 2020 19:09:36 -0500
Subject: switched to makefile build
---
Makefile | 46 ++++++++++++++++++++++++++++++++++++++++++++++
README | 2 +-
document/format.orig.tex | 28 ----------------------------
document/format.tex | 28 ++++++++++++++++++++++++++++
make | 40 ----------------------------------------
5 files changed, 75 insertions(+), 69 deletions(-)
create mode 100644 Makefile
delete mode 100644 document/format.orig.tex
create mode 100644 document/format.tex
delete mode 100755 make
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.orig.tex
deleted file mode 100644
index 6238f1c..0000000
--- a/document/format.orig.tex
+++ /dev/null
@@ -1,28 +0,0 @@
-\input ../generic
-
-\twelverm\baselineskip=24pt
-\parindent=.5in
-%% Headers
-\expandafter\ifx\csname abstract\endcsname\relax
- \let\abstract\relax
-\fi
-\nopagenumbers
-{\parindent=0in\leftskip=0pt plus 1fill\rightskip=0pt plus 1fill\parskip=\bigskipamount
-\hbox{}
-\vskip0pt plus 2fill
-{\obeylines Antlions' Group Distribution and Behavior under Varying Spatial Constraints
-Holden Rohrer and Radeen Dixon
-Georgia Science Fair
-Source: \link{https://git.hrhr.dev/scifair}
-}
-\vskip 0pt plus .5fill
-\centerline{\fourteenbf Abstract}
-{\leftskip=.5in\rightskip=.5in\baselineskip=14pt
-\abstract
-}
-\vskip0pt plus 2fill
-\eject
-}
-\pageno=1
-\headline={\baselineskip=0.5in \twelverm \hfil \vbox{\hbox{\ifnum\pageno=1\else Dixon \& Rohrer \the\pageno \fi}}}
-
diff --git a/document/format.tex b/document/format.tex
new file mode 100644
index 0000000..6238f1c
--- /dev/null
+++ b/document/format.tex
@@ -0,0 +1,28 @@
+\input ../generic
+
+\twelverm\baselineskip=24pt
+\parindent=.5in
+%% Headers
+\expandafter\ifx\csname abstract\endcsname\relax
+ \let\abstract\relax
+\fi
+\nopagenumbers
+{\parindent=0in\leftskip=0pt plus 1fill\rightskip=0pt plus 1fill\parskip=\bigskipamount
+\hbox{}
+\vskip0pt plus 2fill
+{\obeylines Antlions' Group Distribution and Behavior under Varying Spatial Constraints
+Holden Rohrer and Radeen Dixon
+Georgia Science Fair
+Source: \link{https://git.hrhr.dev/scifair}
+}
+\vskip 0pt plus .5fill
+\centerline{\fourteenbf Abstract}
+{\leftskip=.5in\rightskip=.5in\baselineskip=14pt
+\abstract
+}
+\vskip0pt plus 2fill
+\eject
+}
+\pageno=1
+\headline={\baselineskip=0.5in \twelverm \hfil \vbox{\hbox{\ifnum\pageno=1\else Dixon \& Rohrer \the\pageno \fi}}}
+
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
--
cgit