# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = #
# This is the Makefile for the ca. 1760 
# contre-danse collection
# "Potpourri francois des contre-danse ancienne tel quil se danse chez la Reine ..."
# by Mr Landrin in Paris.
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = #
U=http://trillian.mit.edu/~jc/music/book/Landrin/Landrin_Potpourri

all: Landrin_Potpourri install

# Top-level targets:
Landrin_Potpourri: Landrin_Potpourri1 Landrin_Potpourri2

# Common Landrin_Potpourri.abc source file:
Landrin_Potpourri.abc: $(Landrin_Potpourri1)
	abcjoin +S2 $(Landrin_Potpourri1) >Landrin_Potpourri.abc

# Format using jcabc2ps (no overlays):
Landrin_Potpourri1: Landrin_Potpourri.abc Landrin_Potpourri1.ps Landrin_Potpourri1.pdf
Landrin_Potpourri1= [0-9][0-9][0-9S]_*.abc	# S: Single-voice version
Landrin_Potpourri1.ps: Landrin_Potpourri.abc fmt/LanPot1.fmt
	jcabc2ps +Ffmt/LanPot1.fmt +n -k4 +x Landrin_Potpourri.abc \
	|PShdr %P 'Potpourri francois des contre-danse ancienne tel quil se danse chez la Reine ...' %P \
	|PSftr %D $U/ %D >Landrin_Potpourri1.ps
Landrin_Potpourri1.pdf: Landrin_Potpourri1.ps
	ps2pdf Landrin_Potpourri1.ps Landrin_Potpourri1.pdf

# Format using abcm2ps (uses overlays):
Landrin_Potpourri2: Landrin_Potpourri.abc Landrin_Potpourri2.ps Landrin_Potpourri2.pdf
Landrin_Potpourri2= [0-9][0-9][0-9O]_*.abc	# O: Overlay version
Landrin_Potpourri2.ps: Landrin_Potpourri.abc fmt/LanPot2.fmt
	abcm2ps -F fmt/LanPot2.fmt Landrin_Potpourri.abc -O tmp.ps
	PShdr <tmp.ps %P 'Potpourri francois des contre-danse ancienne tel quil se danse chez la Reine ...' %P \
	|PSftr %D $U/ %D >Landrin_Potpourri2.ps
	rm tmp.ps
Landrin_Potpourri2.pdf: Landrin_Potpourri2.ps
	ps2pdf Landrin_Potpourri2.ps Landrin_Potpourri2.pdf

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

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