# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = #
# This is the Makefile for my German music directory.
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = #
U=http://trillian.mit.edu/~jc/music/book/abc/Germany/book/Fl\"ugelhornDuets
a2p1=jcabc2ps
a2p2=abcm2ps

all: FhDuets install

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

singles: single
single: Kornblumenblau SeeFahrt_die_ist_Lustig

install: ../FhDuets1.abc ../../FhDuets1.abc \
	     ../FhDuets2.abc ../../FhDuets2.abc
../FhDuets1.abc: FhDuets1.abc
	ln -f FhDuets1.abc ../FhDuets1.abc
../../FhDuets1.abc: FhDuets1.abc
	ln -f FhDuets1.abc ../../FhDuets1.abc
../FhDuets2.abc: FhDuets2.abc
	ln -f FhDuets2.abc ../FhDuets2.abc
../../FhDuets2.abc: FhDuets2.abc
	ln -f FhDuets2.abc ../../FhDuets2.abc

singles: SeeFahrt_die_ist_Lustig

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

# 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.fmt \
	|PShdr jj '' jj \
	|PSftr %D $U/ %D >jj.ps
jj.pdf: jj.ps
	ps2pdf jj.ps jj.pdf

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

FhDuets: FhDuets1 FhDuets2 install

# Format using jcabc2ps (no overlays):
FhDuets1: FhDuets1.abc FhDuets1.ps FhDuets1.pdf
FhDuets1= [0-9][0-9][-_]*.abc JaT.abc
FhDuets1.abc: $(FhDuets1)
	abcjoin +C +S2 $(FhDuets1) >FhDuets1.abc
FhDuets1.ps: FhDuets1.abc fmt/FhDuets1.fmt
	$(a2p1) +k4 +Ffmt/FhDuets1.fmt -n +x FhDuets1.abc \
	|PShdr %P 'Fl\ugelhorn Duets' %P \
	|PSftr %D $U/ %D >FhDuets1.ps
FhDuets1.pdf: FhDuets1.ps
	ps2pdf FhDuets1.ps FhDuets1.pdf

# Format using abcm2ps (may use overlays):
FhDuets2: FhDuets2.abc FhDuets2.ps FhDuets2.pdf
FhDuets2= [0-9][0-9][=_]*.abc JaT.abc
FhDuets2.abc: $(FhDuets2)
	abcjoin +C +S2 $(FhDuets2) >FhDuets2.abc
FhDuets2.ps: FhDuets2.abc fmt/FhDuets2.fmt
	$(a2p2) -j 4 -F fmt/FhDuets2.fmt FhDuets2.abc -x -O tmp.ps
	PShdr <tmp.ps %P 'Fl\ugelhorn Duets'  %P \
	|PSftr %D $U/ %D >FhDuets2.ps
#	rm tmp.ps
FhDuets2.pdf: FhDuets2.ps
	ps2pdf FhDuets2.ps FhDuets2.pdf

# SeeFahrt die ist Lustig
SeeFahrt_die_ist_Lustig= 03-eine_SeeFahrt_die_ist_Lustig-G---V1.abc
#	03=eine_SeeFahrt_die_ist_Lustig-G---V2.abc
SeeFahrt_die_ist_Lustig: SeeFahrt_die_ist_Lustig.abc SeeFahrt_die_ist_Lustig.pdf
SeeFahrt_die_ist_Lustig.abc: $(SeeFahrt_die_ist_Lustig)
	abcjoin +C $(SeeFahrt_die_ist_Lustig) >SeeFahrt_die_ist_Lustig.abc
SeeFahrt_die_ist_Lustig.ps: SeeFahrt_die_ist_Lustig.abc fmt/_65.fmt
	$(a2p1) SeeFahrt_die_ist_Lustig.abc +Ffmt/FhDuets1.fmt \
	|PShdr SeeFahrt '' SeeFahrt \
	|PSftr %D $U/ %D >SeeFahrt_die_ist_Lustig.ps
SeeFahrt_die_ist_Lustig.pdf: SeeFahrt_die_ist_Lustig.ps
	ps2pdf SeeFahrt_die_ist_Lustig.ps SeeFahrt_die_ist_Lustig.pdf

# Kornblumenblau
Kornblumenblau= 04_Kornblumenblau-C--.abc
Kornblumenblau: Kornblumenblau.abc Kornblumenblau.pdf
Kornblumenblau.abc: $(Kornblumenblau)
	abcjoin +s $(Kornblumenblau) >Kornblumenblau.abc
Kornblumenblau.ps: Kornblumenblau.abc fmt/_75.fmt
	$(a2p2) -F fmt/_75.fmt -x Kornblumenblau.abc -O tmp.ps
	PShdr <tmp.ps SeeFahrt '' SeeFahrt \
	|PSftr %D $U/ %D >Kornblumenblau.ps
	rm tmp.ps
Kornblumenblau.pdf: Kornblumenblau.ps
	ps2pdf Kornblumenblau.ps Kornblumenblau.pdf
