# This is the Makefile for the Ryan/Cole Project
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
U=http://trillian.mit.edu/~jc/music/book/ryan-cole/

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
# Collect the tunes into files based on the first few chars of the title:
all: \
	Sets/AB.abc Sets/CD.abc Sets/EF.abc Sets/GH.abc Sets/IJ.abc Sets/KL.abc Sets/MN.abc \
	Sets/OP.abc Sets/QR.abc Sets/ST.abc Sets/UV.abc Sets/WX.abc Sets/YZ.abc Sets/__.abc \
	Ryan-Cole.abc

Ryan-Cole.abc: TitlePage.abc Tunes/*.abc
	abcjoin TitlePage.abc Tunes/*.abc >Ryan-Cole.abc

Sets/__.abc: Tunes/[0-9]*.abc
	abcjoin Tunes/[^A-Z]???*.abc >Sets/__.abc

Sets/AB.abc: Tunes/[AB]???*.abc
	abcjoin Tunes/[AB]???*.abc >Sets/AB.abc

Sets/CD.abc: Tunes/[CD]???*.abc
	abcjoin Tunes/[CD]???*.abc >Sets/CD.abc

Sets/EF.abc: Tunes/[EF]???*.abc
	abcjoin Tunes/[EF]???*.abc >Sets/EF.abc

Sets/GH.abc: Tunes/[GH]???*.abc
	abcjoin Tunes/[GH]???*.abc >Sets/GH.abc

Sets/IJ.abc: Tunes/[IJ]???*.abc
	abcjoin Tunes/[IJ]???*.abc >Sets/IJ.abc

Sets/KL.abc: Tunes/[KL]???*.abc
	abcjoin Tunes/[KL]???*.abc >Sets/KL.abc

Sets/MN.abc: Tunes/[MN]???*.abc
	abcjoin Tunes/[MN]???*.abc >Sets/MN.abc

Sets/OP.abc: Tunes/[OP]???*.abc
	abcjoin Tunes/[OP]???*.abc >Sets/OP.abc

Sets/QR.abc: Tunes/[QR]???*.abc
	abcjoin Tunes/[QR]???*.abc >Sets/QR.abc

Sets/ST.abc: Tunes/[ST]???*.abc
	abcjoin Tunes/[ST]???*.abc >Sets/ST.abc

Sets/UV.abc: Tunes/[UV]???*.abc
	abcjoin Tunes/[UV]???*.abc >Sets/UV.abc

Sets/WX.abc: Tunes/[WX]???*.abc
	abcjoin Tunes/[WX]???*.abc >Sets/WX.abc

Sets/YZ.abc: Tunes/[YZ]???*.abc
	abcjoin Tunes/[YZ]???*.abc >Sets/YZ.abc

new: new/*.abc new.abc new.ps new.pdf
	find Tunes/ -mtime -15 -name '*.abc' | xargs tonew
	make new.abc new.ps new.pdf
new.abc: new/*.abc
	abcjoin +CRS new/*.abc > new.abc
new.ps:  new.abc fmt/new.fmt
	jcabc2ps new.abc +Ffmt/new \
	|PShdr %P "NEW RYAN/COLE TUNES" %P \
	|PSftr %D $U/new/ %T >new.ps
new.pdf: new.ps;    ps2pdf new.ps new.pdf


neat:        ; /bin/rm -f *- */*-
clean:   neat; /bin/rm -f tmp/* log/* Entry/*/TuneAdd.*
	find new/ -name '*.abc' -mtime +60 -exec ls -l {} ';' -exec /bin/rm {} ';'
clobber: clean
	/bin/rm -f new/*.abc *.ps *.pdf
