# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# This is the Makefile for "The Hibernian Muse",  a  collection  of  (mostly) #
# Irish tunes published in London by Thompson ca. 1770. The single-tune files #
# have names of the form NNN_Title.abc, where NNN is the number to the  upper #
# left of each tune in Roman-numeral form.  Note that there are two versions, #
# HibernianMuse-V1 for ABC software with no support for voice  overlays,  and #
# HibernianMuse-V2  for  ABC  software  that handles voice overlays.  For the #
# tunes with 2 versions (V1/V2), we use '-' rather than '_' in the file  name #
# for the V1 version, and '=' for the V2 versioni, to make them easy to match #
# in this Makefile.                                                           #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
U=http://trillian.mit.edu/~jc/music/book/HibernianMuse/1745

all: HibernianMuse install

HibernianMuse: HibernianMuse-V1 HibernianMuse-V2

# Format using jcabc2ps:
HibernianMuse-V1: HibernianMuse-V1.abc HibernianMuse-V1.ps HibernianMuse-V1.pdf
HibernianMuse-V1= [0-9][0-9][0-9][-_]*.abc	# [0-9][0-9]_*-V1.abc
HibernianMuse-V1.abc: $(HibernianMuse-V1)
	abcjoin +CS2 $(HibernianMuse-V1) >HibernianMuse-V1.abc
HibernianMuse-V1.ps: HibernianMuse-V1.abc fmt/HibernianMuse-V1.fmt
	jcabc2ps +k4 +Ffmt/HibernianMuse-V1.fmt +n +x HibernianMuse-V1.abc \
	|PShdr %P 'Hibernian Muse Select Collection of Country Dances 1745' %P \
	|PSftr %D $U/ %D >HibernianMuse-V1.ps
HibernianMuse-V1.pdf: HibernianMuse-V1.ps
	ps2pdf HibernianMuse-V1.ps HibernianMuse-V1.pdf

# Format using abcm2ps:
HibernianMuse-V2: HibernianMuse-V2.abc HibernianMuse-V2.ps HibernianMuse-V2.pdf
HibernianMuse-V2= [0-9][0-9][0-9][=_]*.abc	# [0-9][0-9]_*-V2.abc
HibernianMuse-V2.abc: $(HibernianMuse-V2)
	abcjoin +CS2 $(HibernianMuse-V2) >HibernianMuse-V2.abc
HibernianMuse-V2.ps: HibernianMuse-V2.abc fmt/HibernianMuse-V2.fmt
	abcm2ps -x -j 4 -F fmt/HibernianMuse-V2.fmt HibernianMuse-V2.abc -O tmp.ps
	PShdr <tmp.ps %P 'Hibernian Muse Select Collection of Country Dances 1745' %P \
	|PSftr %D $U/ %D >HibernianMuse-V2.ps
	rm tmp.ps
HibernianMuse-V2.pdf: HibernianMuse-V2.ps
	ps2pdf HibernianMuse-V2.ps HibernianMuse-V2.pdf

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

install: ../HibernianMuse-V1.abc ../HibernianMuse-V2.abc 
../HibernianMuse-V1.abc: HibernianMuse-V1.abc
	ln -f HibernianMuse-V1.abc ../HibernianMuse-V1.abc
../HibernianMuse-V2.abc: HibernianMuse-V2.abc
	ln -f HibernianMuse-V2.abc ../HibernianMuse-V2.abc
