U=http://trillian.mit.edu/~jc/music/book/SCD/Book49

all: books install

books: book49-V1 book49-V2

# Format V1 files using jcabc2ps:
book49-V1: book49-V1.abc book49-V1.ps book49-V1.pdf
book49-V1= [0-9][0-9][0-9][0-9][0-9][-_]*.abc
book49-V1.abc: $(book49-V1)
	abcjoin +C +F +S2 $(book49-V1) >book49-V1.abc
#	sleep 1
book49-V1.ps: book49-V1.abc fmt/V1.fmt
	jcabc2ps +k4 +Ffmt/V1.fmt +x book49-V1.abc \
	|PShdr %P "RSCDS Book 49" %P \
	|PSftr %D $U/ %D >book49-V1.ps
book49-V1.pdf: book49-V1.ps
	ps2pdf book49-V1.ps book49-V1.pdf

# Format V2 files using abcm2ps:
book49-V2: book49-V2.abc book49-V2.ps book49-V2.pdf
book49-V2= [0-9][0-9][0-9][0-9][0-9][=_]*.abc
book49-V2.abc: $(book49-V2)
	abcjoin +C +F +S2 $(book49-V2) >book49-V2.abc
#	sleep 1
book49-V2.ps: book49-V2.abc fmt/V2.fmt
	abcm2ps -x -F fmt/V2.fmt book49-V2.abc -O tmp.ps
	PShdr <tmp.ps %P "RSCDS Book 49" %P \
	|PSftr %D $U/ %D >book49-V2.ps
	rm tmp.ps
book49-V2.pdf: book49-V2.ps
	ps2pdf book49-V2.ps book49-V2.pdf

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

# Install in the ../book/SCD/ and ../book/ directories:
install: ../Book49-V1.abc ../../SCD_Book49-V1.abc \
		 ../Book49-V2.abc ../../SCD_Book49-V2.abc
../Book49-V1.abc: book49-V1.abc
	ln -f book49-V1.abc ../Book49-V1.abc
../../SCD_Book49-V1.abc: book49-V1.abc
	ln -f book49-V1.abc ../../SCD_Book49-V1.abc
../Book49-V2.abc: book49-V2.abc
	ln -f book49-V2.abc ../Book49-V2.abc
../../SCD_Book49-V2.abc: book49-V2.abc
	ln -f book49-V2.abc ../../SCD_Book49-V2.abc
