a2p=jcabc2ps
U=http://trillian.mit.edu/~jc/music/abc/Australia

all: new sets

# new tunes
new: new_Aus.abc new_Aus.pdf
new_Aus: */*.abc new_Aus.abc new_Aus.ps new_Aus.pdf
#	find */ -mtime -15 -name '*.abc' | xargs tonew
	make new_Aus.abc new_Aus.ps new_Aus.pdf
new_Aus.abc: hdr/new_Aus.hdr new/*.abc
	abcjoin +CRS hdr/new_Aus.hdr new/*.abc > new_Aus.abc
new_Aus.ps:  new_Aus.abc fmt/new_Aus.fmt
	$(a2p) new_Aus.abc +k4 +Ffmt/new_Aus.fmt \
	|PShdr %P "New Australian Tunes" %P \
	|PSftr %D $U/new/ %D >new_Aus.ps
new_Aus.pdf: new_Aus.ps;    ps2pdf new_Aus.ps new_Aus.pdf

sets: hornpipes jigs marches polkas reels waltzes 

hornpipes: hornpipes.abc hornpipes.pdf
hornpipes.abc: hornpipe/??*.abc
	abcjoin +R +s hornpipe/??*.abc > hornpipes.abc
hornpipes.ps: hornpipes.abc fmt/hornpipes.fmt
	$(a2p) +c hornpipes.abc +Ffmt/hornpipes.fmt \
	|PShdr %P "New Australian Hornpipes" %P \
	|PSftr %D $U/ %D >hornpipes.ps
hornpipes.pdf: hornpipes.ps; ps2pdf hornpipes.ps hornpipes.pdf

jigs: jigs.abc jigs.pdf
jigs.abc: jig/??*.abc
	abcjoin +R +s jig/??*.abc > jigs.abc
jigs.ps: jigs.abc fmt/jigs.fmt
	$(a2p) jigs.abc +Ffmt/jigs.fmt \
	|PShdr %P "New Australian Jigs" %P \
	|PSftr %D $U/ %D >jigs.ps
jigs.pdf: jigs.ps
	ps2pdf jigs.ps jigs.pdf

marches: marches.abc marches.pdf
marches.abc: march/??*.abc
	abcjoin +R +s march/??*.abc > marches.abc
marches.ps: marches.abc fmt/marches.fmt
	$(a2p) marches.abc +Ffmt/marches.fmt \
	|PShdr %P "New Australian Marches" %P \
	|PSftr %D $U/ %D >marches.ps
marches.pdf: marches.ps
	ps2pdf marches.ps marches.pdf

polkas: polkas.abc polkas.pdf
polkas.abc: polka/??*.abc
	abcjoin +R +s polka/??*.abc > polkas.abc
polkas.ps: polkas.abc fmt/polkas.fmt
	$(a2p) polkas.abc +Ffmt/polkas.fmt \
	|PShdr %P "New Australian Polkas" %P \
	|PSftr %D $U/ %D >polkas.ps
polkas.pdf: polkas.ps
	ps2pdf polkas.ps polkas.pdf

reels: reels.abc reels.pdf
reels.abc: reel/??*.abc
	abcjoin +R +s reel/??*.abc > reels.abc
reels.ps: reels.abc fmt/reels.fmt
	$(a2p) reels.abc +c +Ffmt/reels.fmt \
	|PShdr %P "New Australian Reels" %P \
	|PSftr %D $U/ %D >reels.ps
reels.pdf: reels.ps
	ps2pdf reels.ps reels.pdf

waltzes: waltzes.abc waltzes.pdf
waltzes.abc: waltz/??*.abc
	abcjoin +R +s waltz/??*.abc > waltzes.abc
waltzes.ps: waltzes.abc fmt/waltzes.fmt
	$(a2p) -c +x waltzes.abc +Ffmt/waltzes.fmt \
	|PShdr %P "New Australian Waltzes" %P \
	|PSftr %D $U/ %D >waltzes.ps
waltzes.pdf: waltzes.ps
	ps2pdf waltzes.ps waltzes.pdf
