start cleaning up directory creation

This commit is contained in:
Sebastian Hugentobler 2022-04-18 14:50:22 +02:00
parent d0e659cd3e
commit 660a08779c
Signed by: shu
GPG Key ID: BB32CF3CA052C2F0

View File

@ -23,11 +23,6 @@ LY_OPUS=$(patsubst %.ly,${BUILD_OPUS_DIR}/%.opus,$(notdir ${LY_FILES}))
.PHONY: book songs midi opus clean directories all
.DEFAULT_GOAL := all
directories: ${BUILD_DIR} ${BUILD_BOOK_DIR} ${TMP_BOOK_DIR} ${BUILD_SONG_DIR} ${BUILD_MIDI_DIR} ${TMP_DIR} ${TMP_SONG_DIR} ${TMP_MIDI_DIR} ${BUILD_OPUS_DIR}
${BUILD_DIR}:
mkdir -p ${BUILD_DIR}
${BUILD_BOOK_DIR}:
mkdir -p ${BUILD_BOOK_DIR}
@ -37,9 +32,6 @@ ${BUILD_SONG_DIR}:
${BUILD_MIDI_DIR}:
mkdir -p ${BUILD_MIDI_DIR}
${TMP_DIR}:
mkdir -p ${TMP_DIR}
${TMP_BOOK_DIR}:
mkdir -p ${TMP_BOOK_DIR}
@ -52,20 +44,20 @@ ${TMP_MIDI_DIR}:
${BUILD_OPUS_DIR}:
mkdir -p ${BUILD_OPUS_DIR}
${TMP_SONG_DIR}/%.pdf: ${SONG_DIR}/%.ly ${SONG_DIR}/%.tex
${TMP_SONG_DIR}/%.pdf: ${SONG_DIR}/%.ly ${SONG_DIR}/%.tex | ${TMP_SONG_DIR}
cd ${SRC_DIR} && lualatex --jobname='$(notdir $(basename $@))' --output-directory=${WORKING_DIR}/${TMP_SONG_DIR} --shell-escape ${WORKING_DIR}/${SRC_DIR}/song.tex ${WORKING_DIR}/${SONG_DIR}/$(notdir $(basename $@)).ly ${WORKING_DIR}/${SONG_DIR}/$(notdir $(basename $@)).tex
rm -r ${SRC_DIR}/tmp-ly
${BUILD_MIDI_DIR}/%.midi: ${TMP_MIDI_DIR}/%-1.midi
${BUILD_MIDI_DIR}/%.midi: ${TMP_MIDI_DIR}/%-1.midi | ${BUILD_MIDI_DIR}
cp $< $@
${TMP_MIDI_DIR}/%-1.midi: ${SONG_DIR}/%.ly
${TMP_MIDI_DIR}/%-1.midi: ${SONG_DIR}/%.ly | ${TMP_MIDI_DIR}
lilypond --output=${TMP_MIDI_DIR} ${WORKING_DIR}/$<
${BUILD_OPUS_DIR}/%.opus: ${BUILD_MIDI_DIR}/%.midi
${BUILD_OPUS_DIR}/%.opus: ${BUILD_MIDI_DIR}/%.midi | ${BUILD_OPUS_DIR}
timidity $< -Ow -o - | opusenc - $@
${TMP_BOOK_DIR}/%.pdf: ${SRC_DIR}/%.tex ${SRC_DIR}/images/title.png
${TMP_BOOK_DIR}/%.pdf: ${SRC_DIR}/%.tex ${SRC_DIR}/images/title.png | ${TMP_BOOK_DIR}
latexmk -cd -lualatex -e '$$lualatex=q/lualatex %O -shell-escape %S/' -output-directory=${WORKING_DIR}/${TMP_BOOK_DIR} $<
rm -r ${SRC_DIR}/tmp-ly
@ -87,13 +79,13 @@ ${TMP_BOOK_DIR}/%-octavo.pdf: ${TMP_BOOK_DIR}/%.pdf
cd ${TMP_BOOK_DIR} && \
../../bin/makebook -v -t octavo -i $(notdir $<) -o $(notdir $@)
${BUILD_DIR}/%.pdf: ${TMP_DIR}/%.pdf
${BUILD_DIR}/%.pdf: ${TMP_DIR}/%.pdf | ${BUILD_BOOK_DIR} ${BUILD_SONG_DIR}
cp $< $@
book: directories ${BUILD_BOOK_DIR}/${BOOKNAME}.pdf ${BUILD_BOOK_DIR}/${BOOKNAME}-folio.pdf ${BUILD_BOOK_DIR}/${BOOKNAME}-quarto.pdf ${BUILD_BOOK_DIR}/${BOOKNAME}-sexto.pdf ${BUILD_BOOK_DIR}/${BOOKNAME}-octavo.pdf ${LY_FILES}
songs: directories ${LY_PDFS}
midi: directories ${LY_MIDIS}
opus: directories ${LY_OPUS}
book: ${BUILD_BOOK_DIR}/${BOOKNAME}.pdf ${BUILD_BOOK_DIR}/${BOOKNAME}-folio.pdf ${BUILD_BOOK_DIR}/${BOOKNAME}-quarto.pdf ${BUILD_BOOK_DIR}/${BOOKNAME}-sexto.pdf ${BUILD_BOOK_DIR}/${BOOKNAME}-octavo.pdf ${LY_FILES}
songs: ${LY_PDFS}
midi: ${LY_MIDIS}
opus: ${LY_OPUS}
all: book songs midi opus
clean: