github.com/jingcheng-WU/gonum@v0.9.1-0.20210323123734-f1a2a11a8f7b/graph/formats/dot/testdata/Makefile (about) 1 # Dependencies: 2 # 3 # * imgcmp 4 # go get github.com/mewkiz/cmd/imgcmp 5 # * dotfmt 6 # go get github.com/graphism/dot/cmd/dotfmt 7 # * dot 8 # sudo pacman -S graphviz 9 # * recode 10 # sudo pacman -S recode 11 12 DOT=$(wildcard *.dot) 13 14 # Skip DOT files for which the generated PNG images mismatch. 15 # 16 # ref: https://github.com/graphism/dot/issues/2 17 # 18 # pixel colors differ at x=550, y=1885 19 DOT:=$(filter-out b51.dot, $(DOT)) 20 # pixel colors differ at x=5395, y=1920 21 DOT:=$(filter-out b106.dot, $(DOT)) 22 23 # Skip segfaulting files. 24 # 25 # Segmentation fault (core dumped) 26 DOT:=$(filter-out b15.dot, $(DOT)) 27 # Segmentation fault (core dumped) 28 DOT:=$(filter-out b81.dot, $(DOT)) 29 # *** stack smashing detected ***: dot terminated 30 DOT:=$(filter-out sides.dot, $(DOT)) 31 # *** stack smashing detected ***: dot terminated 32 DOT:=$(filter-out tee.dot, $(DOT)) 33 34 # Skip DOT files above 100 kB. 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 # Skip invalid DOT file. 47 # 48 # Error: No or improper image file="eqn.png" 49 # in label of node struct1 50 DOT:=$(filter-out html4.dot, $(DOT)) 51 52 # Skip multi-graph DOT file which outputs to standard output. 53 DOT:=$(filter-out multi.dot, $(DOT)) 54 55 # *.dot -> *.png 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