Skip to content

Instantly share code, notes, and snippets.

@helloIAmPau
Last active December 12, 2015 02:48
Show Gist options
  • Save helloIAmPau/4701057 to your computer and use it in GitHub Desktop.
Save helloIAmPau/4701057 to your computer and use it in GitHub Desktop.
Makefile used to automate the building of latex projects
all: view
single: quiet
open "/tmp/`basename '$(CURDIR)'`"/*.pdf
quiet:
mkdir -p "/tmp/`basename '$(CURDIR)'`"
pdflatex -output-directory="/tmp/`basename '$(CURDIR)'`" main.tex
view: quiet
make quiet
open "/tmp/`basename '$(CURDIR)'`"/*.pdf
thesis: quiet
makeglossaries -d "/tmp/`basename '$(CURDIR)'`" main
bibtex "/tmp/`basename '$(CURDIR)'`"/main.aux || true
make quiet
make quiet
deploy: thesis
cp "/tmp/`basename '$(CURDIR)'`"/main.pdf ./
open main.pdf
clean:
rm -rf "/tmp/`basename '$(CURDIR)'`"
rm -rf output
develop: view
fswatch ./ "make thesis && clear && echo Ready..."
.PHONY: view clean deploy single develop quiet thesis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment