mixtape/makefile

31 lines
697 B
Makefile
Raw Normal View History

2024-02-06 14:18:25 +01:00
SRC_DIR := $(wildcard content/*)
2023-12-28 01:13:23 +01:00
SRC_EXTENSION := .cho
2024-02-06 14:18:25 +01:00
SONG_CHO := $(foreach dir,$(SRC_DIR),$(wildcard $(dir)/*$(SRC_EXTENSION)))
SONG_PDF := $(patsubst %$(SRC_EXTENSION),%.pdf,$(SONG_CHO))
SONG_HTML := $(patsubst %$(SRC_EXTENSION),%.html,$(SONG_CHO))
SONGBOOK := songbook.pdf
2023-12-28 01:13:23 +01:00
.DEFAULT_GOAL := all
2024-02-06 14:18:25 +01:00
%.pdf: %$(SRC_EXTENSION)
2024-01-08 08:56:42 +01:00
chordpro --config=chordpro.json -o $@ $<
2023-12-28 01:13:23 +01:00
2024-02-06 14:18:25 +01:00
%.html: %$(SRC_EXTENSION)
2024-01-08 08:56:42 +01:00
chordpro --config=chordpro.json -o $@ $<
2023-12-28 01:13:23 +01:00
2024-02-06 14:18:25 +01:00
all: $(SONG_PDF) $(SONG_HTML) $(SONGBOOK)
2023-12-28 01:13:23 +01:00
2024-02-06 14:18:25 +01:00
$(SONGBOOK): $(SONG_PDF)
2023-12-28 01:13:23 +01:00
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$@ $^
2023-12-28 01:18:59 +01:00
.PHONY: html
2024-02-06 14:18:25 +01:00
html: $(SONG_HTML)
2023-12-28 01:18:59 +01:00
.PHONY: pdf
2024-02-06 14:18:25 +01:00
pdf: $(SONG_PDF)
2023-12-28 01:18:59 +01:00
2023-12-28 01:13:23 +01:00
.PHONY: clean
clean:
2024-02-06 14:18:25 +01:00
rm -f $(SONG_PDF) $(SONG_HTML) $(SONGBOOK)