Skip to content

Instantly share code, notes, and snippets.

@kissge
Forked from tomykaira/Makefile
Created December 17, 2014 10:19
Show Gist options
  • Save kissge/3a45e426ea43edea5b1c to your computer and use it in GitHub Desktop.
Save kissge/3a45e426ea43edea5b1c to your computer and use it in GitHub Desktop.
Mac対応版
.DEFAULT_GOAL := thesis.pdf
%.pdf: %.dvi
dvipdfmx $^
thesis.dvi: thesis.tex refs.bib
platex -halt-on-error -shell-escape thesis.tex
bibtex thesis
platex -halt-on-error thesis.tex
platex -halt-on-error thesis.tex
abstract.tex: thesis.tex
ifeq ($(shell uname), Darwin)
nlinit=`echo 'nl="'; echo '"'`; \
eval "$$nlinit"; \
sed -e "/\maketitle/,\$$c\\$$nl\\\\maketitle\\$$nl\\\\end{document}" $< > $@
else
sed -e '/\maketitle/,$$c \\\maketitle\n\\end{document}' $< > $@
endif
abstract.dvi: abstract.tex
platex -halt-on-error $<
clean:
rm -rf *.aux *.bbl *.blg *.toc *.log *.xbb *.dvi *.pdf thesis.txt abstract.tex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment