Skip to content

Instantly share code, notes, and snippets.

@stefan2904
Last active November 4, 2017 20:45
Show Gist options
  • Save stefan2904/16a88026d0ac1894a57949758ae69d2b to your computer and use it in GitHub Desktop.
Save stefan2904/16a88026d0ac1894a57949758ae69d2b to your computer and use it in GitHub Desktop.
This Makefile will generate a pdf named after the current folder.
# Stefan's SPRING Makefile
# This Makefile will generate a pdf named after the current folder.
BASEFILE=presentation
TEXFILE=$(BASEFILE).tex
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
current_dir := $(notdir $(patsubst %/,%,$(dir $(mkfile_path))))
TEXCMD=pdflatex
BIBCMD=biber
all:
$(TEXCMD) $(TEXFILE)
-mv $(BASEFILE).pdf ${current_dir}.pdf
full: clean
$(TEXCMD) $(TEXFILE)
$(TEXCMD) $(TEXFILE)
-mv $(BASEFILE).pdf ${current_dir}.pdf
clean:
@$(RM) *.blg
@$(RM) *.log
@$(RM) *.out
@$(RM) *.aux
@$(RM) *.run.xml
@$(RM) *.toc
@$(RM) *.nav
@$(RM) *.snm
@$(RM) *.vrb
cleanbib:
@$(RM) *.bbl
@$(RM) *.bst
@$(RM) *.bcf
cleanpdf:
@$(RM) *.pdf
cleanall: clean cleanbib cleanpdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment