# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# This is the Makefile for  the  Kaunze  "Collection  of  the  most  favorite #
# Dances,  Reels, Waltzes, &c." Note that there are two versions, alltunes_NO #
# for ABC software with no support for voice overlays,  and  alltunes_VO  for #
# ABC  software  that  handles voice overlays.  For the tunes with 2 versions #
# (NO/VO), we use '-' rather than '_' in the file name for  the  NO  version, #
# and '=' for the VO version. This produces the correct sort order within the #
# alltunes*.abc files.                                                        #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
U=http://trillian.mit.edu/~jc/music/book/Kauntze

all: alltunes install

alltunes: alltunes_NO alltunes_VO

# Format using jcabc2ps:
alltunes_NO: alltunes_NO.abc alltunes_NO.ps alltunes_NO.pdf
alltunes_NO= [0-9][0-9][-_]*.abc	# [0-9][0-9]_*_NO.abc
alltunes_NO.abc: $(alltunes_NO)
	abcjoin +CS2 $(alltunes_NO) >alltunes_NO.abc
alltunes_NO.ps: alltunes_NO.abc fmt/alltunes_NO.fmt
	jcabc2ps +k4 +Ffmt/alltunes_NO.fmt +n +x alltunes_NO.abc \
	|PShdr %P 'Kauntze Collection of the most favorite Dances' %P \
	|PSftr %D $U/ %D >alltunes_NO.ps
alltunes_NO.pdf: alltunes_NO.ps
	ps2pdf alltunes_NO.ps alltunes_NO.pdf

# Format using abcm2ps:
alltunes_VO: alltunes_VO.abc alltunes_VO.ps alltunes_VO.pdf
alltunes_VO= [0-9][0-9][=_]*.abc	# [0-9][0-9]_*_VO.abc
alltunes_VO.abc: $(alltunes_VO)
	abcjoin +CS2 $(alltunes_VO) >alltunes_VO.abc
alltunes_VO.ps: alltunes_VO.abc fmt/alltunes_VO.fmt
	abcm2ps -x -j 4 -F fmt/alltunes_VO.fmt alltunes_VO.abc -O tmp.ps
	PShdr <tmp.ps %P 'Kauntze Collection of the most favorite Dances' %P \
	|PSftr %D $U/ %D >alltunes_VO.ps
	rm tmp.ps
alltunes_VO.pdf: alltunes_VO.ps
	ps2pdf alltunes_VO.ps alltunes_VO.pdf

neat:         ; /bin/rm -f *- *.bak *.out
clean:    neat; /bin/rm -f *.ps *.pdf
clobber: clean; /bin/rm -f alltunes*.abc

install: ../Kauntze_CotmfD_NO.abc ../Kauntze_CotmfD_VO.abc 
../Kauntze_CotmfD_NO.abc: alltunes_NO.abc
	ln -f alltunes_NO.abc ../Kauntze_CotmfD_NO.abc
../Kauntze_CotmfD_VO.abc: alltunes_VO.abc
	ln -f alltunes_VO.abc ../Kauntze_CotmfD_VO.abc
