BOOK:=volume2.pdf FRONTMATTER:=$(wildcard src/frontmatter/*.md) BACKMATTER:=$(wildcard src/backmatter/*.md) FMLATEX:=$(FRONTMATTER:.md=.tex) BMLATEX:=$(BACKMATTER:.md=.tex) CHAPTERS:=$(wildcard src/chapters/*.md) APPENDICES:=$(wildcard src/appendices/*.md) FIGURES:=$(wildcard src/figs/*.svg) PFLAGS:=--pdf-engine=xelatex \ --from=markdown \ --indented-code-classes=javascript \ --highlight-style=monochrome \ --toc=true \ -V mainfont="Apple Garamond" \ -V monofont="FreeMono" \ -V documentclass=book \ -V papersize=letter \ -V geometry:margin=1in .PHONY: all clean all: $(BOOK) $(BOOK): $(CHAPTERS) $(FMLATEX) $(BMLATEX) $(APPENDICES) src/title.txt $(FIGURES) pandoc src/title.txt $(CHAPTERS) $(APPENDICES) $(FIGURES) -o $@ $(PFLAGS) -N -B $(FMLATEX) $(FMLATEX): $(FRONTMATTER) pandoc $^ -o $@ $(PFLAGS) $(BMLATEX): $(BACKMATTER) pandoc $^ -o $@ $(PFLAGS) clean: $(RM) $(BOOK) $(FMLATEX) $(BMLATEX)