Add better variables and readability

This commit is contained in:
Kenwood 2022-02-08 11:50:35 -05:00
parent 2e1ebf7482
commit da9d81f2a0
3 changed files with 22 additions and 17 deletions

1
.gitignore vendored
View File

@ -1,3 +1,2 @@
_build _build
*.*# *.*#
brightspace/

View File

@ -1,2 +1 @@
_build _build
brightspace/

View File

@ -1,35 +1,42 @@
# Written by joe # Written by joe
# Variables
REVISION := "$(shell git describe --abbrev=8 --dirty --always --tags)" REVISION := "$(shell git describe --abbrev=8 --dirty --always --tags)"
# Paths
ROOT := "$(PWD)"
BUILDDIR := $(ROOT)/_build
SUBMITDIR := $(BUILDDIR)/Brightspace
all: pdf submit all: pdf submit
# Move all files to the build dir # Move everything required to builddir
copy: copy:
mkdir -p _build mkdir -p $(BUILDDIR)
find -type f '(' -name "*.tex*" -o -name "*.sty*" -o -name "*.bib" ')' -exec cp {} _build \; find -type f '(' -name "*.tex*" -o -name "*.sty*" -o -name "*.bib" ')' -exec cp {} $(BUILDDIR) \;
# Build source in buildir into pdf
pdf: copy pdf: copy
cd _build && find . -name '*.tex' -exec latexmk --shell-escape -pdf {} \; cd $(BUILDDIR) && find . -name '*.tex' -exec latexmk --shell-escape -pdf {} \;
submit: pdf submit: pdf
rm -rvf brightspace rm -rvf $(SUBMITDIR)
mkdir -p brightspace mkdir -p $(SUBMITDIR)
find -type f '(' -name "*.tex*" -o -name "*.sty*" -o -name "*.bib" ')' -exec cp {} brightspace \; find -type f '(' -name "*.tex*" -o -name "*.sty*" -o -name "*.bib" ')' -exec cp {} $(SUBMITDIR) \;
cd brightspace && zip $(REVISION)_source.zip * cd $(SUBMITDIR) && zip $(REVISION)_source.zip *
cp _build/*.pdf brightspace cp $(BUILDDIR)/*.pdf $(SUBMITDIR)
echo "Auto generated using software written by Joe." > 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: " >> brightspace/README.md echo "This build and all artifacts were built locally on this date: " >> $(SUBMITDIR)/README.md
date >> brightspace/README.md date >> $(SUBMITDIR)/README.md
# cleanup # 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: clean:
git clean -fdX git clean -fdX
rm -rvf brightspace rm -rvf $(SUBMITDIR)