a2p=jcabc2ps
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
U=http://trillian.mit.edu/~jc/music/abc/song

P= Christmas_in_the_Trenches Let_the_Rest_of_the_World_Go_By \
	BibbidiBobbidiBoo ChimChimCheree HappyNewYear NearerMyGodToThee_Bethany_F \
	Peg_O_My_Heart PokarekareAna Windcalling_C_V2 


.SUFFIXES:
.SUFFIXES: .abc .ps
.abc.ps: $*.abc; abc2ps $*.abc -F default -n -o -O $*.ps

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #

all: $(P)

neat:         ; /bin/rm -f *-
clean:    neat; /bin/rm -f *.out new.* *.pdf *.ps *.PS
clobber: clean; /bin/rm -f core

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #

# jj
jj= _.abc
jj: jj.abc jj.ps jj.pdf
jj.abc: $(jj) # hdr/jj.hdr
	abcjoin +s $(jj) >jj.abc
jj.ps: jj.abc fmt/_80.fmt
	$(a2p) jj.abc +Ffmt/_80 \
	|PShdr jj '' jj \
	|PSftr %D $U/ %D >jj.ps
jj.pdf: jj.ps
	ps2pdf jj.ps jj.pdf

mm: mm.ps mm.pdf
mm.ps: mm.abc mm.fmt
	abc2ps -F mm mm.abc -o -O mm.ps
mm.pdf: mm.ps
	ps2pdf mm.ps

mx=_1.abc _2.abc _3.abc
mx: mx.hdr mx.ps mx.pdf
mx.abc: mx.hdr $(mx)
	abcmedley mx $(mx) >mx.abc
mx.ps: mx.abc mx.fmt $(mx)
	abc2ps -F mx mx.abc -o
	mv Out.ps mx.ps
mx.pdf: mx.ps
	ps2pdf mx.ps

xx=C/xx_1.abc B/xx_2.abc f.abc
xx: xx.ps
xx.ps: xx.abc _75.fmt
	abc2ps xx.abc -F _75 -o -O xx.ps
xx.abc: $(xx)
	abcjoin +s $(xx) >xx.abc

yy= C/yy_K.abc B/yy_K.abc f.abc
yy: yy.ps
yy.ps: yy.abc _75.fmt
	abc2ps yy.abc -F _75 -o -O yy.ps
yy.abc: $(yy)
	abcjoin $(yy) >yy.abc

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #

new.abc: new/*.abc
	abcjoin +C +R0 +S new new/*.abc > new.abc
new.ps:  new.abc _75.fmt
	$(a2p) new.abc +F_75.fmt \
	|PShdr new "" new \
	|PSftr "Page %P" $(URL)new/ %D >new.ps
new.pdf: new.ps;
	ps2pdf new.ps new.pdf

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #

# Airport_Song
Airport_Song= Airport_Song-F-16-4w.abc
Airport_Song: Airport_Song.abc Airport_Song.ps Airport_Song.pdf
Airport_Song.abc: $(Airport_Song) # hdr/Airport_Song.hdr
	abcjoin +s $(Airport_Song) >Airport_Song.abc
Airport_Song.ps: Airport_Song.abc fmt/_80.fmt
	$(a2p) Airport_Song.abc +Ffmt/_80 \
	|PShdr Airport_Song '' Airport_Song \
	|PSftr %D $U/ %D >Airport_Song.ps
Airport_Song.pdf: Airport_Song.ps
	ps2pdf Airport_Song.ps Airport_Song.pdf

# America
America= America-C--.abc
America: America.abc America.ps America.pdf
America.abc: $(America) # hdr/America.hdr
	abcjoin +s $(America) >America.abc
America.ps: America.abc fmt/_80.fmt
	$(a2p) America.abc +Ffmt/_80 \
	|PShdr America '' America \
	|PSftr %D $U/ %D >America.ps
America.pdf: America.ps
	ps2pdf America.ps America.pdf

# Bells_of_Hell_Go_Ting-a-Ling-a-Ling
Bells_of_Hell_Go_Ting-a-Ling-a-Ling= Bells_of_Hell_Go_Ting-a-Ling-a-Ling.abc
Bells_of_Hell_Go_Ting-a-Ling-a-Ling: Bells_of_Hell_Go_Ting-a-Ling-a-Ling.abc Bells_of_Hell_Go_Ting-a-Ling-a-Ling.pdf
#Bells_of_Hell_Go_Ting-a-Ling-a-Ling.abc: $(Bells_of_Hell_Go_Ting-a-Ling-a-Ling) # hdr/Bells_of_Hell_Go_Ting-a-Ling-a-Ling.hdr
#	abcjoin +s $(Bells_of_Hell_Go_Ting-a-Ling-a-Ling) >Bells_of_Hell_Go_Ting-a-Ling-a-Ling.abc
Bells_of_Hell_Go_Ting-a-Ling-a-Ling.ps: Bells_of_Hell_Go_Ting-a-Ling-a-Ling.abc fmt/_80.fmt
	$(a2p) Bells_of_Hell_Go_Ting-a-Ling-a-Ling.abc +Ffmt/_80 \
	|PShdr Bells_of_Hell_Go_Ting-a-Ling-a-Ling '' Bells_of_Hell_Go_Ting-a-Ling-a-Ling \
	|PSftr %D $U/ %D >Bells_of_Hell_Go_Ting-a-Ling-a-Ling.ps
Bells_of_Hell_Go_Ting-a-Ling-a-Ling.pdf: Bells_of_Hell_Go_Ting-a-Ling-a-Ling.ps
	ps2pdf Bells_of_Hell_Go_Ting-a-Ling-a-Ling.ps Bells_of_Hell_Go_Ting-a-Ling-a-Ling.pdf

# Bibbidi Bobbidi Boo
BibbidiBobbidiBoo= BibbidiBobbidiBoo_Fw.abc BibbidiBobbidiBoo_G.abc
BibbidiBobbidiBoo: BibbidiBobbidiBoo.ps BibbidiBobbidiBoo.pdf
BibbidiBobbidiBoo.ps: BibbidiBobbidiBoo.abc BibbidiBobbidiBoo.fmt
	jcabc2ps BibbidiBobbidiBoo.abc +F BibbidiBobbidiBoo > BibbidiBobbidiBoo.ps
BibbidiBobbidiBoo.abc: $(BibbidiBobbidiBoo)
	abcjoin +s $(BibbidiBobbidiBoo) >BibbidiBobbidiBoo.abc
BibbidiBobbidiBoo.pdf: BibbidiBobbidiBoo.ps
	ps2pdf BibbidiBobbidiBoo.ps

# Calon Lan
Calon_Lan= hymn/Calon_Lan_4V-Bb-16-4.abc
Calon_Lan: Calon_Lan.abc Calon_Lan.ps Calon_Lan.pdf
Calon_Lan.abc: $(Calon_Lan) # hdr/Calon_Lan.hdr
	abcjoin +s $(Calon_Lan) >Calon_Lan.abc
Calon_Lan.ps: Calon_Lan.abc fmt/_75.fmt
	abcm2ps -F fmt/_75.fmt  Calon_Lan.abc -O Calon.ps
	 PShdr Calon_Lan '' Calon_Lan < Calon.ps\
	|PSftr %D $U/ %D >Calon_Lan.ps
#	rm Calon.ps
Calon_Lan.pdf: Calon_Lan.ps
	ps2pdf Calon_Lan.ps Calon_Lan.pdf

# Chim Chim Cheree
ChimChimCheree= ChimChimCheree_Dm.abc
ChimChimCheree: ChimChimCheree.ps ChimChimCheree.pdf
ChimChimCheree.abc: $(ChimChimCheree)
	abcjoin $(ChimChimCheree) >ChimChimCheree.abc
ChimChimCheree.ps: ChimChimCheree.abc ChimChimCheree.fmt $(ChimChimCheree)
	jcabc2ps +c +F ChimChimCheree ChimChimCheree.abc > ChimChimCheree.ps
ChimChimCheree.pdf: ChimChimCheree.ps
	ps2pdf ChimChimCheree.ps

# Christmas_in_the_Trenches
Christmas_in_the_Trenches= \
	Christmas_in_the_Trenches-D--.abc
Christmas_in_the_Trenches: Christmas_in_the_Trenches.abc Christmas_in_the_Trenches.ps Christmas_in_the_Trenches.pdf
Christmas_in_the_Trenches.abc: $(Christmas_in_the_Trenches) # hdr/Christmas_in_the_Trenches.hdr
	abcjoin +s $(Christmas_in_the_Trenches) >Christmas_in_the_Trenches.abc
Christmas_in_the_Trenches.ps: Christmas_in_the_Trenches.abc fmt/_70.fmt
	$(a2p) Christmas_in_the_Trenches.abc +Ffmt/_70 \
	|PShdr 'Christmas in the Trenches' '' 'Christmas in the Trenches' \
	|PSftr %D '' %D >Christmas_in_the_Trenches.ps
Christmas_in_the_Trenches.pdf: Christmas_in_the_Trenches.ps
	ps2pdf Christmas_in_the_Trenches.ps Christmas_in_the_Trenches.pdf

# Happy New Year
HappyNewYear= src/Happy_New_Year_F_V4wW.abc
HappyNewYear: HappyNewYear.ps HappyNewYear.pdf
HappyNewYear.abc: $(HappyNewYear)
	abcjoin $(HappyNewYear) >HappyNewYear.abc
HappyNewYear.ps: HappyNewYear.abc HappyNewYear.fmt $(HappyNewYear)
	jcabc2ps +FHappyNewYear HappyNewYear.abc \
	|PShdr HappyNewYear '' HappyNewYear \
	|PSftr %D $U/ %D >HappyNewYear.ps
HappyNewYear.pdf: HappyNewYear.ps
	ps2pdf HappyNewYear.ps

# Let the Rest of the World Go By
Let_the_Rest_of_the_World_Go_By: Let_the_Rest_of_the_World_Go_By.abc \
	Let_the_Rest_of_the_World_Go_By.ps Let_the_Rest_of_the_World_Go_By.pdf
Let_the_Rest_of_the_World_Go_By.abc: Let_the_Rest_of_the_World_Go_By-Ab--.abc
	abcjoin Let_the_Rest_of_the_World_Go_By-Ab--.abc >Let_the_Rest_of_the_World_Go_By.abc
Let_the_Rest_of_the_World_Go_By.ps: Let_the_Rest_of_the_World_Go_By.abc fmt/_70.fmt
	jcabc2ps +Ffmt/_70.fmt Let_the_Rest_of_the_World_Go_By.abc  >Let_the_Rest_of_the_World_Go_By.ps
Let_the_Rest_of_the_World_Go_By.pdf: Let_the_Rest_of_the_World_Go_By.ps
	ps2pdf Let_the_Rest_of_the_World_Go_By.ps Let_the_Rest_of_the_World_Go_By.pdf

# Nearer My God to Thee Bethany
NearerMyGodToThee_Bethany_F: NearerMyGodToThee_Bethany_F.ps NearerMyGodToThee_Bethany_F.pdf
NearerMyGodToThee_Bethany_F.ps: NearerMyGodToThee_Bethany_F.abc NearerMyGodToThee_Bethany_F.fmt
	abc2ps -F NearerMyGodToThee_Bethany_F.abc NearerMyGodToThee_Bethany_F.abc -o -O NearerMyGodToThee_Bethany_F.ps
NearerMyGodToThee_Bethany_F.pdf: NearerMyGodToThee_Bethany_F.ps
	ps2pdf NearerMyGodToThee_Bethany_F.ps

# New Britain
NewBritain: NewBritain.ps NewBritain.pdf
NewBritain.ps: NewBritain.abc fmt/NewBritain.fmt
	jcabc2ps +Ffmt/NewBritain NewBritain.abc > NewBritain.ps
NewBritain.pdf: NewBritain.ps
	ps2pdf NewBritain.ps

# Peg O' My Heart
Peg_O_My_Heart: Peg_O_My_Heart1 Peg_O_My_Heart2

# Peg O' My Heart 1 % for jcabc2ps
Peg_O_My_Heart1= Peg_O_My_Heart1_C_W.abc
Peg_O_My_Heart1: Peg_O_My_Heart1.abc Peg_O_My_Heart1.ps Peg_O_My_Heart1.pdf
Peg_O_My_Heart1.abc: $(Peg_O_My_Heart1)
	abcjoin +s $(Peg_O_My_Heart1) >Peg_O_My_Heart1.abc
Peg_O_My_Heart1.ps: Peg_O_My_Heart1.abc fmt/_75.fmt
	$(a2p) Peg_O_My_Heart1.abc +c +Ffmt/_75 \
	|PShdr Peg_O_My_Heart1 '' Peg_O_My_Heart1 \
	|PSftr %D $U/ %D >Peg_O_My_Heart1.ps
Peg_O_My_Heart1.pdf: Peg_O_My_Heart1.ps
	ps2pdf Peg_O_My_Heart1.ps Peg_O_My_Heart1.pdf

# Peg O' My Heart 2 % for abcm2ps
Peg_O_My_Heart2= Peg_O_My_Heart2_C_W.abc
Peg_O_My_Heart2: Peg_O_My_Heart2.abc Peg_O_My_Heart2.ps Peg_O_My_Heart2.pdf
Peg_O_My_Heart2.abc: $(Peg_O_My_Heart2)
	abcjoin +s $(Peg_O_My_Heart2) >Peg_O_My_Heart2.abc
Peg_O_My_Heart2.ps: Peg_O_My_Heart2.abc fmt/_75.fmt
	abcm2ps Peg_O_My_Heart2.abc -c -Ffmt/_75  -O tmp.ps
	PShdr Peg_O_My_Heart2 '' Peg_O_My_Heart2 <tmp.ps |\
	PSftr %D $U/ %D >Peg_O_My_Heart2.ps
	rm tmp.ps
Peg_O_My_Heart2.pdf: Peg_O_My_Heart2.ps
	ps2pdf Peg_O_My_Heart2.ps Peg_O_My_Heart2.pdf
PokarekareAna: PokarekareAna.abc PokarekareAna.ps PokarekareAna.pdf
PokarekareAna= PokarekareAna_D.abc PokarekareAna_G.abc PokarekareAna_DW.abc
PokarekareAna.abc: $(PokarekareAna)
	abcjoin +S $(PokarekareAna) >PokarekareAna.abc
PokarekareAna.ps: PokarekareAna.abc _75.fmt
	jcabc2ps +F_75 PokarekareAna.abc > PokarekareAna.ps
PokarekareAna.pdf: PokarekareAna.ps
	ps2pdf PokarekareAna.ps

# Where_Did_You_Get_That_Hat
Where_Did_You_Get_That_Hat= Where_Did_You_Get_That_Hat-C-16-4W42.abc
Where_Did_You_Get_That_Hat: Where_Did_You_Get_That_Hat.abc Where_Did_You_Get_That_Hat.ps Where_Did_You_Get_That_Hat.pdf
Where_Did_You_Get_That_Hat.abc: $(Where_Did_You_Get_That_Hat)
	abcjoin +C +S2 $(Where_Did_You_Get_That_Hat) >Where_Did_You_Get_That_Hat.abc
Where_Did_You_Get_That_Hat.ps: Where_Did_You_Get_That_Hat.abc fmt/_80.fmt
	$(a2p) +Ffmt/_80.fmt Where_Did_You_Get_That_Hat.abc \
	|PShdr Where_Did_You_Get_That_Hat '' Where_Did_You_Get_That_Hat \
	|PSftr %D $U/ %D >Where_Did_You_Get_That_Hat.ps
Where_Did_You_Get_That_Hat.pdf: Where_Did_You_Get_That_Hat.ps
	ps2pdf Where_Did_You_Get_That_Hat.ps Where_Did_You_Get_That_Hat.pdf

# Windcalling
Windcalling_C_V2: Windcalling_C_V2.ps Windcalling_C_V2.pdf
Windcalling_C_V2.ps: Windcalling_C_V2.abc Windcalling_C_V2.fmt
	jcabc2ps +FWindcalling_C_V2 Windcalling_C_V2.abc > Windcalling_C_V2.ps
Windcalling_C_V2.pdf: Windcalling_C_V2.ps
	ps2pdf Windcalling_C_V2.ps

SweetGeorgiaBrown_Gw: SweetGeorgiaBrown_Gw.ps SweetGeorgiaBrown_Gw.pdf
SweetGeorgiaBrown_Gw.ps: SweetGeorgiaBrown_Gw.abc _80.fmt
	jcabc2ps +c +F_80 SweetGeorgiaBrown_Gw.abc >SweetGeorgiaBrown_Gw.ps
SweetGeorgiaBrown_Gw.pdf: SweetGeorgiaBrown_Gw.ps
	ps2pdf SweetGeorgiaBrown_Gw.ps
