Browse Source

Improvements to the build system

Anna 8 months ago
parent
commit
c62bd2ade6
1 changed files with 9 additions and 6 deletions
  1. 9 6
      Makefile

+ 9 - 6
Makefile View File

@@ -1,14 +1,17 @@
1 1
 
2
-TEX = latexmk -recorder -pdf
2
+OUTPUT = build
3
+TEX = latexmk --output-directory=$(OUTPUT)/
4
+SOURCES := $(shell find -name '*.tex' | sort)
5
+PDFS := $(shell find -name '*.tex' | sed 's/.tex$$/.pdf/' | sort)
3 6
 
4 7
 %.pdf: %.tex
5 8
 	$(TEX) $<
6 9
 
7 10
 cheese:
8
-	$(TEX) -outdir=cheese/ *.tex
9
-	pdfjoin -o cheese.pdf cheese/*.pdf
11
+	$(TEX) -recorder -pdf $(SOURCES)
12
+	cp build/*.pdf .
13
+	pdfjoin -o worksheets.pdf $(PDFS)
10 14
 
11 15
 clean:
12
-	latexmk -C
13
-	rm -r cheese/
14
-	rm cheese.pdf
16
+	rm *.pdf
17
+	rm -r $(OUTPUT)/