# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = #
# This is the Makefile for the tune+dance transcriptions of Thomas Wilson and #
# William  Harmony's  "Four  New Country Dances", published in London in 1812 #
# Two versions of the .ps and .pdf files are created, using the jcabc2ps  and #
# abcm2ps  clones  of  the  abc2ps  program.   None  of these tunes cause any #
# problems for either program, so only a single alltunes.abc file is  created #
# to hold the entire collection, which is linked into some parent directories #
# with appropriate file names.                                                #
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = #
U=http://trillian.mit.edu/~jc/music/book/DftY/1812/Wilson_Harmony

all: alltunes install

alltunes: alltunes1 alltunes2
alltunes= [0-4]_*.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 'Four New Country Dances - 1812 - Wilson/Harmony' %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 'Four New Country Dances - 1812 - Wilson/Harmony' %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: ../Wilson_Harmony_FourNewCountryDances.abc ../../1812_Wilson_Harmony_FourNewCountryDances.abc ../../../1812_Wilson_Harmony_FourNewCountryDances.abc
../Wilson_Harmony_FourNewCountryDances.abc: alltunes.abc
	ln -f alltunes.abc ../Wilson_Harmony_FourNewCountryDances.abc
../../1812_Wilson_Harmony_FourNewCountryDances.abc: alltunes.abc
	ln -f alltunes.abc ../../1812_Wilson_Harmony_FourNewCountryDances.abc
../../../1812_Wilson_Harmony_FourNewCountryDances.abc: alltunes.abc
	ln -f alltunes.abc ../../../1812_Wilson_Harmony_FourNewCountryDances.abc
