TEX := xelatex TEXARGS := --output-directory=build --halt-on-error DOCNAME := the_crown_bar SOURCES := $(DOCNAME).tex tex/docstyle.sty # include tex/Makefile.inc .PHONY: clean all: build/$(DOCNAME).pdf clean: @rm -rfv build build/$(DOCNAME).pdf : $(SOURCES) mkdir -p build $(TEX) $(TEXARGS) $< $(TEX) $(TEXARGS) $<