5941779 [rkeene@sledge /home/rkeene/tmp/graphviz]$ cat -n dot.Makefile
 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
5941780 [rkeene@sledge /home/rkeene/tmp/graphviz]$

Click here to go back to the directory listing.
Click here to download this file.
last modified: 2010-02-02 22:47:23