From da9d81f2a099ac60ec85034eb20b4369b943b483 Mon Sep 17 00:00:00 2001 From: KenwoodFox Date: Tue, 8 Feb 2022 11:50:35 -0500 Subject: [PATCH] Add better variables and readability --- .gitignore | 1 - Paper With Citations/.gitignore | 1 - Paper With Citations/Makefile | 37 ++++++++++++++++++++------------- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index 5a70cf3..98af89d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ _build *.*# -brightspace/ diff --git a/Paper With Citations/.gitignore b/Paper With Citations/.gitignore index 8783f5d..e35d885 100644 --- a/Paper With Citations/.gitignore +++ b/Paper With Citations/.gitignore @@ -1,2 +1 @@ _build -brightspace/ diff --git a/Paper With Citations/Makefile b/Paper With Citations/Makefile index ecd3838..8465ae4 100644 --- a/Paper With Citations/Makefile +++ b/Paper With Citations/Makefile @@ -1,35 +1,42 @@ # Written by joe - +# Variables REVISION := "$(shell git describe --abbrev=8 --dirty --always --tags)" +# Paths +ROOT := "$(PWD)" +BUILDDIR := $(ROOT)/_build +SUBMITDIR := $(BUILDDIR)/Brightspace + + all: pdf submit -# Move all files to the build dir +# Move everything required to builddir copy: - mkdir -p _build - find -type f '(' -name "*.tex*" -o -name "*.sty*" -o -name "*.bib" ')' -exec cp {} _build \; + mkdir -p $(BUILDDIR) + find -type f '(' -name "*.tex*" -o -name "*.sty*" -o -name "*.bib" ')' -exec cp {} $(BUILDDIR) \; +# Build source in buildir into pdf pdf: copy - cd _build && find . -name '*.tex' -exec latexmk --shell-escape -pdf {} \; + cd $(BUILDDIR) && find . -name '*.tex' -exec latexmk --shell-escape -pdf {} \; submit: pdf - rm -rvf brightspace - mkdir -p brightspace - find -type f '(' -name "*.tex*" -o -name "*.sty*" -o -name "*.bib" ')' -exec cp {} brightspace \; - cd brightspace && zip $(REVISION)_source.zip * - cp _build/*.pdf brightspace + rm -rvf $(SUBMITDIR) + mkdir -p $(SUBMITDIR) + find -type f '(' -name "*.tex*" -o -name "*.sty*" -o -name "*.bib" ')' -exec cp {} $(SUBMITDIR) \; + cd $(SUBMITDIR) && zip $(REVISION)_source.zip * + cp $(BUILDDIR)/*.pdf $(SUBMITDIR) - echo "Auto generated using software written by Joe." > brightspace/README.md - echo "This build and all artifacts were built locally on this date: " >> brightspace/README.md - date >> brightspace/README.md + echo "Auto generated using software written by Joe." > $(SUBMITDIR)/README.md + echo "This build and all artifacts were built locally on this date: " >> $(SUBMITDIR)/README.md + date >> $(SUBMITDIR)/README.md # cleanup - cd brightspace && find -type f '(' -name "*.tex*" -o -name "*.sty*" -o -name "*.bib" ')' -exec rm {} \; + cd $(SUBMITDIR) && find -type f '(' -name "*.tex*" -o -name "*.sty*" -o -name "*.bib" ')' -exec rm {} \; clean: git clean -fdX - rm -rvf brightspace + rm -rvf $(SUBMITDIR)