# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = #
# This is the Makefile for "A Collection of Strathspeys, Reels, Hornpipes,
# Waltzes, &c.", published by William Christie in 1820. It was found at
# deriv.nls.uk in September 2022, and was the basis for this transcription.
# Tune names are of the form PPN_Title.abc, where PP is the page number
# and N is the tune number on the page.
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = #
U=http://trillian.mit.edu/~jc/music/book/WilliamChristie

all: CSRHW install

# Two versions, for ABC versions 1.* and 2.*

CSRHW: CSRHW-abc1 CSRHW-abc2

# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = #
# First, an entry to combine all the single-tune files into one large set:
# We re-capitalize the first word of the titles to match the book

# Format using jcabc2ps:
CSRHW-abc1: CSRHW-abc1.abc CSRHW-abc1.ps CSRHW-abc1.pdf
CSRHW-abc1= [0-9][0-9][0-9][-_]*.abc
CSRHW-abc1.abc: $(CSRHW-abc1)
	abcjoin +c $(CSRHW-abc1) >CSRHW-abc1.abc
CSRHW-abc1.ps: CSRHW-abc1.abc fmt/CSRHW-abc1.fmt
	jcabc2ps +k4 +n +Ffmt/CSRHW-abc1.fmt +x CSRHW-abc1.abc \
	|PShdr %P "WilliamChristie: A Collection of Strathspeys, Reels, Hornpipes, Waltzes, &c." %P \
	|PSftr %D $U/ %D >CSRHW-abc1.ps
CSRHW-abc1.pdf: CSRHW-abc1.ps
	ps2pdf CSRHW-abc1.ps CSRHW-abc1.pdf

# Format using abcm2ps:
CSRHW-abc2: CSRHW-abc2.abc CSRHW-abc2.ps CSRHW-abc2.pdf
CSRHW-abc2= [0-9][0-9][0-9][=_]*.abc
CSRHW-abc2.abc: $(CSRHW-abc2)
	abcjoin +c $(CSRHW-abc2) >CSRHW-abc2.abc
CSRHW-abc2.ps: CSRHW-abc2.abc fmt/CSRHW-abc2.fmt
	abcm2ps -x -F fmt/CSRHW-abc2.fmt CSRHW-abc2.abc -O tmp.ps
	PShdr <tmp.ps %P  "WilliamChristie: A Collection of Strathspeys, Reels, Hornpipes, Waltzes, &c." %P \
	|PSftr %D $U/ %D >CSRHW-abc2.ps
	/bin/rm tmp.ps
CSRHW-abc2.pdf: CSRHW-abc2.ps
	ps2pdf CSRHW-abc2.ps CSRHW-abc2.pdf

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

# Install in the ../book/JamesOswald/ and ../book/ directories:
install:\
	../CSRHW-abc1.abc ../../WilliamChristie-CSRHW-abc1.abc ../CSRHW-abc2.abc ../../WilliamChristie-CSRHW-abc2.abc \
	../CSRHW-abc1.abc ../../WilliamChristie-CSRHW-abc1.abc ../CSRHW-abc2.abc ../../WilliamChristie-CSRHW-abc2.abc
../CSRHW-abc1.abc:        CSRHW-abc1.abc; ln -f CSRHW-abc1.abc ../CSRHW-abc1.abc
../CSRHW-abc2.abc:        CSRHW-abc2.abc; ln -f CSRHW-abc2.abc ../CSRHW-abc2.abc
../../WilliamChristie-CSRHW-abc1.abc: CSRHW-abc1.abc; ln -f CSRHW-abc1.abc ../../WilliamChristie-CSRHW-abc1.abc
../../WilliamChristie-CSRHW-abc2.abc: CSRHW-abc2.abc; ln -f CSRHW-abc2.abc ../../WilliamChristie-CSRHW-abc2.abc

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
# The .htaccess file explains to the apache web server what's in  the  files.
# We  fill  in  descriptions of the abc files from the first T: line, so that
# the dance names appear in HTML listings of the  directory.

.htaccess: *.abc
	abcDesc *.abc

# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = #

