From 1c042a76267b85d2a57e25ddd62e2f80d6fc6d9c Mon Sep 17 00:00:00 2001 From: Andreas Tsouchlos Date: Sat, 25 Oct 2025 23:19:40 +0200 Subject: [PATCH] Make Makefile completely generic --- Makefile | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 9862055..9bed9c4 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,16 @@ +PDFs := $(patsubst src/%/presentation.tex,build/presentation_%.pdf,$(wildcard src/*/presentation.tex)) + .PHONY: all -all: build/prepared build/presentation_template.pdf build/presentation_2025-11-07.pdf +all: $(PDFs) -build/presentation_template.pdf: - TEXINPUTS=./lib/cel-slides-template-2025:$$TEXINPUTS latexmk src/template/presentation.tex - mv build/presentation.pdf $@ - -build/presentation_2025-11-07.pdf: - TEXINPUTS=./lib/cel-slides-template-2025:$$TEXINPUTS latexmk src/2025-11-07/presentation.tex +build/presentation_%.pdf: src/%/presentation.tex build/prepared + TEXINPUTS=./lib/cel-slides-template-2025:$$TEXINPUTS latexmk $< mv build/presentation.pdf $@ build/prepared: - mkdir -p build build + mkdir -p build touch build/prepared .PHONY: clean clean: rm -rf build -