From c62bd2ade65cfcf5b956f7119c7fcf9f20c69d47 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Fri, 21 Apr 2017 14:02:17 -0400 Subject: [PATCH] Improvements to the build system Make sure the top level directory contains the resulting PDFs, but keep the intermediate build files in a separate directory to reduce clutter. Signed-off-by: Anna Schumaker --- Makefile | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 370d5fa..36310fb 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,17 @@ -TEX = latexmk -recorder -pdf +OUTPUT = build +TEX = latexmk --output-directory=$(OUTPUT)/ +SOURCES := $(shell find -name '*.tex' | sort) +PDFS := $(shell find -name '*.tex' | sed 's/.tex$$/.pdf/' | sort) %.pdf: %.tex $(TEX) $< cheese: - $(TEX) -outdir=cheese/ *.tex - pdfjoin -o cheese.pdf cheese/*.pdf + $(TEX) -recorder -pdf $(SOURCES) + cp build/*.pdf . + pdfjoin -o worksheets.pdf $(PDFS) clean: - latexmk -C - rm -r cheese/ - rm cheese.pdf + rm *.pdf + rm -r $(OUTPUT)/