# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
# This is the Makefile for Thompson's "Twenty Four  Country  Dances  for  the #
# Year  1805".  The file names are of the form PPN_Title.abc, where PP is the #
# page number (1-12), and N is the tune number on the  page  (1,2).   Initial #
# articles are omitted from the Title.                                        #
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #

U=http://trillian.mit.edu/~jc/music/book/24CountryDances/1805/Thompson

all: alltunes install

alltunes: alltunes1 alltunes2
alltunes= [0-9][0-9][0-9]_*.abc
alltunes.abc: $(alltunes)
	abcjoin +CS2 $(alltunes) >alltunes.abc

# Format using jcabc2ps:
alltunes1: alltunes.abc alltunes1.ps alltunes1.pdf
alltunes1.ps: alltunes.abc fmt/alltunes1.fmt
	jcabc2ps +k4 +Ffmt/alltunes1.fmt +n +x alltunes.abc \
	|PShdr %P '24 Country Dances for the Year 1805 - Thompson & Son' %P \
	|PSftr %D $U/ %D >alltunes1.ps
alltunes1.pdf: alltunes1.ps
	ps2pdf alltunes1.ps alltunes1.pdf

# Format using abcm2ps:
alltunes2: alltunes.abc alltunes2.ps alltunes2.pdf
alltunes2.ps: alltunes.abc fmt/alltunes2.fmt
	abcm2ps -x -j 4 -F fmt/alltunes2.fmt alltunes.abc -O tmp.ps
	PShdr <tmp.ps %P '24 Country Dances for the Year 1805 - Thompson & Son' %P \
	|PSftr %D $U/ %D >alltunes2.ps
	rm tmp.ps
alltunes2.pdf: alltunes2.ps
	ps2pdf alltunes2.ps alltunes2.pdf

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

install: ../Thompson.abc ../../1805_Thompson.abc ../../../24CountryDances_1805_Thompson.abc
../Thompson.abc: alltunes.abc
	ln -f alltunes.abc ../Thompson.abc
../../1805_Thompson.abc: alltunes.abc
	ln -f alltunes.abc ../../1805_Thompson.abc
../../../24CountryDances_1805_Thompson.abc: alltunes.abc
	ln -f alltunes.abc ../../../24CountryDances_1805_Thompson.abc
