From 88271ea927c6231f9bbade29d9edf07f188e2e41 Mon Sep 17 00:00:00 2001 From: Leopold Fajtak Date: Wed, 27 Nov 2024 12:52:40 +0100 Subject: [PATCH] made library dependencies more dynamic --- Makefile | 13 ++++++++++++- config/song_choices.csv | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 501ff9b..9e17230 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,18 @@ docker = podman library_dir = library propers_dir = propers template_dir = templates -tex_deps = $(template_dir)/*.tt $(library_dir)/*/*/*.tt $(propers_dir)/*.tt $(config_dir)/song_choices.csv $(config_dir)/qr_codes.csv $(config_dir)/variables.tt +# get dependencies from song_choices.csv and variables.tt +dynamic_deps = $(shell cat $(config_dir)/song_choices.csv | \ + awk '!/#/' | \ + awk 'NR>1' | \ + awk -F '|' '{print $$4}' | \ + tr -d ' ' | \ + awk '{print "$(library_dir)/" $$0 "/*"}') \ + $(shell cat $(config_dir)/variables.tt | \ + grep '^\s*proper =' | awk -F '=' '{print $$2}' | \ + tr -d " '\"" | \ + awk '{print "$(propers_dir)/" $$0 ".tt"}') +tex_deps = $(template_dir)/*.tt $(config_dir)/qr_codes.csv $(config_dir)/variables.tt $(dynamic_deps) .PHONY: all all: leadsheet_collection.pdf choir_scores.pdf print_a3.pdf clean_intermediate #print_a4.pdf %.pdf: build diff --git a/config/song_choices.csv b/config/song_choices.csv index 14b7539..89b180c 100644 --- a/config/song_choices.csv +++ b/config/song_choices.csv @@ -1,5 +1,5 @@ purpose | content | template | variables -| | | +| | | ../library/freie_lieder/adeste_fideles introitus | | | #confiteor | \input{library/gebete/confiteor/confiteor_de.tex} | | kyrie | | |