

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

all:  GirlFromIpanema

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

neat:         ; /bin/rm -f *-
clean:    neat; /bin/rm -f *.out *.ps *.pdf new.*
	find new/ -name '*.abc' -mtime +30 -exec ls -l {} ';' -exec /bin/rm {} ';'
clobber: clean
	/bin/rm -f core *.core core.*
	rm -f Addrs/*
	rm -rf [0-9]* log/* tmp/*

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
# Commands to fill in the new/ directory, and combine the tunes there into a 
# printable collection.

new: */*.abc # new.abc new.ps new.pdf
	find */ -mtime -30 -name '*.abc' | xargs tonew
	make new.abc new.ps new.pdf
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 %P "NEW ANTHEMS" %P \
	|PSftr %D $U/new/ %D >new.ps
new.pdf: new.ps
	ps2pdf new.ps

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

# jj
jj= tune/jj_1.abc tune/jj_2.abc
jj: jj.abc jj.ps jj.pdf
jj.abc: $(jj)
	abcjoin +s $(jj) >jj.abc
jj.ps: jj.abc fmt/_75.fmt
	$(a2p) +Ffmt/_75 jj.abc \
	| PShdr jj "" jj \
	| PSftr %D $U %D >jj.ps
jj.pdf: jj.ps
	ps2pdf jj.ps jj.pdf

# mh Prototype for a medley with a .hdr file:
mh: mh.abc mh.ps mh.pdf
mh= _1.abc _2.abc _3.abc
mh.abc: hdr/mh.hdr $(mh)
	abcmedley mh $(mh) >mh.abc
mh.ps: mh.abc mh.fmt
	$(a2p) +Fmh mh.abc \
	| PShdr mh "" mh \
	| PSftr %D $U %D >mh.ps
mh.pdf: mh.ps
	ps2pdf mh.ps mh.pdf

# mm Prototype for a medley without a .hdr file:
mm: mm.abc mm.ps mm.pdf
mm= _1.abc _2.abc _3.abc
mm.abc: $(mm)
	abcmedley "____" $(mm) >mm.abc
mm.ps: mm.abc fmt/_75.fmt
	$(a2p) +Ffmt/_75 mm.abc \
	| PShdr mm "" mm \
	| PSftr %D $U %D >mm.ps
mm.pdf: mm.ps
	ps2pdf mm.ps mm.pdf

# tt
tt: tt.abc tt.ps tt.pdf
tt.ps: tt.abc fmt/_75.fmt
	$(a2p) +Ffmt/_75 -p tt \
	| PShdr tt "" tt \
	| PSftr %D $U %D >tt.ps
tt.pdf: tt.ps
	ps2pdf tt.ps tt.pdf

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

# GirlFromIpanema
GirlFromIpanema= song/Girl_From_Ipanema_Garota_de_Ipanema_1.abc
GirlFromIpanema: GirlFromIpanema.abc GirlFromIpanema.ps GirlFromIpanema.pdf
GirlFromIpanema.abc: $(GirlFromIpanema)
	abcjoin +S2 $(GirlFromIpanema) >GirlFromIpanema.abc
GirlFromIpanema.ps: GirlFromIpanema.abc fmt/GirlFromIpanema.fmt
	$(a2p) +c +Ffmt/GirlFromIpanema -p GirlFromIpanema \
	| PShdr GirlFromIpanema "" GirlFromIpanema \
	| PSftr %D $U %D >GirlFromIpanema.ps
GirlFromIpanema.pdf: GirlFromIpanema.ps
	ps2pdf GirlFromIpanema.ps GirlFromIpanema.pdf
