Refactor Makefile to handle multiple bulletins
This commit is contained in:
parent
b153b1215f
commit
d2ebdcaeff
1 changed files with 10 additions and 8 deletions
18
Makefile
18
Makefile
|
|
@ -1,17 +1,19 @@
|
||||||
all: output/2025-08-10.pdf
|
BULLETINS := $(wildcard bulletins/*.lytex)
|
||||||
|
|
||||||
output/2025-08-10.pdf: bulletins/2025-08-10.lytex output cache
|
all: $(foreach bulletin,$(BULLETINS),output/$(notdir $(basename $(bulletin))).pdf)
|
||||||
|
|
||||||
|
# Declare dependencies dynamically
|
||||||
|
$(foreach bulletin,$(BULLETINS), \
|
||||||
|
$(eval output/$(notdir $(basename $(bulletin))).pdf: $(bulletin)) \
|
||||||
|
)
|
||||||
|
|
||||||
|
output/%.pdf:
|
||||||
|
mkdir -p output cache; \
|
||||||
date=$(basename $(notdir $@)); \
|
date=$(basename $(notdir $@)); \
|
||||||
lilypond-book --output=cache --pdf bulletins/$$date.lytex && \
|
lilypond-book --output=cache --pdf bulletins/$$date.lytex && \
|
||||||
(cd cache && lualatex $$date.tex) && \
|
(cd cache && lualatex $$date.tex) && \
|
||||||
mv cache/$$date.pdf output/
|
mv cache/$$date.pdf output/
|
||||||
|
|
||||||
output:
|
|
||||||
mkdir output
|
|
||||||
|
|
||||||
cache:
|
|
||||||
mkdir cache
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf output cache
|
rm -rf output cache
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue