a2p=jcabc2ps
U=http://trillian.mit.edu/~jc/music/abc/waltz
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
.SUFFIXES:
.SUFFIXES: .ABC .abc .ps .PS
#abc.ps: $*.abc; abc2ps $*.abc -O $*
.abc.ps: $*.abc; abc2ps_4b -F default -n  $*.abc -o -O $*.ps

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

all: \
	AthollHighlanders.ps Bulgar1.ps Dayeinu.ps Freilach5.ps \
	LebedichUnFreilech.ps NachtInGanEydn.ps NochABissel.ps OiTate.ps PatchTanz.ps \
	TzenaTzena.ps Yoshke.ps reel.ps waltz.ps

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

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
waltz.abc: waltz/*.abc; abcjoin waltz/*.abc _.abc >waltz.abc
waltz.ps: waltz.abc; abc2ps_4b waltz.abc -F fmt/_55 -o -O waltz.ps
jig.abc: jig/*.abc; abcjoin jig/*.abc _.abc >jig.abc
jig.ps: jig.abc; abc2ps_4b jig.abc -F jig -o -O jig.ps
reel.abc: reel/*.abc; abcjoin reel/*.abc _.abc >reel.abc
reel.ps: reel.abc; abc2ps_4b reel.abc -F reel -o -O reel.ps

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
# MEDLEYS, using jc's abcmedley program.

medleys:

m3=_1.abc _2.abc _3.abc
m3: m3.ps
m3.abc: $(m3); abcmedley "Title" $(m3) >Out.abc
m3.ps: m3.abc; abc2ps_4b m3.abc -F m3 -n -o -O m3.ps

new: */*.abc # new.abc new.ps new.pdf
	find */ -mtime -30 -name '*.abc' | xargs tonew
	make new.abc new.ps new.pdf
	make New
new.abc: new/*.abc;
	abcjoin +R +S new new/*.abc > new.abc
new.ps:  new.abc fmt/new.fmt;
	$(a2p) new.abc +x +Ffmt/new \
	|PShdr new "New Waltzes" new \
	|PSftr "Page %P" $U/new/ %D >new.ps
new.pdf: new.ps;
	ps2pdf new.ps

#AthollHighlanders=jig/AthollHighlandersJ.abc jig/AthollHighlandersJ_hjz.abc _.abc
#AthollHighlanders: AthollHighlanders.ps
#AthollHighlanders.abc: $(AthollHighlanders) AthollHighlanders.hdr; abcmedley AthollHighlanders $(AthollHighlanders) >AthollHighlanders.abc
AthollHighlanders.ps: AthollHighlanders.abc AthollHighlanders.fmt; abc2ps_ks AthollHighlanders.abc -F AthollHighlanders -o -O AthollHighlanders.ps

# Lagrimas_y_Sonrisas_vals
Lagrimas_y_Sonrisas_vals= Lagrimas_y_Sonrisas_vals-Cm-96-8.abc Lagrimas_y_Sonrisas_vals-Cm-96-12.abc
Lagrimas_y_Sonrisas_vals: Lagrimas_y_Sonrisas_vals.abc Lagrimas_y_Sonrisas_vals.ps Lagrimas_y_Sonrisas_vals.pdf
Lagrimas_y_Sonrisas_vals.abc: $(Lagrimas_y_Sonrisas_vals)
	abcjoin +S2 $(Lagrimas_y_Sonrisas_vals) >Lagrimas_y_Sonrisas_vals.abc
Lagrimas_y_Sonrisas_vals.ps: Lagrimas_y_Sonrisas_vals.abc fmt/Lagrimas_y_Sonrisas.fmt
	jcabc2ps +Ffmt/Lagrimas_y_Sonrisas.fmt Lagrimas_y_Sonrisas_vals.abc \
	|PShdr 'Lagrimas_y_Sonrisas_vals' '' Lagrimas_y_Sonrisas_vals \
	|PSftr %D $U/ %D >Lagrimas_y_Sonrisas_vals.ps
Lagrimas_y_Sonrisas_vals.pdf: Lagrimas_y_Sonrisas_vals.ps
	ps2pdf Lagrimas_y_Sonrisas_vals.ps Lagrimas_y_Sonrisas_vals.pdf

OiTate.ps: OiTate.abc OiTate.fmt
	abc2ps_4b OiTate.abc -F OiTate -n -o -O OiTate.ps

Yoshke.ps: Yoshke.abc Yoshke.fmt
	abc2ps_4b Yoshke.abc -F Yoshke -n -o -O Yoshke.ps

