# -*- mode: makefile; -*- fr:=Felix Rabe ogg-comments = -t "author=$(fr)" -t "performer=$(fr)" -t "artist=$(fr)" \ -t "title=Musical Diary: $*" -t "date=$*" \ -t "copyright=2003 $(fr)" -t "location=switzerland" \ -t "license=http://creativecommons.org/licenses/by/1.0" \ -t "description=Dedicated to the victims of the war on Iraq, lasting 2003-????" \ -t "contact=http://xitnalta.com/seed.html" ly-files := $(wildcard *.ly) days := $(basename $(ly-files)) midi-files := $(foreach day,$(days),$(day).midi) wav-files := $(foreach day,$(days),$(day).wav) low-files := $(foreach day,$(days),$(day)-low.ogg) mono-files := $(foreach day,$(days),$(day)-mono.ogg) hi-files := $(foreach day,$(days),$(day)-hi.ogg) dvi-files := $(foreach day,$(days),$(day).dvi) ps-files := $(foreach day,$(days),$(day).ps.gz) pdf-files := $(foreach day,$(days),$(day).pdf) clean-days := $(foreach day,$(days),$(day)-clean) dist-file := seed-days.tar.gz .PHONY: all $(days) cdist dist \ midi wav low mono hi \ dvi ps pdf \ clean $(clean-days) ogg-clean \ midi-clean wav-clean low-clean mono-clean hi-clean .SECONDARY: $(midi-files) $(wav-files) all: $(days) cdist: clean all dist # DO THIS ONLY IF YOU WANT TO REMAKE *EVERYTHING* dist: rm -f $(dist-file) tar --exclude "*.wav" -czf $(dist-file) * # $(days): %: %-low.ogg %-mono.ogg %-hi.ogg $(days): %: %-low.ogg %-hi.ogg # mono is really cruel midi: $(midi-files) wav: $(wav-files) low: $(low-files) mono: $(mono-files) hi: $(hi-files) dvi ps pdf: midi clean: $(clean-days) rm -f *~ $(dist-file) $(clean-days): rm -f $(@:-clean=){.midi,.wav,-low.ogg,-mono.ogg,-hi.ogg} rm -f $(@:-clean=){.ly.orig,.dvi,.ps.gz,.pdf} ogg-clean: low-clean mono-clean hi-clean midi-clean: ; rm -f $(midi-files) wav-clean: ; rm -f $(wav-files) low-clean: ; rm -f $(low-files) mono-clean: ; rm -f $(mono-files) hi-clean: ; rm -f $(hi-files) dvi-clean: ; rm -f $(dvi-files) ps-clean: ; rm -f $(ps-files) pdf-clean: ; rm -f $(pdf-files) %.midi: %.ly ./ly2ly.sh $< rm $<.orig ly2dvi $< dvips ${<:.ly=.dvi} ps2pdf ${<:.ly=.ps} gzip -9 ${<:.ly=.ps} %.wav: %.midi timidity -A 150 -Ow -o $@ $< %-low.ogg: %.wav oggenc -q 1 --resample 8000 --downmix -o $@ $< vorbiscomment -a $@ $(ogg-comments) %-mono.ogg: %.wav oggenc -q 4 --downmix -o $@ $< vorbiscomment -a $@ $(ogg-comments) %-hi.ogg: %.wav oggenc -q 5 -o $@ $< vorbiscomment -a $@ $(ogg-comments)