Skip to content

Instantly share code, notes, and snippets.

@SamuelMarks
Created August 17, 2020 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SamuelMarks/226a60f3713df7b8f680197571c4700c to your computer and use it in GitHub Desktop.
Save SamuelMarks/226a60f3713df7b8f680197571c4700c to your computer and use it in GitHub Desktop.
Thesis Makefile. Entire Thesis will be open-sourced once the university has accepted it.
SHELL := bash
SRC_FILES = $(filter-out Thesis.tex, $(wildcard *.tex))
.PHONY: Thesis.pdf all clean
all: $(patsubst %.dot,%.svg,$(wildcard *.dot)) Thesis.pdf
%.tex:
for name in *.tex; do
echo '$< =' "$<" '$name =' "$name"
done
#bibtex "$<"
Thesis.pdf: # Thesis.bbl # Thesis.tex # $(SRC_FILES)
latexmk -pdf -quiet -silent -use-make Thesis.tex
notify_macos:
osascript -e 'tell application "Terminal" to display notification "Built" with title "Makefile"'
notify_linux:
notify-send 'Makefile' 'Built' --icon='dialog-information'
notify_windows:
msg * "Makefile: built"
bibtex:
for src in $(basename $(SRC_FILES)); do
latex "$$src" && bibtex "$$src"; \
done
Thesis.bbl:
pdflatex Thesis
pdflatex Thesis
# dvipdfm Thesis
bibtex Thesis
%.svg: %.dot
dot -Tsvg $< -o $@
%.acr:
makeglossaries $(basename $@)
#%.bib:
# bibtex $(basename $@)
clean:
latexmk -C
$(RM) -f *.aux *.blg *.bbl *.log *.out *.toc *.synctex.gz *.fls *.fdb_latexmk *.nlo *.swp *.glg *.gls* *.ist *.xdy *.alg *.acn *.glo *.acr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment