Created
April 13, 2022 12:44
-
-
Save doctor-g/f24e80ba58b9343923b58724b8b90b91 to your computer and use it in GitHub Desktop.
A GNU Make makefile for combining mup and chordpro files into one songbook.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make the family songbook out of mup and chordpro files. | |
# | |
# Create trumpet versions by including TRUMPET=true on the command line. | |
COVER_OUT = cover.pdf | |
COVER_SRC = cover.tex | |
COVER_JUNK = cover.aux cover.log | |
MUP = mup | |
MUP_IN = $(wildcard *.mup) | |
MUP_PSOUT = $(patsubst %.mup,%.ps,$(MUP_IN)) | |
MUP_OUT = $(patsubst %.mup,%.pdf,$(MUP_IN)) | |
CHORDPRO = chordpro | |
CHORDPRO_IN = $(wildcard *.pro) | |
CHORDPRO_OUT = $(patsubst %.pro,%.pdf,$(CHORDPRO_IN)) | |
PDFUNITE = pdfunite | |
OUTPUT = songbook.pdf | |
all: $(OUTPUT) | |
.PHONY: clean | |
clean: | |
rm -f $(COVER_OUT) $(MUP_OUT) $(MUP_PSOUT) $(CHORDPRO_OUT) $(OUTPUT) | |
$(COVER_OUT): $(COVER_SRC) | |
pdflatex $(if $(TRUMPET),"\def\istrumpet{1} \input{cover.tex}",cover.tex) | |
rm -f $(COVER_JUNK) | |
$(MUP_PSOUT): %.ps : %.mup | |
$(MUP) $(if $(TRUMPET),"-DTRUMPET") -f $@ $< | |
$(MUP_OUT): %.pdf : %.ps | |
ps2pdf $(patsubst %.pdf,%.ps,$@) $@ | |
$(CHORDPRO_OUT): %.pdf : %.pro | |
$(CHORDPRO) $< | |
$(OUTPUT): $(COVER_OUT) $(MUP_OUT) $(CHORDPRO_OUT) | |
$(PDFUNITE) $(COVER_OUT) $(sort $(MUP_OUT) $(CHORDPRO_OUT)) $(OUTPUT) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment