U=http://trillian.mit.edu/~jc/music/book/Barsanti

all: Barsanti_CoOST install

Barsanti_CoOST: Barsanti_CoOST1 Barsanti_CoOST2
Barsanti_CoOST= [0-9][0-9][0-9]_*.abc
Barsanti_CoOST.abc: $(Barsanti_CoOST)
	abcjoin +CS2 $(Barsanti_CoOST) >Barsanti_CoOST.abc

# Format using jcabc2ps:
Barsanti_CoOST1: Barsanti_CoOST.abc Barsanti_CoOST1.ps Barsanti_CoOST1.pdf
Barsanti_CoOST1.ps: Barsanti_CoOST.abc fmt/Barsanti_CoOST1.fmt
	jcabc2ps +k4 +Ffmt/Barsanti_CoOST1.fmt +n +x Barsanti_CoOST.abc \
	|PShdr %P 'A Collection of Old Scots Tunes' %P \
	|PSftr %D $U/ %D >Barsanti_CoOST1.ps
Barsanti_CoOST1.pdf: Barsanti_CoOST1.ps
	ps2pdf Barsanti_CoOST1.ps Barsanti_CoOST1.pdf

# Format using abcm2ps:
Barsanti_CoOST2: Barsanti_CoOST.abc Barsanti_CoOST2.ps Barsanti_CoOST2.pdf
Barsanti_CoOST2.ps: Barsanti_CoOST.abc fmt/Barsanti_CoOST2.fmt
	abcm2ps -x -j 4 -F fmt/Barsanti_CoOST2.fmt Barsanti_CoOST.abc -O tmp.ps
	PShdr <tmp.ps %P 'A Collection of Old Scots Tunes' %P \
	|PSftr %D $U/ %D >Barsanti_CoOST2.ps
	rm tmp.ps
Barsanti_CoOST2.pdf: Barsanti_CoOST2.ps
	ps2pdf Barsanti_CoOST2.ps Barsanti_CoOST2.pdf

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

install: ../Barsanti_CoOST.abc ../../Barsanti_CoOST.abc
../Barsanti_CoOST.abc: Barsanti_CoOST.abc
	ln -f Barsanti_CoOST.abc ../Barsanti_CoOST.abc
../../Barsanti_CoOST.abc: Barsanti_CoOST.abc
	ln -f Barsanti_CoOST.abc ../../Barsanti_CoOST.abc
