| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
DOT=$(wildcard *.dot) |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
DOT:=$(filter-out b51.dot, $(DOT)) |
| 20 |
|
| 21 |
DOT:=$(filter-out b106.dot, $(DOT)) |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
DOT:=$(filter-out b15.dot, $(DOT)) |
| 27 |
|
| 28 |
DOT:=$(filter-out b81.dot, $(DOT)) |
| 29 |
|
| 30 |
DOT:=$(filter-out sides.dot, $(DOT)) |
| 31 |
|
| 32 |
DOT:=$(filter-out tee.dot, $(DOT)) |
| 33 |
|
| 34 |
|
| 35 |
DOT:=$(filter-out 4elt.dot, $(DOT)) |
| 36 |
DOT:=$(filter-out b29.dot, $(DOT)) |
| 37 |
DOT:=$(filter-out b81.dot, $(DOT)) |
| 38 |
DOT:=$(filter-out b100.dot, $(DOT)) |
| 39 |
DOT:=$(filter-out b102.dot, $(DOT)) |
| 40 |
DOT:=$(filter-out b103.dot, $(DOT)) |
| 41 |
DOT:=$(filter-out b104.dot, $(DOT)) |
| 42 |
DOT:=$(filter-out root.dot, $(DOT)) |
| 43 |
DOT:=$(filter-out root_circo.dot, $(DOT)) |
| 44 |
DOT:=$(filter-out root_twopi.dot, $(DOT)) |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
DOT:=$(filter-out html4.dot, $(DOT)) |
| 51 |
|
| 52 |
|
| 53 |
DOT:=$(filter-out multi.dot, $(DOT)) |
| 54 |
|
| 55 |
|
| 56 |
PNG=$(DOT:.dot=.png) |
| 57 |
|
| 58 |
INPUT_PNG=$(addprefix input/,$(PNG)) |
| 59 |
OUTPUT_PNG=$(addprefix output/,$(PNG)) |
| 60 |
|
| 61 |
all: |
| 62 |
|
| 63 |
test: input $(INPUT_PNG) output $(OUTPUT_PNG) |
| 64 |
@echo "PASS" |
| 65 |
|
| 66 |
input: |
| 67 |
mkdir -p $@ |
| 68 |
dot -V |
| 69 |
|
| 70 |
input/%.png: %.dot |
| 71 |
dot -Tpng -o $@ $< |
| 72 |
|
| 73 |
output: |
| 74 |
mkdir -p $@ |
| 75 |
|
| 76 |
output/%.png: %.dot |
| 77 |
dotfmt -o "output/$<" $< |
| 78 |
dot -Tpng -o $@ "output/$<" |
| 79 |
imgcmp "input/$(notdir $@)" $@ |
| 80 |
|
| 81 |
fetch: graphviz |
| 82 |
# Copy *.gv and *.dot files. |
| 83 |
find graphviz -type f -name '*.gv' -not -wholename "graphviz/rtest/share/b545.gv" -not -name "base.gv" | xargs -I '{}' cp "{}" . |
| 84 |
find graphviz -type f -name '*.dot' | xargs -I '{}' cp "{}" . |
| 85 |
|
| 86 |
# Rename *.gv to *.dot. |
| 87 |
#rename .gv .dot *.gv |
| 88 |
ls *.gv | xargs -I '{}' basename "{}" .gv | xargs -I '{}' mv "{}.gv" "{}.dot" |
| 89 |
|
| 90 |
# Remove execute permissions. |
| 91 |
chmod 0644 *.dot |
| 92 |
|
| 93 |
# Convert Latin1 encoded files to UTF-8. |
| 94 |
grep -l "charset=latin1" *.dot | xargs -I '{}' recode ISO-8859-1..UTF8 "{}" |
| 95 |
recode ISO-8859-1..UTF8 Latin1.dot |
| 96 |
|
| 97 |
# Clean up. |
| 98 |
rm -rf graphviz |
| 99 |
|
| 100 |
graphviz: |
| 101 |
git clone --depth=1 https://github.com/ellson/graphviz.git |
| 102 |
|
| 103 |
clean: |
| 104 |
rm -rf *.dot input output |
| 105 |
|
| 106 |
.PHONY: all test fetch clean |