1 PAGEHEIGHT = 11 2 PAGEWIDTH = 8.5 3 BORDERWIDTH = 0.25 4 BORDERHEIGHT = 0.5 5 6 %.png: %.dot 7 dot -Tpng < "$^" > "$@" 8 9 %.ps: %.png 10 @echo "identify -verbose \"$^\""; \ 11 imagewidth=`identify -verbose "$^" | grep '^ *Geometry: *' | sed 's@^ *Geometry: *\([0-9]*\)x\([0-9]*\)+.*$$@\1@'`; \ 12 sectionheight=`echo "scale=10; $${imagewidth} * (($(PAGEHEIGHT) * 1.0) / ($(PAGEWIDTH) * 1.0))" | bc -q | cut -f 1 -d .`; \ 13 echo convert "$^" -crop "$${imagewidth}x$${sectionheight}" -page `echo "scale=10; ($(PAGEWIDTH) - (2 * $(BORDERWIDTH))) * 72" | bc -q | cut -f 1 -d .`x`echo "scale=10; ($(PAGEHEIGHT) - ($(BORDERHEIGHT) * 2)) * 72" | bc -q | cut -f 1 -d .`+`echo "scale=10; $(BORDERWIDTH) * 72" | bc -q | cut -f 1 -d .`+`echo "scale=10; $(BORDERHEIGHT) * 72" | bc -q | cut -f 1 -d .` "$@"; \ 14 convert "$^" -crop "$${imagewidth}x$${sectionheight}" -page `echo "scale=10; ($(PAGEWIDTH) - (2 * $(BORDERWIDTH))) * 72" | bc -q | cut -f 1 -d .`x`echo "scale=10; ($(PAGEHEIGHT) - ($(BORDERHEIGHT) * 2)) * 72" | bc -q | cut -f 1 -d .`+`echo "scale=10; $(BORDERWIDTH) * 72" | bc -q | cut -f 1 -d .`+`echo "scale=10; $(BORDERHEIGHT) * 72" | bc -q | cut -f 1 -d .` "$@" 15 16 %.pdf: %.ps 17 ps2pdf -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode "$^" "$@" 18 19 clean: 20 rm -f *.png 21 rm -f *.ps *.pdf 22 23 .PHONY: all clean |