Skip to content

Instantly share code, notes, and snippets.

@yfuruyama
Created January 9, 2014 16:35
Show Gist options
  • Save yfuruyama/8337265 to your computer and use it in GitHub Desktop.
Save yfuruyama/8337265 to your computer and use it in GitHub Desktop.
shuuron makefile
PAPER=shuuron
OUTPUT_DIR=out
# TeX commands
TEX=platex
TEX_OPTIONS=-kanji=utf8 -output-directory=$(OUTPUT_DIR)
DVI2PDF=dvipdfmx
DVI2PDF_OPTIONS=-o $(OUTPUT_DIR)/$(PAPER).pdf
BIBTEX=pbibtex
all: | $(OUTPUT_DIR)
$(TEX) $(TEX_OPTIONS) $(PAPER)
$(BIBTEX) $(OUTPUT_DIR)/$(PAPER).aux
$(TEX) $(TEX_OPTIONS) $(PAPER)
$(TEX) $(TEX_OPTIONS) $(PAPER) # compile 3 times
$(DVI2PDF) $(DVI2PDF_OPTIONS) $(OUTPUT_DIR)/$(PAPER).dvi
$(OUTPUT_DIR):
mkdir -p $(OUTPUT_DIR)
open:
open $(OUTPUT_DIR)/$(PAPER).pdf
.PHONY: clean
clean:
rm -rf $(OUTPUT_DIR)
rm -f $(PAPER).aux
rm -f $(PAPER).dvi
rm -f $(PAPER).lof
rm -f $(PAPER).log
rm -f $(PAPER).lot
rm -f $(PAPER).pdf
rm -f $(PAPER).toc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment